1 | <?php namespace SimpleHash; |
||
16 | class HashFactory |
||
17 | { |
||
18 | /** |
||
19 | * Calculator parameter |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $calculatorParams = array(); |
||
24 | |||
25 | /** |
||
26 | * Constructor |
||
27 | * |
||
28 | * @param array $calculatorParams |
||
29 | */ |
||
30 | 6 | public function __construct(array $calculatorParams = []) |
|
34 | |||
35 | /** |
||
36 | * Magic factory method |
||
37 | * |
||
38 | * @param string $name |
||
39 | * @param array $arguments |
||
40 | * @throws SimpleHashException |
||
41 | */ |
||
42 | 4 | public function __call($name, $arguments) |
|
70 | |||
71 | /** |
||
72 | * Checks if a getter method was called |
||
73 | * |
||
74 | * @param string $name |
||
75 | * @return string |
||
76 | */ |
||
77 | 4 | private function isCalledGetter($name) |
|
81 | |||
82 | /** |
||
83 | * Builds the calculator class name string |
||
84 | * |
||
85 | * @param string $name |
||
86 | * @return string |
||
87 | */ |
||
88 | 4 | private function getCalculatorName($name) |
|
93 | |||
94 | /** |
||
95 | * Checks if the given class name exists |
||
96 | * |
||
97 | * @param string $calculatorClass |
||
98 | * @return boolean |
||
99 | */ |
||
100 | 4 | private function calculatorExists($calculatorClass) |
|
104 | |||
105 | /** |
||
106 | * Extracts the string for hashing from the given argument array |
||
107 | * |
||
108 | * @param array $arguments |
||
109 | * @return string |
||
110 | */ |
||
111 | 3 | private function getPlainStringFromArguments($arguments) |
|
119 | |||
120 | /** |
||
121 | * Initialize calculator object |
||
122 | * |
||
123 | * @param string $calculatorClass |
||
124 | * @param array $params |
||
|
|||
125 | * @return \SimpleHash\Calculator\HashCalculatorInterface |
||
126 | */ |
||
127 | 2 | private function initializeCalculator($calculatorClass) |
|
131 | |||
132 | /** |
||
133 | * CHecks if the calculator class exists |
||
134 | * |
||
135 | * @param string $name |
||
136 | * @return boolean |
||
137 | */ |
||
138 | 1 | public function hasCalculator($name) |
|
142 | } |
||
143 |
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.