private function getLibraryInstance($libraryName, $libraryClass) {
        $instance = null;
            $libraryClassName = $this->config->get($libraryName)[$libraryClass];
            if (class_exists($libraryClassName)) {
                if (count(func_get_args()) > 2) {
                    $arguments = array_slice(func_get_args(), 2, count(func_get_args()) - 2);
                    $ref = new \ReflectionClass($libraryClassName);
                    $instance = $ref->newInstanceArgs($arguments);
                    //$instance = new $libraryClassName(array_slice(func_get_args(), 2, count(func_get_args())-2));
                } else {
                    $instance = new $libraryClassName();
                }
                return $instance;
            } else {
                throw new \InvalidArgumentException('Invalid library class(' . $libraryClassName . ')');
            }
        throw new \InvalidArgumentException('We can not instantiate the library class (' . $libraryClassName . ')');
    }
private function getLibraryInstance($libraryName, $libraryClass) {
        $instance = null;
            $libraryClassName = $this->config->get($libraryName)[$libraryClass];
            if (class_exists($libraryClassName)) {
                if (count(func_get_args()) > 2) {
                    $arguments = array_slice(func_get_args(), 2, count(func_get_args()) - 2);
                    $ref = new \ReflectionClass($libraryClassName);
                    $instance = $ref->newInstanceArgs($arguments);
                    //$instance = new $libraryClassName(array_slice(func_get_args(), 2, count(func_get_args())-2));
                } else {
                    $instance = new $libraryClassName();
                }
                return $instance;
            } else {
                throw new \InvalidArgumentException('Invalid library class(' . $libraryClassName . ')');
            }
        throw new \InvalidArgumentException('We can not instantiate the library class (' . $libraryClassName . ')');
    }
private function getLibraryInstance ( $ libraryName , $ libraryClass ) { $ instance = null ; $ libraryClassName = $ this -> config -> get ( $ libraryName ) [ $ libraryClass ] ; if ( class_exists ( $ libraryClassName ) ) { if ( count ( func_get_args ( ) ) > 2 ) { $ arguments = array_slice ( func_get_args ( ) , 2 , count ( func_get_args ( ) ) - 2 ) ; $ ref = new \ ReflectionClass ( $ libraryClassName ) ; $ instance = $ ref -> newInstanceArgs ( $ arguments ) ; //$instance = new $libraryClassName(array_slice(func_get_args(), 2, count(func_get_args())-2)); } else { $ instance = new $ libraryClassName ( ) ; } return $ instance ; } else { throw new \ InvalidArgumentException ( 'Invalid library class(' . $ libraryClassName . ')' ) ; } throw new \ InvalidArgumentException ( 'We can not instantiate the library class (' . $ libraryClassName . ')' ) ; }
Return the instance of the library class.

@param string $libraryName
@param string $libraryClass

@throws \InvalidArgumentException

@return stdClass | null $libraryClass
Return the instance of the library class .