ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PlusJob.php
Go to the documentation of this file.
1 <?php
2 
4 
11 
12 class PlusJob extends AbstractJob
13 {
14 
21  public function __construct()
22  {
23  }
24 
25 
29  public function getInputTypes()
30  {
31  return [
32  new SingleType(IntegerValue::class),
33  new SingleType(IntegerValue::class),
34  ];
35  }
36 
37 
41  public function getOutputType()
42  {
43  return new SingleType(IntegerValue::class);
44  }
45 
46 
53  public function run(array $input, Observer $observer)
54  {
56  $a = $input[0];
58  $b = $input[1];
59 
60  $output = new IntegerValue();
61  $output->setValue($a->getValue() + $b->getValue());
62 
63  return $output;
64  }
65 
66 
71  public function isStateless()
72  {
73  return true;
74  }
75 
76 
81  {
82  return 1;
83  }
84 }
run(array $input, Observer $observer)