private function readPatterns(string $filename): array
  {
    $path  = $this->basedir.'/'.$filename;
    $lines = explode(PHP_EOL, file_get_contents($path));

    $patterns = [];
    foreach ($lines as $line)
    {
      $line = trim($line);
      if ($line<>'')
      {
        $patterns[] = $line;
      }
    }

    return $patterns;
  }
private function readPatterns(string $filename): array
  {
    $path  = $this->basedir.'/'.$filename;
    $lines = explode(PHP_EOL, file_get_contents($path));

    $patterns = [];
    foreach ($lines as $line)
    {
      $line = trim($line);
      if ($line<>'')
      {
        $patterns[] = $line;
      }
    }

    return $patterns;
  }
private function readPatterns ( string $ filename ) : array { $ path = $ this -> basedir . '/' . $ filename ; $ lines = explode ( PHP_EOL , file_get_contents ( $ path ) ) ; $ patterns = [ ] ; foreach ( $ lines as $ line ) { $ line = trim ( $ line ) ; if ( $ line <> '' ) { $ patterns [ ] = $ line ; } } return $ patterns ; }
Reads a list of patterns from a file.

@param string $filename The name of the file with a list of patterns.

@return string[]
Reads a list of patterns from a file .