ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SVGDummyMachine.php
Go to the documentation of this file.
1<?php
2
20
26
31{
32 public function __construct()
33 {
35 $this->load(
36 'svg_color_changing_machine',
37 'svg_color_changing'
38 );
39 }
40
41
42 #[\Override]
43 public function processStream(
44 FileInformation $information,
45 FileStream $stream,
46 FlavourDefinition $for_definition
47 ): \Generator {
48 $content = (string) $stream;
49
50 $from_color = ':' . $for_definition->getColor() . ';';
51 $to_color = ':' . $for_definition->getToColor() . ';';
52 $content = str_replace($from_color, $to_color, $content);
53
54 yield new Result(
55 $for_definition,
56 Streams::ofString($content)
57 );
58 }
59}
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
load(string $id, ?string $can_handle_definition_id=null, string $depends_on_engine=NoEngine::class)
__construct()
FlavourMachines must be able to be created without further dependencies.
processStream(FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
The base interface for all filesystem streams.
Definition: FileStream.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...