1 | <?php |
||
25 | class Workflow extends AbstractResource implements WorkflowInterface |
||
26 | { |
||
27 | /** |
||
28 | * Kind. |
||
29 | */ |
||
30 | public const KIND = 'Workflow'; |
||
31 | |||
32 | /** |
||
33 | * Workflow name. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $name; |
||
38 | |||
39 | /** |
||
40 | * Endpoint. |
||
41 | * |
||
42 | * @var EndpointInterface |
||
43 | */ |
||
44 | protected $endpoint; |
||
45 | |||
46 | /** |
||
47 | * Logger. |
||
48 | * |
||
49 | * @var LoggerInterface |
||
50 | */ |
||
51 | protected $logger; |
||
52 | |||
53 | /** |
||
54 | * Attribute map. |
||
55 | * |
||
56 | * @var AttributeMap |
||
57 | */ |
||
58 | protected $attribute_map; |
||
59 | |||
60 | /** |
||
61 | * Condition. |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $ensure = WorkflowInterface::ENSURE_EXISTS; |
||
66 | |||
67 | /** |
||
68 | * Condiditon. |
||
69 | */ |
||
70 | protected $condition; |
||
71 | |||
72 | /** |
||
73 | * V8 engine. |
||
74 | * |
||
75 | * @var V8Engine |
||
76 | */ |
||
77 | protected $v8; |
||
78 | |||
79 | /** |
||
80 | * Initialize. |
||
81 | */ |
||
82 | public function __construct(string $name, string $ensure, V8Engine $v8, AttributeMapInterface $attribute_map, EndpointInterface $endpoint, LoggerInterface $logger, array $resource = []) |
||
83 | { |
||
84 | $this->name = $name; |
||
85 | $this->ensure = $ensure; |
||
86 | $this->v8 = $v8; |
||
87 | $this->attribute_map = $attribute_map; |
||
|
|||
88 | $this->endpoint = $endpoint; |
||
89 | $this->logger = $logger; |
||
90 | $this->resource = $resource; |
||
91 | $this->condition = $resource['data']['condition']; |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function getIdentifier(): string |
||
101 | |||
102 | /** |
||
103 | * Get ensure. |
||
104 | */ |
||
105 | public function getEnsure(): string |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function decorate(ServerRequestInterface $request): array |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function getEndpoint(): EndpointInterface |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function getAttributeMap(): AttributeMapInterface |
||
149 | |||
150 | /** |
||
151 | * check condition. |
||
152 | */ |
||
153 | protected function checkCondition(array $object): bool |
||
181 | } |
||
182 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.