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\Session;
* Array Access Trait
* Provide to Session the possibility to retrive values using array notation.
* @property mixed $data Session Data
trait ArrayAccessTrait
{
* Check.
* @param string $offset
* @return bool
public function offsetExists($offset)
return isset($this->data[$offset]);
}
* Get.
* @return mixed
public function offsetGet($offset)
if (isset($this->data[$offset])) {
return $this->data[$offset];
return false;
* Store.
* @param mixed $value
* @return void
public function offsetSet($offset, $value)
$this->data[$offset] = $value;
* Delete.
public function offsetUnset($offset)
unset($this->data[$offset]);