for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xabbuh\XApi\Model;
use Xabbuh\XApi\Common\Exception\UnsupportedOperationException;
/**
* xAPI statement extensions.
*
* @author Christian Flothmann <[email protected]>
*/
final class Extensions implements \ArrayAccess
{
private $extensions;
public function __construct(array $extensions)
$this->extensions = $extensions;
}
* {@inheritdoc}
public function offsetExists($offset)
return isset($this->extensions[$offset]);
public function offsetGet($offset)
if (!isset($this->extensions[$offset])) {
throw new \InvalidArgumentException(sprintf('No extension for key "%s" registered.', $offset));
return $this->extensions[$offset];
public function offsetSet($offset, $value)
throw new UnsupportedOperationException('xAPI statement extensions are immutable.');
public function offsetUnset($offset)