src/Route/RouteFactory.php
public static function getRouteInstance(TheTVDbAPIInterface $parent, string $routeClassName)
    {
        if (array_key_exists($routeClassName, static::$routeInstances) === false) {
            $classImplements = class_implements($routeClassName);
            if (in_array('CanIHaveSomeCoffee\TheTVDbAPI\Route\RouteInterface', $classImplements) === false) {
                throw new InvalidArgumentException('Class does not implement the RouteInterface!');
            }
            $args = [$parent];
            static::$routeInstances[$routeClassName] = new $routeClassName(...$args);
        }
        return static::$routeInstances[$routeClassName];
    }
public static function getRouteInstance(TheTVDbAPIInterface $parent, string $routeClassName)
    {
        if (array_key_exists($routeClassName, static::$routeInstances) === false) {
            $classImplements = class_implements($routeClassName);
            if (in_array('CanIHaveSomeCoffee\TheTVDbAPI\Route\RouteInterface', $classImplements) === false) {
                throw new InvalidArgumentException('Class does not implement the RouteInterface!');
            }
            $args = [$parent];
            static::$routeInstances[$routeClassName] = new $routeClassName(...$args);
        }
        return static::$routeInstances[$routeClassName];
    }
public static function getRouteInstance ( TheTVDbAPIInterface $ parent , string $ routeClassName ) { if ( array_key_exists ( $ routeClassName , static :: $ routeInstances ) === false ) { $ classImplements = class_implements ( $ routeClassName ) ; if ( in_array ( 'CanIHaveSomeCoffee\TheTVDbAPI\Route\RouteInterface' , $ classImplements ) === false ) { throw new InvalidArgumentException ( 'Class does not implement the RouteInterface!' ) ; } $ args = [ $ parent ] ; static :: $ routeInstances [ $ routeClassName ] = new $ routeClassName ( ... $ args ) ; } return static :: $ routeInstances [ $ routeClassName ] ; }
Retrieves an instance of the given routeClassName.

@param TheTVDbAPIInterface $parent         The parent object that is needed for constructing a new object.
@param string              $routeClassName The name of the instance to retrieve.

@return mixed The requested instance
@throws InvalidArgumentException If the given class name does not implement the RouteInterface
Retrieves an instance of the given routeClassName .