for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Foo\Grid\Collection;
use Foo\Grid\Action\IAction;
use InvalidArgumentException;
use LogicException;
class Actions extends BaseCollection
{
/** @var IAction[] */
protected $components = [];
/**
* @return IAction
* @throws LogicException
*/
public function current()
/** @var IAction $object */
$object = parent::current();
$this->verifyReturn($object, IAction::class);
return $object;
}
* @param int|null $offset
* @param IAction $value
*
* @throws InvalidArgumentException
public function offsetSet($offset, $value)
$this->verifyArgument($value, IAction::class);
parent::offsetSet($offset, $value);
* @param int $offset
* @return IAction|null
public function offsetGet($offset)
$object = parent::offsetGet($offset);
* @return Actions
public function duplicate(): Actions
$actionsCopy = new Actions($this->tag, $this->attributes);
foreach ($this->components as $action) {
$actionCopy = $action->duplicate();
$actionsCopy[] = $actionCopy;
return $actionsCopy;