for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Damax\Common\Application;
use BadMethodCallException;
use Doctrine\Common\Inflector\Inflector;
trait AsArrayTrait
{
public function offsetExists($offset): bool
$prop = Inflector::camelize($offset);
Doctrine\Common\Inflector\Inflector::camelize()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
$prop = /** @scrutinizer ignore-deprecated */ Inflector::camelize($offset);
return isset($this->$prop);
}
public function offsetGet($offset)
return $this->$prop;
/**
* @throws BadMethodCallException
*/
public function offsetSet($offset, $value)
$offset
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function offsetSet(/** @scrutinizer ignore-unused */ $offset, $value)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$value
public function offsetSet($offset, /** @scrutinizer ignore-unused */ $value)
throw new BadMethodCallException(sprintf('Method "%s" not implemented.', __METHOD__));
public function offsetUnset($offset)
public function offsetUnset(/** @scrutinizer ignore-unused */ $offset)