public function readConfigDir(string $path): Configurator
    {
        if (!is_dir($path)) {
            throw new \InvalidArgumentException(
                sprintf("Config dir isn't a directory! %s given.", $path));
        }

        $entitiesDir = new \DirectoryIterator($path);
        foreach ($entitiesDir as $fileInfo) {
            if (!$fileInfo->isFile() || ('php' !== $fileInfo->getExtension())) {
                continue;
            }
            require_once($fileInfo->getPathname());
        }

        return $this;
    }
public function readConfigDir(string $path): Configurator
    {
        if (!is_dir($path)) {
            throw new \InvalidArgumentException(
                sprintf("Config dir isn't a directory! %s given.", $path));
        }

        $entitiesDir = new \DirectoryIterator($path);
        foreach ($entitiesDir as $fileInfo) {
            if (!$fileInfo->isFile() || ('php' !== $fileInfo->getExtension())) {
                continue;
            }
            require_once($fileInfo->getPathname());
        }

        return $this;
    }
public function readConfigDir ( string $ path ) : Configurator { if ( ! is_dir ( $ path ) ) { throw new \ InvalidArgumentException ( sprintf ( "Config dir isn't a directory! %s given." , $ path ) ) ; } $ entitiesDir = new \ DirectoryIterator ( $ path ) ; foreach ( $ entitiesDir as $ fileInfo ) { if ( ! $ fileInfo -> isFile ( ) || ( 'php' !== $ fileInfo -> getExtension ( ) ) ) { continue ; } require_once ( $ fileInfo -> getPathname ( ) ) ; } return $ this ; }
Include all php scripts in the dir
@param string $path
@return Configurator
Include all php scripts in the dir