public function setGlobPatternFromFile($file)
    {
        if (!is_file($file)) {
            $message = "Glob pattern file {$file} doesn't exist.";
            throw new NonExistentGlobPatternFile($message);
        }

        $globPatternContent = (string) file_get_contents($file);

        $globPatternLines = preg_split(
            '/\\r\\n|\\r|\\n/',
            $globPatternContent
        );

        $globPatterns = [];
        array_filter($globPatternLines, function ($line) use (&$globPatterns) {
            if (trim($line) !== '') {
                $globPatterns[] = trim($line);
            }
        });

        $globPattern = '{' . implode(',', $globPatterns) . '}*';

        try {
            $this->setGlobPattern($globPattern);

            return $this;
        } catch (InvalidGlobPattern $e) {
            $message = "Glob pattern file '{$file}' is invalid.";
            throw new InvalidGlobPatternFile($message);
        }
    }
public function setGlobPatternFromFile($file)
    {
        if (!is_file($file)) {
            $message = "Glob pattern file {$file} doesn't exist.";
            throw new NonExistentGlobPatternFile($message);
        }

        $globPatternContent = (string) file_get_contents($file);

        $globPatternLines = preg_split(
            '/\\r\\n|\\r|\\n/',
            $globPatternContent
        );

        $globPatterns = [];
        array_filter($globPatternLines, function ($line) use (&$globPatterns) {
            if (trim($line) !== '') {
                $globPatterns[] = trim($line);
            }
        });

        $globPattern = '{' . implode(',', $globPatterns) . '}*';

        try {
            $this->setGlobPattern($globPattern);

            return $this;
        } catch (InvalidGlobPattern $e) {
            $message = "Glob pattern file '{$file}' is invalid.";
            throw new InvalidGlobPatternFile($message);
        }
    }
public function setGlobPatternFromFile ( $ file ) { if ( ! is_file ( $ file ) ) { $ message = "Glob pattern file {$file} doesn't exist." ; throw new NonExistentGlobPatternFile ( $ message ) ; } $ globPatternContent = ( string ) file_get_contents ( $ file ) ; $ globPatternLines = preg_split ( '/\\r\\n|\\r|\\n/' , $ globPatternContent ) ; $ globPatterns = [ ] ; array_filter ( $ globPatternLines , function ( $ line ) use ( & $ globPatterns ) { if ( trim ( $ line ) !== '' ) { $ globPatterns [ ] = trim ( $ line ) ; } } ) ; $ globPattern = '{' . implode ( ',' , $ globPatterns ) . '}*' ; try { $ this -> setGlobPattern ( $ globPattern ) ; return $ this ; } catch ( InvalidGlobPattern $ e ) { $ message = "Glob pattern file '{$file}' is invalid." ; throw new InvalidGlobPatternFile ( $ message ) ; } }
Set the glob pattern file.

@param  string $file
@throws \Stolt\LeanPackage\Exceptions\NonExistentGlobPatternFile
@throws \Stolt\LeanPackage\Exceptions\InvalidGlobPatternFile
@return \Stolt\LeanPackage\Analyser
Set the glob pattern file .