Ignore case for is and !is
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
37ae5cb100
commit
28fc7b5061
|
@ -59,15 +59,20 @@ class FileName extends AbstractStringCheck {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getActualValue(): string {
|
protected function getActualValue(): string {
|
||||||
return mb_strtolower(basename($this->path));
|
return basename($this->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $operator
|
* @param string $operator
|
||||||
* @param string $value
|
* @param string $checkValue
|
||||||
|
* @param string $actualValue
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function executeCheck($operator, $value): bool {
|
protected function executeStringCheck($operator, $checkValue, $actualValue): bool {
|
||||||
return parent::executeCheck($operator, mb_strtolower($value));
|
if ($operator === 'is' || $operator === '!is') {
|
||||||
|
$checkValue = mb_strtolower($checkValue);
|
||||||
|
$actualValue = mb_strtolower($actualValue);
|
||||||
|
}
|
||||||
|
return parent::executeStringCheck($operator, $checkValue, $actualValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue