Changeset 124
- Timestamp:
- 09/19/06 20:15:00 (2 years ago)
- Files:
-
- trunk/classes/phing/tasks/ext/PhpLintTask.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/phing/tasks/ext/PhpLintTask.php
r114 r124 6 6 * 7 7 * @author Knut Urdalen <knut.urdalen@telio.no> 8 * @author Stefan Priebsch <stefan.priebsch@e-novative.de> 8 9 * @package phing.tasks.ext 9 10 */ … … 12 13 protected $file; // the source file (from xml attribute) 13 14 protected $filesets = array(); // all fileset objects assigned to this task 15 16 protected $haltOnFailure = false; 17 protected $hasErrors = false; 18 19 /** 20 * The haltonfailure property 21 * @param boolean $aValue 22 */ 23 public function setHaltOnFailure($aValue) { 24 $this->haltOnFailure = $aValue; 25 } 14 26 15 27 /** … … 44 56 $project = $this->getProject(); 45 57 foreach($this->filesets as $fs) { 46 $ds = $fs->getDirectoryScanner($project);47 $files = $ds->getIncludedFiles();48 $dir = $fs->getDir($this->project)->getPath();49 foreach($files as $file) {50 $this->lint($dir.DIRECTORY_SEPARATOR.$file);51 }58 $ds = $fs->getDirectoryScanner($project); 59 $files = $ds->getIncludedFiles(); 60 $dir = $fs->getDir($this->project)->getPath(); 61 foreach($files as $file) { 62 $this->lint($dir.DIRECTORY_SEPARATOR.$file); 63 } 52 64 } 53 65 } 66 67 if ($this->haltOnFailure && $this->hasErrors) throw new BuildException('Syntax error(s) in PHP files'); 54 68 } 55 69 … … 68 82 if(!preg_match('/^No syntax errors detected/', $message[0])) { 69 83 $this->log($message[1], PROJECT_MSG_ERR); 84 $this->hasErrors = true; 70 85 } else { 71 86 $this->log($file.': No syntax errors detected', PROJECT_MSG_INFO);
