for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SubjectivePHP\Spl\Traits;
use RuntimeException;
trait ImmutableArrayAccessTrait
{
/**
* Sets the value at the specified index $offset to $value
*
* @param string|integer $offset The index being set.
* @param mixed $value The new value for the index.
* @return void
* @throws RuntimeException Always Thrown
*/
public function offsetSet($offset, $value)
$offset
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$value
throw new RuntimeException('This ArrayAccess object is readonly');
}
* Unsets the value at the specified index
* @param mixed $offset The index being unset.
public function offsetUnset($offset)
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.