for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ShopifyClient\Action;
use ShopifyClient\Exception\ClientException;
class ActionCollection {
/**
* @var array
*/
private $items = [];
* @param $name
* @param ActionInterface $action
public function add($name, ActionInterface $action) {
$this->items[$name] = $action;
}
* @return ActionInterface
* @throws ClientException
public function get($name): ActionInterface {
if (!$this->has($name)) {
throw new ClientException(sprintf('%s action does not exist.', $name));
return $this->items[$name];
* @return bool
public function has($name): bool {
if (!isset($this->items[$name])) {
return false;
return true;