ILIAS  release_7 Revision v7.30-3-g800a261c036
PlusJob.php
Go to the documentation of this file.
1<?php
2
4
5use ILIAS\BackgroundTasks\Implementation\Bucket\BucketMock;
11
12class 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}
An exception for terminatinating execution or to throw for unit testing.
run(array $input, Observer $observer)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples