1 | <?php |
||
20 | class Create implements Action, ActionSet |
||
21 | { |
||
22 | use QueryBuilder, AuthenticationHelper; |
||
23 | |||
24 | protected $kernel; |
||
25 | protected $url = '/'; |
||
26 | /** |
||
27 | * Request type to created |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $HTTP_TYPE = 'POST'; |
||
31 | protected $data = []; |
||
32 | |||
33 | 2 | public function injectionKernel(KernelBpm $bpm) |
|
34 | { |
||
35 | 2 | $this->kernel = $bpm; |
|
36 | 2 | } |
|
37 | |||
38 | 1 | public function getUrl() |
|
42 | |||
43 | 1 | public function processData() |
|
44 | { |
||
45 | 1 | $this->query(); |
|
46 | 1 | return $this->kernel->getHandler(); |
|
47 | } |
||
48 | |||
49 | 1 | public function setData(array $data) |
|
53 | |||
54 | 1 | private function query() |
|
55 | { |
||
69 | } |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: