phpstan fixes

This commit is contained in:
Dennis Eichhorn 2020-11-27 22:56:16 +01:00
parent f1581f71c2
commit e087e42c20

View File

@ -52,13 +52,16 @@ final class SearchController extends Controller
$lang = $this->app->l11nServer->getLanguage();
}
$searchIdStartPos = \stripos($request->getData('search'), ':');
$patternStartPos = $searchIdStartPos === false ? -1 : \stripos(
$request->getData('search'),
' ',
$searchIdStartPos
);
$pattern = \substr(
$request->getData('search'),
\stripos(
$request->getData('search'),
' ',
\stripos($request->getData('search'), ':')
) + 1
$patternStartPos + 1
);
$files = [];
@ -79,7 +82,7 @@ final class SearchController extends Controller
}
$contentLength = \strlen($content);
$headline = \strtok($content, "\n");
$headline = ($temp = \strtok($content, "\n")) === false ? '' : $temp;
$t1 = \strripos($content, "\n", -$contentLength + $found);
$t2 = \strripos($content, '.', -$contentLength + $found);