for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Support\Traits;
trait FluentArrayAccess
{
/**
* Get an attribute from the container.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
abstract public function get($key, $default = null);
* Determine if the given offset exists.
* @param string $offset
* @return bool
public function offsetExists($offset)
return isset($this->attributes[$offset]);
}
* Get the value for a given offset.
public function offsetGet($offset)
return $this->get($offset);
* Set the value at the given offset.
* @param mixed $value
* @return void
public function offsetSet($offset, $value)
$this->attributes[$offset] = $value;
* Unset the value at the given offset.
public function offsetUnset($offset)
unset($this->attributes[$offset]);