1 | <?php |
||
2 | |||
3 | namespace Jabe\Impl\Cmd; |
||
4 | |||
5 | use Jabe\Impl\Interceptor\{ |
||
6 | CommandInterface, |
||
7 | CommandContext |
||
8 | }; |
||
9 | use Jabe\Impl\Persistence\Entity\{ |
||
10 | ExecutionEntity, |
||
11 | ExecutionManager |
||
12 | }; |
||
13 | use Jabe\Impl\Util\EnsureUtil; |
||
14 | |||
15 | class FindActiveActivityIdsCmd implements CommandInterface, \Serializable |
||
16 | { |
||
17 | protected $executionId; |
||
18 | |||
19 | public function __construct(string $executionId) |
||
20 | { |
||
21 | $this->executionId = $executionId; |
||
22 | } |
||
23 | |||
24 | public function serialize() |
||
25 | { |
||
26 | return json_encode([ |
||
27 | 'executionId' => $this->executionId |
||
28 | ]); |
||
29 | } |
||
30 | |||
31 | public function unserialize($data) |
||
32 | { |
||
33 | $json = json_decode($data); |
||
34 | $this->executionId = $json->executionId; |
||
35 | } |
||
36 | |||
37 | public function execute(CommandContext $commandContext) |
||
38 | { |
||
39 | EnsureUtil::ensureNotNull("executionId", "executionId", $this->executionId); |
||
40 | |||
41 | // fetch execution |
||
42 | $executionManager = $commandContext->getExecutionManager(); |
||
43 | $execution = $executionManager->findExecutionById($this->executionId); |
||
44 | EnsureUtil::ensureNotNull("execution " . $this->executionId . " doesn't exist", "execution", $execution); |
||
45 | |||
46 | $this->checkGetActivityIds($execution, $commandContext); |
||
47 | |||
48 | // fetch active activities |
||
49 | return $execution->findActiveActivityIds(); |
||
50 | } |
||
51 | |||
52 | protected function checkGetActivityIds(ExecutionEntity $execution, CommandContext $commandContext): void |
||
53 | { |
||
54 | foreach ($commandContext->getProcessEngineConfiguration()->getCommandCheckers() as $checker) { |
||
0 ignored issues
–
show
|
|||
55 | $checker->checkReadProcessInstance($execution); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.