for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Linna Framework.
*
* @author Sebastian Rapetti <[email protected]>
* @copyright (c) 2018, Sebastian Rapetti
* @license http://opensource.org/licenses/MIT MIT License
*/
declare(strict_types=1);
namespace Linna\Container;
* Magic Access Trait
* Provide to DIContainer the possibility to retrive values using properties.
trait PropertyAccessTrait
{
* Express Requirements by Abstract Methods.
* @param string $key
abstract public function has($key);
abstract public function get($key);
* @param mixed $value
abstract public function set($key, $value);
abstract public function delete($key): bool;
* Set
* http://php.net/manual/en/language.oop5.overloading.php.
* @ignore
public function __set(string $key, $value)
$this->set($key, $value);
}
* Get
* @return object|bool Element stored in container or false
public function __get(string $key)
return $this->get($key);
* Remove
public function __unset(string $key)
$this->delete($key);
* Check
* @return bool
public function __isset(string $key): bool
return $this->has($key);