mirror of
https://github.com/Karaka-Management/oms-Navigation.git
synced 2026-01-11 16:18:42 +00:00
phpstan fixes
This commit is contained in:
parent
5fab236ed7
commit
e18bf518cd
|
|
@ -52,13 +52,17 @@ final class SearchController extends Controller
|
|||
|
||||
/** @var \Modules\Navigation\Models\NavElement[] $elements */
|
||||
$elements = NavElementMapper::getAll();
|
||||
$search = \mb_strtolower(\substr(
|
||||
$request->getData('search'),
|
||||
\stripos(
|
||||
|
||||
$searchIdStartPos = \stripos($request->getData('search'), ':');
|
||||
$patternStartPos = $searchIdStartPos === false ? -1 : \stripos(
|
||||
$request->getData('search'),
|
||||
' ',
|
||||
\stripos($request->getData('search'), ':')
|
||||
) + 1
|
||||
$searchIdStartPos
|
||||
);
|
||||
|
||||
$search = \mb_strtolower(\substr(
|
||||
$request->getData('search'),
|
||||
$patternStartPos + 1
|
||||
));
|
||||
|
||||
$found = null;
|
||||
|
|
@ -81,7 +85,7 @@ final class SearchController extends Controller
|
|||
|
||||
$response->header->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
|
||||
|
||||
if ($found === null) {
|
||||
if ($found === null || $found->uri === null) {
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::WARNING, 'Command', 'Unknown command "' . $search . '"', $search);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ final class TimerecordingController extends Controller
|
|||
$navView = new NavigationView($this->app->l11nManager, $request, $response);
|
||||
$navView->setTemplate('/Modules/Navigation/Theme/Backend/mid');
|
||||
$navView->setNav($nav->getNav());
|
||||
$navView->setParent($pageId);
|
||||
$navView->parent = $pageId;
|
||||
|
||||
return $navView;
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ final class TimerecordingController extends Controller
|
|||
|
||||
$navView->setTemplate('/Modules/Navigation/Theme/Timerecording/splash');
|
||||
$navView->setNav($nav->getNav());
|
||||
$navView->setParent($pageId);
|
||||
$navView->parent = $pageId;
|
||||
|
||||
return $navView;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user