private function getPathFromArray($path)
    {
        $paths = array();

        foreach ($path as $unverifiedPath) {
            try {
                // Check if `$unverifiedPath` is optional
                // If it exists, then it's added to the list
                // If it doesn't, it throws an exception which we catch
                if ($unverifiedPath[0] !== '?') {
                    $paths = array_merge($paths, $this->getValidPath($unverifiedPath));
                    continue;
                }
                $optionalPath = ltrim($unverifiedPath, '?');
                $paths = array_merge($paths, $this->getValidPath($optionalPath));

            } catch (FileNotFoundException $e) {
                // If `$unverifiedPath` is optional, then skip it
                if ($unverifiedPath[0] === '?') {
                    continue;
                }
                // Otherwise rethrow the exception
                throw $e;
            }
        }

        return $paths;
    }
private function getPathFromArray($path)
    {
        $paths = array();

        foreach ($path as $unverifiedPath) {
            try {
                // Check if `$unverifiedPath` is optional
                // If it exists, then it's added to the list
                // If it doesn't, it throws an exception which we catch
                if ($unverifiedPath[0] !== '?') {
                    $paths = array_merge($paths, $this->getValidPath($unverifiedPath));
                    continue;
                }
                $optionalPath = ltrim($unverifiedPath, '?');
                $paths = array_merge($paths, $this->getValidPath($optionalPath));

            } catch (FileNotFoundException $e) {
                // If `$unverifiedPath` is optional, then skip it
                if ($unverifiedPath[0] === '?') {
                    continue;
                }
                // Otherwise rethrow the exception
                throw $e;
            }
        }

        return $paths;
    }
private function getPathFromArray ( $ path ) { $ paths = array ( ) ; foreach ( $ path as $ unverifiedPath ) { try { // Check if `$unverifiedPath` is optional // If it exists, then it's added to the list // If it doesn't, it throws an exception which we catch if ( $ unverifiedPath [ 0 ] !== '?' ) { $ paths = array_merge ( $ paths , $ this -> getValidPath ( $ unverifiedPath ) ) ; continue ; } $ optionalPath = ltrim ( $ unverifiedPath , '?' ) ; $ paths = array_merge ( $ paths , $ this -> getValidPath ( $ optionalPath ) ) ; } catch ( FileNotFoundException $ e ) { // If `$unverifiedPath` is optional, then skip it if ( $ unverifiedPath [ 0 ] === '?' ) { continue ; } // Otherwise rethrow the exception throw $ e ; } } return $ paths ; }
Gets an array of paths

@param  array $path

@return array

@throws FileNotFoundException   If a file is not found at `$path`
Gets an array of paths