ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PlusJob.php
Go to the documentation of this file.
1<?php
2
4
5use ILIAS\BackgroundTasks\Implementation\Bucket\BucketMock;
12
13class PlusJob extends AbstractJob
14{
15
22 public function __construct()
23 {
24 }
25
26
30 public function getInputTypes()
31 {
32 return [
33 new SingleType(IntegerValue::class),
34 new SingleType(IntegerValue::class),
35 ];
36 }
37
38
42 public function getOutputType()
43 {
44 return new SingleType(IntegerValue::class);
45 }
46
47
54 public function run(array $input, Observer $observer)
55 {
57 $a = $input[0];
59 $b = $input[1];
60
61 $output = new IntegerValue();
62 $output->setValue($a->getValue() + $b->getValue());
63
64 return $output;
65 }
66
67
72 public function isStateless()
73 {
74 return true;
75 }
76
77
82 {
83 return 1;
84 }
85}
An exception for terminatinating execution or to throw for unit testing.
run(array $input, Observer $observer)