for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Bluz Framework Component
*
* @copyright Bluz PHP Team
* @link https://github.com/bluzphp/framework
*/
declare(strict_types=1);
namespace Bluz\Common\Container;
use InvalidArgumentException;
* Container implements ArrayAccess
* @package Bluz\Common
* @author Anton Shevchuk
* @see ArrayAccess
* @method void doSetContainer(string $key, $value)
* @method mixed doGetContainer(string $key)
* @method bool doContainsContainer(string $key)
* @method void doDeleteContainer(string $key)
trait ArrayAccess
{
* Offset to set
* @param mixed $offset
* @param mixed $value
* @throws InvalidArgumentException
public function offsetSet($offset, $value): void
if (null === $offset) {
throw new InvalidArgumentException('Class `Common\Container\ArrayAccess` support only associative arrays');
}
$this->doSetContainer($offset, $value);
* Offset to retrieve
* @return mixed
public function offsetGet($offset)
return $this->doGetContainer($offset);
* Whether a offset exists
* @return bool
public function offsetExists($offset): bool
return $this->doContainsContainer($offset);
* Offset to unset
public function offsetUnset($offset): void
$this->doDeleteContainer($offset);