ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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 }
processStream(FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
__construct()
FlavourMachines must be able to be created without further dependencies.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
__construct(Container $dic, ilPlugin $plugin)
load(string $id, ?string $can_handle_definition_id=null, string $depends_on_engine=NoEngine::class)
The base interface for all filesystem streams.
Definition: FileStream.php:31