addFile() public method

Adds a single source code file to the list of files to be analysed.
public addFile ( string $file ) : void
$file string The source file name.
return void
Exemplo n.º 1
0
 /**
  * Configures the input source.
  *
  * @param PDepend\Engine $pdepend The context php depend instance.
  * @param PHP_PMD    $phpmd   The calling/parent php mess detector.
  *
  * @return void
  */
 private function initInput(PDepend\Engine $pdepend, PHP_PMD $phpmd)
 {
     foreach (explode(',', $phpmd->getInput()) as $path) {
         if (is_dir(trim($path))) {
             $pdepend->addDirectory(trim($path));
         } else {
             $pdepend->addFile(trim($path));
         }
     }
 }