for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Consolidation\Filter\Operators;
use Consolidation\Filter\OperatorInterface;
use Dflydev\DotAccessData\Data;
/**
* Test for equality
*/
class ContainsOp implements OperatorInterface
{
protected $key;
protected $comparitor;
public function __construct($key, $comparitor)
$this->key = $key;
$this->comparitor = $comparitor;
}
* Test the provided value to see if it matches our criteria.
*
* @param mixed $value
$value
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return bool
public function test(Data $row)
$value = $row->get($this->key);
if (is_array($value)) {
return in_array($this->comparitor, $value);
return stripos($value, $this->comparitor) !== false;
* Return a string representation of this operator
public function __toString()
return "{$this->key}*={$this->comparitor}";
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.