You are here

public function Comparator::test in Database Sanitize 7

Tests against the target.

Parameters

mixed $test A test value:

Return value

bool

File

vendor/symfony/finder/Comparator/Comparator.php, line 81

Class

Comparator
Comparator.

Namespace

Symfony\Component\Finder\Comparator

Code

public function test($test) {
  switch ($this->operator) {
    case '>':
      return $test > $this->target;
    case '>=':
      return $test >= $this->target;
    case '<':
      return $test < $this->target;
    case '<=':
      return $test <= $this->target;
    case '!=':
      return $test != $this->target;
  }
  return $test == $this->target;
}