示例#1
0
文件: File.php 项目: rhysr/Docblox
 /**
  * Is the docblock valid?
  *
  * @see DocBlox_Core_Validator::isValid()
  *
  * @return boolean
  */
 public function isValid()
 {
     $valid = true;
     if (null == $this->docblock) {
         return false;
     }
     if (!$this->docblock->hasTag('package')) {
         $valid = false;
         $this->log('No Page-level DocBlock was found for ' . $this->filename . ' on line: ' . $this->lineNumber, Zend_Log::ERR);
     }
     if (count($this->docblock->getTagsByName('package')) > 1) {
         $this->log('File cannot have more than one @package tag in ' . $this->filename, Zend_Log::CRIT);
     }
     if ($this->docblock->hasTag('subpackage') && !$this->docblock->hasTag('package')) {
         $this->log('File cannot have a @subpackage when a @package tag is not present in ' . $this->filename, Zend_Log::CRIT);
     }
     return $valid;
 }