Changeset 29

Show
Ignore:
Timestamp:
02/23/06 18:29:43 (2 years ago)
Author:
knut
Message:

Added validation and more verbose output to see what's going on

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/classes/phing/tasks/ext/PhpLintTask.php

    r28 r29  
    3535   */ 
    3636  public function main() { 
     37    if(!isset($this->file) and count($this->filesets) == 0) { 
     38      throw new BuildException("Missing either a nested fileset or attribute 'file' set"); 
     39    } 
     40 
    3741    if($this->file instanceof PhingFile) { 
    3842      $this->lint($this->file->getPath()); 
     
    4852      } 
    4953    } 
    50     $this->log('No syntax errors detected'); 
    5154  } 
    5255 
     
    6467        exec($command.$file, $message); 
    6568        if(!preg_match('/^No syntax errors detected/', $message[0])) { 
    66           throw new BuildException($message[1]); 
     69          $this->log($message[1], PROJECT_MSG_ERR); 
     70        } else { 
     71          $this->log($file.': No syntax errors detected', PROJECT_MSG_INFO); 
    6772        } 
    6873      } else {