src/Rules/Comparisons/ScalarInValues.php 1 location
|
@@ 47-53 (lines=7) @@
|
44 |
|
/** |
45 |
|
* @inheritdoc |
46 |
|
*/ |
47 |
|
public static function compare($value, ContextInterface $context): bool |
48 |
|
{ |
49 |
|
assert(static::isValidType($value) === true); |
50 |
|
$result = is_scalar($value) === true && in_array($value, static::readValue($context)); |
51 |
|
|
52 |
|
return $result; |
53 |
|
} |
54 |
|
|
55 |
|
/** |
56 |
|
* @param mixed $value |
src/Rules/Comparisons/ScalarNotEquals.php 1 location
|
@@ 40-46 (lines=7) @@
|
37 |
|
/** |
38 |
|
* @inheritdoc |
39 |
|
*/ |
40 |
|
public static function compare($value, ContextInterface $context): bool |
41 |
|
{ |
42 |
|
assert(static::isValidType($value) === true); |
43 |
|
$result = static::isValidType($value) === true && $value !== static::readValue($context); |
44 |
|
|
45 |
|
return $result; |
46 |
|
} |
47 |
|
|
48 |
|
/** |
49 |
|
* @param mixed $value |