Ignore case for is and !is

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2018-10-05 17:54:48 +02:00
parent 37ae5cb100
commit 28fc7b5061
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 9 additions and 4 deletions

View File

@ -59,15 +59,20 @@ class FileName extends AbstractStringCheck {
* @return string
*/
protected function getActualValue(): string {
return mb_strtolower(basename($this->path));
return basename($this->path);
}
/**
* @param string $operator
* @param string $value
* @param string $checkValue
* @param string $actualValue
* @return bool
*/
public function executeCheck($operator, $value): bool {
return parent::executeCheck($operator, mb_strtolower($value));
protected function executeStringCheck($operator, $checkValue, $actualValue): bool {
if ($operator === 'is' || $operator === '!is') {
$checkValue = mb_strtolower($checkValue);
$actualValue = mb_strtolower($actualValue);
}
return parent::executeStringCheck($operator, $checkValue, $actualValue);
}
}