public function process($mode = self::MODE_LIST)
 {
     if (empty($mode)) {
         return;
     }
     foreach ($this->files as $file) {
         if ($this->isBlacklisted($file)) {
             continue;
         }
         if ($mode == self::MODE_LIST) {
             echo "{$file}\n";
             continue;
         }
         $file = new PhpFile($file);
         $parsed = $file->load();
         if (!empty($parsed)) {
             $this->printMessages($parsed);
         }
     }
 }
Example #2
0
 /**
  * Write the file
  *
  * @param \Trismegiste\Mondrian\Parser\PhpFile $aFile
  */
 public function write(PhpFile $aFile)
 {
     file_put_contents($aFile->getRealPath(), "<?php\n\n" . $this->prettyPrinter->prettyPrint(iterator_to_array($aFile->getIterator())));
 }
 private function getWpConfigFile()
 {
     return $config = PhpFile::create('wp-config.php');
 }