for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Copyright (c) Arnaud Ligny <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cecil\Collection;
/**
* Class Item.
class Item implements ItemInterface
{
* Item's identifier.
* @var string
protected $id;
* Item properties.
* @var array
protected $properties = [];
* Item constructor.
* @param string $id
public function __construct(string $id)
$this->setId($id);
}
* {@inheritdoc}
public function setId(string $id): BaseInterface
$this->id = $id;
return $this;
public function getId(): string
return $this->id;
* Implement ArrayAccess.
* @param mixed $offset
* @return bool
public function offsetExists($offset)
return array_key_exists($offset, $this->properties);
* @return null
public function offsetGet($offset)
return $this->properties[$offset];
* @param mixed $value
public function offsetSet($offset, $value)
$this->properties[$offset] = $value;
public function offsetUnset($offset)
unset($this->properties[$offset]);
public function toArray(): array
return $this->properties;