Skip to content
Snippets Groups Projects
Unverified Commit 28fc7b50 authored by Daniel Kesselberg's avatar Daniel Kesselberg
Browse files

Ignore case for is and !is

parent 37ae5cb1
No related branches found
No related tags found
No related merge requests found
...@@ -59,15 +59,20 @@ class FileName extends AbstractStringCheck { ...@@ -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);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment