1 | <?php |
||
25 | class FailedToInstantiateObject extends RuntimeException implements ShortcodeException { |
||
26 | |||
27 | /** |
||
28 | * Create a new instance from a passed-in class name or factory callable. |
||
29 | * |
||
30 | * @since 0.3.0 |
||
31 | * |
||
32 | * @param mixed $factory Class name or factory callable. |
||
33 | * @param string $interface Interface name that the object should have |
||
34 | * implemented. |
||
35 | * @param Exception $exception Exception that was caught. |
||
|
|||
36 | * @return static Instance of an exception. |
||
37 | */ |
||
38 | public static function fromFactory( $factory, $interface, $exception = null ) { |
||
68 | |||
69 | /** |
||
70 | * Create a new instance from a passed-in object that does not implement the |
||
71 | * correct interface. |
||
72 | * |
||
73 | * @since 0.3.0 |
||
74 | * |
||
75 | * @param mixed $factory Class name or factory callable. |
||
76 | * @param string $interface Interface name that the object should have |
||
77 | * implemented. |
||
78 | * @return static Instance of an exception. |
||
79 | */ |
||
80 | public static function fromInvalidObject( $factory, $interface ) { |
||
88 | } |
||
89 |
This check looks for
@param
annotations 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.