ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
PlusJob.php
Go to the documentation of this file.
1 <?php
2 
20 
26 
27 class PlusJob extends AbstractJob
28 {
32  public function getInputTypes(): array
33  {
34  return [
35  new SingleType(IntegerValue::class),
36  new SingleType(IntegerValue::class),
37  ];
38  }
39 
40  public function getOutputType(): Type
41  {
42  return new SingleType(IntegerValue::class);
43  }
44 
49  public function run(array $input, Observer $observer): Value
50  {
52  $a = $input[0];
54  $b = $input[1];
55 
56  $output = new IntegerValue();
57  $output->setValue($a->getValue() + $b->getValue());
58 
59  return $output;
60  }
61 
66  public function isStateless(): bool
67  {
68  return true;
69  }
70 
75  {
76  return 1;
77  }
78 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: AbstractJob.php:19
run(array $input, Observer $observer)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples