at the end of the day, it was inevitable

This commit is contained in:
Mo Elzubeir
2022-12-09 08:36:26 -06:00
commit 1218570914
1768 changed files with 887087 additions and 0 deletions
@@ -0,0 +1,44 @@
<?php
namespace Common\Util\Matcher\Expander;
use Coduo\PHPMatcher\Matcher\Pattern\PatternExpander;
/**
* Class FieldExpander
* Check that inner expander not match.
*
* Example: .not(contains('some'))
*
* @package Common\Util\Matcher\Expander
*/
class NotExpander extends AbstractExpander
{
/**
* @var mixed
*/
private $expander;
/**
* @param PatternExpander $expander A PatternExpander instance.
*/
public function __construct(PatternExpander $expander)
{
$this->expander = $expander;
}
/**
* @param mixed $value Value to match.
*
* @return boolean
*/
public function match($value)
{
if ($this->expander->match($value)) {
$this->error = 'Expander match this value.';
return false;
}
return true;
}
}