| Conditions | 6 |
| Paths | 4 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6.2163 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 3 | public function hash($hash) |
|
| 21 | { |
||
| 22 | 3 | if (is_object($hash) && is_a($hash, \Closure::class)) { |
|
| 23 | 1 | $this->hash = $hash; |
|
|
|
|||
| 24 | 1 | return $this; |
|
| 25 | } |
||
| 26 | |||
| 27 | 2 | if (is_string($hash) && function_exists($hash)) { |
|
| 28 | 1 | $this->hash = $hash; |
|
| 29 | 1 | return $this; |
|
| 30 | } |
||
| 31 | |||
| 32 | // dummy |
||
| 33 | 1 | if (is_null($hash)) { |
|
| 34 | $this->hash = function($value) { |
||
| 35 | return $value; |
||
| 36 | }; |
||
| 37 | return $this; |
||
| 38 | } |
||
| 39 | |||
| 40 | 1 | throw new \RuntimeException('Hash for PasswordField must be valid function name or closure'); |
|
| 41 | } |
||
| 42 | |||
| 80 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..