src/Modules/ModuleManager.php
protected function instantiateClass($class)
    {
        try {
            $instance = app($class);

        } catch (BindingResolutionException $e) {

            throw new InvalidArgumentException(
                "Failed to instantiate Module or ModuleGenerator instance for '{$class}'",
                $e->getCode(),
                $e
            );

        } catch (ReflectionException $e) {

            throw new InvalidArgumentException(
                "Failed to instantiate Module or ModuleGenerator instance for '{$class}'",
                $e->getCode(),
                $e
            );
        }

        if (    ! ($instance instanceof ModuleInterface)
            &&  ! ($instance instanceof ModuleGeneratorInterface)
        ) {
            throw new InvalidArgumentException(
                "Expected ModuleInterface or ModuleGeneratorInterface, got '{$class}'"
            );
        }

        return $instance;
    }
protected function instantiateClass($class)
    {
        try {
            $instance = app($class);

        } catch (BindingResolutionException $e) {

            throw new InvalidArgumentException(
                "Failed to instantiate Module or ModuleGenerator instance for '{$class}'",
                $e->getCode(),
                $e
            );

        } catch (ReflectionException $e) {

            throw new InvalidArgumentException(
                "Failed to instantiate Module or ModuleGenerator instance for '{$class}'",
                $e->getCode(),
                $e
            );
        }

        if (    ! ($instance instanceof ModuleInterface)
            &&  ! ($instance instanceof ModuleGeneratorInterface)
        ) {
            throw new InvalidArgumentException(
                "Expected ModuleInterface or ModuleGeneratorInterface, got '{$class}'"
            );
        }

        return $instance;
    }
protected function instantiateClass ( $ class ) { try { $ instance = app ( $ class ) ; } catch ( BindingResolutionException $ e ) { throw new InvalidArgumentException ( "Failed to instantiate Module or ModuleGenerator instance for '{$class}'" , $ e -> getCode ( ) , $ e ) ; } catch ( ReflectionException $ e ) { throw new InvalidArgumentException ( "Failed to instantiate Module or ModuleGenerator instance for '{$class}'" , $ e -> getCode ( ) , $ e ) ; } if ( ! ( $ instance instanceof ModuleInterface ) && ! ( $ instance instanceof ModuleGeneratorInterface ) ) { throw new InvalidArgumentException ( "Expected ModuleInterface or ModuleGeneratorInterface, got '{$class}'" ) ; } return $ instance ; }
Instantiates a Module or ModuleGenerator instance.

@param string $class
@return ModuleInterface|ModuleGeneratorInterface
Instantiates a Module or ModuleGenerator instance .