Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
25 | 7 | public function autorun() : void |
|
26 | { |
||
27 | 7 | $settingModel = new Model\Setting(); |
|
28 | 7 | $contentModel = new Model\Content(); |
|
29 | 7 | $specialFilter = new Filter\Special(); |
|
30 | 7 | $dbStatus = $this->_registry->get('dbStatus'); |
|
31 | 7 | $lastTable = $this->_registry->get('lastTable'); |
|
32 | 7 | $lastId = $this->_registry->get('lastId'); |
|
33 | 7 | $content = $contentModel->getByTableAndId($lastTable, $lastId); |
|
34 | 7 | $path = 'templates' . DIRECTORY_SEPARATOR . $this->_filePlaceholder . DIRECTORY_SEPARATOR . 'index.phtml'; |
|
35 | $setupArray = |
||
36 | [ |
||
37 | 7 | 'query' => $specialFilter->sanitize($this->_request->getQuery('t')), |
|
38 | 7 | 'session' => $this->_request->getSession('template'), |
|
39 | 7 | 'contents' => $content->template ?? null, |
|
40 | 7 | 'settings' => $dbStatus === 2 ? $settingModel->get('template') : null, |
|
41 | 7 | 'fallback' => 'default' |
|
42 | ]; |
||
43 | |||
44 | /* detect template */ |
||
45 | |||
46 | 7 | $this->_output = $this->_detect('template', $path, $setupArray); |
|
47 | 7 | } |
|
48 | } |
||
49 |
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.