1 | <?php |
||
10 | class Operation |
||
11 | { |
||
12 | /** |
||
13 | * @var string[] |
||
14 | */ |
||
15 | protected $idx; |
||
16 | |||
17 | /** |
||
18 | * @var callable |
||
19 | */ |
||
20 | protected $callback; |
||
21 | |||
22 | /** |
||
23 | * @var mixed |
||
24 | */ |
||
25 | protected $value; |
||
26 | |||
27 | /** |
||
28 | * Set callback. |
||
29 | * |
||
30 | * @param callable $callback |
||
31 | * The callback. |
||
32 | * |
||
33 | * @return $this |
||
34 | */ |
||
35 | public function setCallback(callable $callback) |
||
40 | |||
41 | /** |
||
42 | * Get callback. |
||
43 | * |
||
44 | * @return callable|null |
||
45 | */ |
||
46 | public function getCallback() |
||
50 | |||
51 | /** |
||
52 | * @param mixed $value |
||
53 | * The value to set. |
||
54 | * |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function setValue($value) |
||
62 | |||
63 | /** |
||
64 | * Get value. |
||
65 | * |
||
66 | * @return mixed |
||
67 | */ |
||
68 | public function getValue() |
||
72 | |||
73 | /** |
||
74 | * @param Connection $connection |
||
75 | * The connection to use for this id. |
||
76 | * @param string $id |
||
|
|||
77 | * The id. |
||
78 | * |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function setIdx(Connection $connection, $idx) |
||
82 | { |
||
83 | $this->idx[$connection->connectionId()] = $idx; |
||
84 | return $this; |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * Get id. |
||
89 | * |
||
90 | * @param Connection $connection |
||
91 | * The connection to get id from. |
||
92 | * |
||
93 | * @return string|null |
||
94 | */ |
||
95 | public function idx(Connection $connection) |
||
96 | { |
||
97 | $connectionId = $connection->connectionId(); |
||
98 | return isset($this->idx[$connectionId]) ? $this->idx[$connectionId] : null; |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * Execute operation. |
||
103 | * |
||
104 | * @return mixed |
||
105 | */ |
||
106 | public function execute() |
||
110 | } |
||
111 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.