| 1 | <?php |
||
| 5 | class Mixed { |
||
| 6 | /** |
||
| 7 | * Converts a value to an array containing this value if needed |
||
| 8 | * The $check_for_callable flag is there to prevent coincidences that |
||
| 9 | * can happen with [$object, 'stringThatMatchesAMethodOf$object'] |
||
| 10 | * |
||
| 11 | * @param mixed $argument |
||
| 12 | * @param boolean $check_for_callable |
||
| 13 | * @return array |
||
| 14 | */ |
||
| 15 | public static function toArray( $argument, $check_for_callable = false ) { |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Executes a value depending on what type it is and returns the result |
||
| 29 | * Callable: call |
||
| 30 | * Instance: call method |
||
| 31 | * Class: instantiate and call method |
||
| 32 | * Other: return it |
||
| 33 | * |
||
| 34 | * @param mixed $entity |
||
| 35 | * @param array $arguments |
||
| 36 | * @param string $method |
||
|
|
|||
| 37 | * @return mixed |
||
| 38 | */ |
||
| 39 | public static function value( $entity, $arguments = [], $method = null ) { |
||
| 51 | } |
||
| 52 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.