public function register($name, $class, $requirement = '', $priority = false)
    {
        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('%s is not a valid class name.', $class));
        }

        $definition = [
            'class'       => $class,
            'requirement' => $requirement
        ];

        if ($priority) {
            $this->classes = array_merge_recursive([$name => $definition], $this->classes);
        } else {
            $this->classes[$name] = $definition;
        }
    }
public function register($name, $class, $requirement = '', $priority = false)
    {
        if (!class_exists($class)) {
            throw new \InvalidArgumentException(sprintf('%s is not a valid class name.', $class));
        }

        $definition = [
            'class'       => $class,
            'requirement' => $requirement
        ];

        if ($priority) {
            $this->classes = array_merge_recursive([$name => $definition], $this->classes);
        } else {
            $this->classes[$name] = $definition;
        }
    }
public function register ( $ name , $ class , $ requirement = '' , $ priority = false ) { if ( ! class_exists ( $ class ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s is not a valid class name.' , $ class ) ) ; } $ definition = [ 'class' => $ class , 'requirement' => $ requirement ] ; if ( $ priority ) { $ this -> classes = array_merge_recursive ( [ $ name => $ definition ] , $ this -> classes ) ; } else { $ this -> classes [ $ name ] = $ definition ; } }
Register a new client that will be able to be use by the ApiFactory

@param  string          $name
@param  string          $class
@param  string|callable $requirement
@param  bool            $priority
@throws \InvalidArgumentException
Register a new client that will be able to be use by the ApiFactory