| 1 | <?php |
||
| 14 | class ResultKeeper |
||
| 15 | { |
||
| 16 | private $errors = []; |
||
| 17 | |||
| 18 | private $failures = []; |
||
| 19 | |||
| 20 | private $updated = []; |
||
| 21 | |||
| 22 | private $created = []; |
||
| 23 | |||
| 24 | public function add(Result $result) |
||
| 42 | |||
| 43 | public function addError(Error $error) : void |
||
| 47 | |||
| 48 | public function addFailure(Failure $failure) : void |
||
| 52 | |||
| 53 | public function addCreated(Created $created) : void |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return \Callingallpapers\ResultKeeper\Created[] |
||
| 64 | */ |
||
| 65 | public function getCreated() : array |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @return \Callingallpapers\ResultKeeper\Updated[] |
||
| 72 | */ |
||
| 73 | public function getUpdated() : array |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @return \Callingallpapers\ResultKeeper\Failure[] |
||
| 80 | */ |
||
| 81 | public function getFailed() : array |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @return \Callingallpapers\ResultKeeper\Error[] |
||
| 88 | */ |
||
| 89 | public function getErrored() : array |
||
| 93 | } |
||
| 94 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.