public function getErrorList()
    {
        $dirIterator = new \RecursiveDirectoryIterator($this->directory);
        $iterator = new \RecursiveIteratorIterator($dirIterator, \RecursiveIteratorIterator::SELF_FIRST);
        $files = array();

        $ignores = $this->ignore;
        $ignores[] = 'phpci.yml';
        $ignores[] = '.phpci.yml';

        foreach ($iterator as $file) {
            $filePath = $file->getRealPath();
            $skipFile = false;
            foreach ($ignores as $ignore) {
                if (stripos($filePath, $ignore) !== false) {
                    $skipFile = true;
                    break;
                }
            }

            // Ignore hidden files, else .git, .sass_cache, etc. all get looped over
            if (stripos($filePath, DIRECTORY_SEPARATOR . '.') !== false) {
                $skipFile = true;
            }

            if ($skipFile == false) {
                $files[] = $file->getRealPath();
            }
        }

        $files = array_filter(array_unique($files));
        $errorCount = 0;

        foreach ($files as $file) {
            foreach ($this->searches as $search) {
                $fileContent = file_get_contents($file);
                $allLines = explode(PHP_EOL, $fileContent);
                $beforeString = strstr($fileContent, $search, true);

                if (false !== $beforeString) {
                    $lines = explode(PHP_EOL, $beforeString);
                    $lineNumber = count($lines);
                    $content = trim($allLines[$lineNumber - 1]);

                    $errorCount++;

                    $fileName = str_replace($this->directory, '', $file);

                    $this->build->reportError(
                        $this->phpci,
                        'technical_debt',
                        $content,
                        PHPCI\Model\BuildError::SEVERITY_LOW,
                        $fileName,
                        $lineNumber
                    );
                }
            }
        }

        return $errorCount;
    }
public function getErrorList()
    {
        $dirIterator = new \RecursiveDirectoryIterator($this->directory);
        $iterator = new \RecursiveIteratorIterator($dirIterator, \RecursiveIteratorIterator::SELF_FIRST);
        $files = array();

        $ignores = $this->ignore;
        $ignores[] = 'phpci.yml';
        $ignores[] = '.phpci.yml';

        foreach ($iterator as $file) {
            $filePath = $file->getRealPath();
            $skipFile = false;
            foreach ($ignores as $ignore) {
                if (stripos($filePath, $ignore) !== false) {
                    $skipFile = true;
                    break;
                }
            }

            // Ignore hidden files, else .git, .sass_cache, etc. all get looped over
            if (stripos($filePath, DIRECTORY_SEPARATOR . '.') !== false) {
                $skipFile = true;
            }

            if ($skipFile == false) {
                $files[] = $file->getRealPath();
            }
        }

        $files = array_filter(array_unique($files));
        $errorCount = 0;

        foreach ($files as $file) {
            foreach ($this->searches as $search) {
                $fileContent = file_get_contents($file);
                $allLines = explode(PHP_EOL, $fileContent);
                $beforeString = strstr($fileContent, $search, true);

                if (false !== $beforeString) {
                    $lines = explode(PHP_EOL, $beforeString);
                    $lineNumber = count($lines);
                    $content = trim($allLines[$lineNumber - 1]);

                    $errorCount++;

                    $fileName = str_replace($this->directory, '', $file);

                    $this->build->reportError(
                        $this->phpci,
                        'technical_debt',
                        $content,
                        PHPCI\Model\BuildError::SEVERITY_LOW,
                        $fileName,
                        $lineNumber
                    );
                }
            }
        }

        return $errorCount;
    }
public function getErrorList ( ) { $ dirIterator = new \ RecursiveDirectoryIterator ( $ this -> directory ) ; $ iterator = new \ RecursiveIteratorIterator ( $ dirIterator , \ RecursiveIteratorIterator :: SELF_FIRST ) ; $ files = array ( ) ; $ ignores = $ this -> ignore ; $ ignores [ ] = 'phpci.yml' ; $ ignores [ ] = '.phpci.yml' ; foreach ( $ iterator as $ file ) { $ filePath = $ file -> getRealPath ( ) ; $ skipFile = false ; foreach ( $ ignores as $ ignore ) { if ( stripos ( $ filePath , $ ignore ) !== false ) { $ skipFile = true ; break ; } } // Ignore hidden files, else .git, .sass_cache, etc. all get looped over if ( stripos ( $ filePath , DIRECTORY_SEPARATOR . '.' ) !== false ) { $ skipFile = true ; } if ( $ skipFile == false ) { $ files [ ] = $ file -> getRealPath ( ) ; } } $ files = array_filter ( array_unique ( $ files ) ) ; $ errorCount = 0 ; foreach ( $ files as $ file ) { foreach ( $ this -> searches as $ search ) { $ fileContent = file_get_contents ( $ file ) ; $ allLines = explode ( PHP_EOL , $ fileContent ) ; $ beforeString = strstr ( $ fileContent , $ search , true ) ; if ( false !== $ beforeString ) { $ lines = explode ( PHP_EOL , $ beforeString ) ; $ lineNumber = count ( $ lines ) ; $ content = trim ( $ allLines [ $ lineNumber - 1 ] ) ; $ errorCount ++ ; $ fileName = str_replace ( $ this -> directory , '' , $ file ) ; $ this -> build -> reportError ( $ this -> phpci , 'technical_debt' , $ content , PHPCI \ Model \ BuildError :: SEVERITY_LOW , $ fileName , $ lineNumber ) ; } } } return $ errorCount ; }
Gets the number and list of errors returned from the search

@return array
Gets the number and list of errors returned from the search