We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 29 | class PageController extends Controller |
||
| 30 | { |
||
| 31 | /** |
||
| 32 | * @var Page |
||
| 33 | */ |
||
| 34 | private $currentPage; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * PageController constructor. |
||
| 38 | * @param PageRepository $pages |
||
| 39 | */ |
||
| 40 | public function __construct(PageRepository $pages) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Redirects must use a controller to handle the parameter, as they require a specified target. |
||
| 47 | * @return mixed |
||
| 48 | */ |
||
| 49 | public function redirect() |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Standard page views are once that use the URL as the designated target. |
||
| 56 | * |
||
| 57 | * @return mixed |
||
| 58 | * @throws \Exception |
||
| 59 | * @internal param FrontPageLoader $pageLoader |
||
| 60 | */ |
||
| 61 | public function index() |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return mixed |
||
| 68 | */ |
||
| 69 | private function navigationData() |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @param Page $page |
||
| 76 | * @return bool |
||
| 77 | */ |
||
| 78 | private function trackEvents(Page $page) |
||
| 86 | } |
||
| 87 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountIdthat can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theidproperty of an instance of theAccountclass. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.