for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WebTheory\Saveyour\Concerns;
trait ImmutableObjectTrait
{
/**
*
*/
protected function throwModificationException()
throw new \LogicException('properties in ' . static::class . ' cannot be modified.');
}
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)
$this->throwModificationException();
public function offsetUnset($offset)
public function offsetUnset(/** @scrutinizer ignore-unused */ $offset)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.