Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
24 | public function autorun() : void |
||
25 | { |
||
26 | $settingModel = new Model\Setting(); |
||
27 | $contentModel = new Model\Content(); |
||
28 | $dbStatus = $this->_registry->get('dbStatus'); |
||
29 | $lastTable = $this->_registry->get('lastTable'); |
||
30 | $lastId = $this->_registry->get('lastId'); |
||
31 | $path = 'templates' . DIRECTORY_SEPARATOR . $this->_filePlaceholder . DIRECTORY_SEPARATOR . 'index.phtml'; |
||
32 | $setupArray = |
||
33 | [ |
||
34 | 'query' => $this->_request->getQuery('t'), |
||
35 | 'session' => $this->_request->getSession('template'), |
||
36 | 'contents' => $contentModel->getByTableAndId($lastTable, $lastId)->template, |
||
37 | 'settings' => $dbStatus === 2 ? $settingModel->get('template') : null, |
||
38 | 'fallback' => 'default' |
||
39 | ]; |
||
40 | |||
41 | /* detect template */ |
||
42 | |||
43 | $this->_output = $this->_detect('template', $path, $setupArray); |
||
44 | } |
||
45 | } |
||
46 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.