for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of Cecil.
*
* 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
{
/** @var string Item's identifier. */
protected $id;
/** @var array Item's properties. */
protected $properties = [];
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;
* Implements \ArrayAccess.
* @param mixed $offset
* @return bool
#[\ReturnTypeWillChange]
public function offsetExists($offset): bool
return \array_key_exists($offset, $this->properties);
* @return mixed|null
public function offsetGet($offset)
return $this->properties[$offset];
* @param mixed $value
public function offsetSet($offset, $value): void
$this->properties[$offset] = $value;
public function offsetUnset($offset): void
unset($this->properties[$offset]);
public function toArray(): array
return $this->properties;