src/Rules/Comparisons/ScalarInValues.php 1 location
|
@@ 58-64 (lines=7) @@
|
55 |
|
/** |
56 |
|
* @inheritdoc |
57 |
|
*/ |
58 |
|
public static function compare($value, ContextInterface $context): bool |
59 |
|
{ |
60 |
|
assert(static::isValidType($value) === true); |
61 |
|
$result = is_scalar($value) === true && in_array($value, static::readValue($context)); |
62 |
|
|
63 |
|
return $result; |
64 |
|
} |
65 |
|
|
66 |
|
/** |
67 |
|
* @param mixed $value |
src/Rules/Comparisons/ScalarNotEquals.php 1 location
|
@@ 49-55 (lines=7) @@
|
46 |
|
/** |
47 |
|
* @inheritdoc |
48 |
|
*/ |
49 |
|
public static function compare($value, ContextInterface $context): bool |
50 |
|
{ |
51 |
|
assert(static::isValidType($value) === true); |
52 |
|
$result = static::isValidType($value) === true && $value !== static::readValue($context); |
53 |
|
|
54 |
|
return $result; |
55 |
|
} |
56 |
|
|
57 |
|
/** |
58 |
|
* @param mixed $value |