First part of a large code cleanup commit.

This commit is contained in:
James Cole
2019-02-12 21:49:28 +01:00
parent b273af341c
commit e0d87aa11e
70 changed files with 336 additions and 354 deletions

View File

@@ -99,7 +99,7 @@ class Search implements SearchInterface
$filteredQuery = str_replace($match, '', $filteredQuery);
}
$filteredQuery = trim(str_replace(['"', "'"], '', $filteredQuery));
if (\strlen($filteredQuery) > 0) {
if ('' != $filteredQuery) {
$this->words = array_map('trim', explode(' ', $filteredQuery));
}
}
@@ -251,7 +251,7 @@ class Search implements SearchInterface
private function extractModifier(string $string): void
{
$parts = explode(':', $string);
if (2 === \count($parts) && '' !== trim((string)$parts[1]) && \strlen(trim((string)$parts[0])) > 0) {
if (2 === \count($parts) && '' !== trim((string)$parts[1]) && '' !== trim((string)$parts[0])) {
$type = trim((string)$parts[0]);
$value = trim((string)$parts[1]);
if (\in_array($type, $this->validModifiers, true)) {