for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the xAPI package.
*
* (c) Christian Flothmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
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)