src/CheckCommand.php
protected function checkPath( $path ) {
		$iterator = new RecursiveIteratorIterator(
			new RecursiveCallbackFilterIterator(
				new RecursiveDirectoryIterator( $path ),
				[ $this, 'filterDirs' ]
			)
		);
		$bad = [];
		/** @var SplFileInfo $file */
		foreach ( $iterator as $file ) {
			// Skip directories
			if ( !$file->isFile() ) {
				continue;
			}

			// Skip whitelisted files
			if ( in_array( $file->getPathname(), $this->ignoredFiles ) ) {
				$this->progress( 'S' );
				continue;
			}

			if ( !$file->isExecutable() ) {
				$this->progress( '.' );
				continue;
			}

			if ( !$this->checkFile( $file ) ) {
				$this->progress( 'E' );
				$bad[] = $file;
			} else {
				$this->progress( '.' );
			}
		}

		return $bad;
	}
protected function checkPath( $path ) {
		$iterator = new RecursiveIteratorIterator(
			new RecursiveCallbackFilterIterator(
				new RecursiveDirectoryIterator( $path ),
				[ $this, 'filterDirs' ]
			)
		);
		$bad = [];
		/** @var SplFileInfo $file */
		foreach ( $iterator as $file ) {
			// Skip directories
			if ( !$file->isFile() ) {
				continue;
			}

			// Skip whitelisted files
			if ( in_array( $file->getPathname(), $this->ignoredFiles ) ) {
				$this->progress( 'S' );
				continue;
			}

			if ( !$file->isExecutable() ) {
				$this->progress( '.' );
				continue;
			}

			if ( !$this->checkFile( $file ) ) {
				$this->progress( 'E' );
				$bad[] = $file;
			} else {
				$this->progress( '.' );
			}
		}

		return $bad;
	}
protected function checkPath ( $ path ) { $ iterator = new RecursiveIteratorIterator ( new RecursiveCallbackFilterIterator ( new RecursiveDirectoryIterator ( $ path ) , [ $ this , 'filterDirs' ] ) ) ; $ bad = [ ] ; /** @var SplFileInfo $file */ foreach ( $ iterator as $ file ) { // Skip directories if ( ! $ file -> isFile ( ) ) { continue ; } // Skip whitelisted files if ( in_array ( $ file -> getPathname ( ) , $ this -> ignoredFiles ) ) { $ this -> progress ( 'S' ) ; continue ; } if ( ! $ file -> isExecutable ( ) ) { $ this -> progress ( '.' ) ; continue ; } if ( ! $ this -> checkFile ( $ file ) ) { $ this -> progress ( 'E' ) ; $ bad [ ] = $ file ; } else { $ this -> progress ( '.' ) ; } } return $ bad ; }
Recursively search a directory and check it

@param string $path Directory
@return SplFileInfo[]
Recursively search a directory and check it