for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\Container\Traits;
/**
* Class ContainerPersistenceTrait
* @package Nip\Container
*/
trait ContainerArrayAccessTrait
{
* Determine if a given offset exists.
*
* @param string $key
* @return bool
public function offsetExists($key): bool
return $this->has($key);
has()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return $this->/** @scrutinizer ignore-call */ has($key);
}
* Get the value at a given offset.
* @return mixed
public function offsetGet($key): mixed
return $this->get($key);
get()
return $this->/** @scrutinizer ignore-call */ get($key);
* Set the value at a given offset.
* @param mixed $value
* @return void
public function offsetSet($key, $value): void
$this->add($key, $value);
add()
$this->/** @scrutinizer ignore-call */
add($key, $value);
* Unset the value at a given offset.
public function offsetUnset($key): void
$this->remove($key);
remove()
remove($key);
* Dynamically access container services.
public function __get($key)
return $this[$key];
* Dynamically set container services.
public function __set($key, $value)
$this[$key] = $value;