Пример #1
0
	/**
	 * Process the version tag.
	 *
	 * @param int $errorPos The line number where the error occurs.
	 *
	 * @return void
	 */
	protected function processVersion($errorPos)
	{
		$version = $this->commentParser->getVersion();
		if ($version !== null) {
			$content = $version->getContent();
			$matches = array();
			if (empty($content) === true) {
				$error = 'Content missing for @version tag in file comment';
				$this->currentFile->addError($error, $errorPos);
			} else if (strstr($content, 'CVS:') === false && strstr($content, 'SVN:') === false) {
				$error = "Invalid version \"$content\" in file comment; consider \"CVS: <cvs_id>\" or \"SVN: <svn_id>\" instead";
				$this->currentFile->addWarning($error, $errorPos);
			}
		}

	}//end processVersion()
Пример #2
0
 /**
  * Process the version tag.
  *
  * @param int $errorPos The line number where the error occurs.
  *
  * @return void
  */
 protected function processVersion($errorPos)
 {
     $version = $this->commentParser->getVersion();
     if ($version !== null) {
         $content = $version->getContent();
         $matches = array();
         if (empty($content) === true) {
             $error = 'Content missing for @version tag in file comment';
             $this->currentFile->addError($error, $errorPos);
         } else {
             if (!is_numeric($content)) {
                 $error = "Invalid version \"{$content}\" in file comment; consider a numeric value instead (e.g. 0.3.5)";
                 $this->currentFile->addWarning($error, $errorPos);
             }
         }
     }
 }
Пример #3
0
 /**
  * Process the version tag
  *
  * @param  integer $errorPos The line number where the error occurs
  * @return void
  */
 protected function _processVersion($errorPos)
 {
     $version = $this->_commentParser->getVersion();
     if ($version !== null) {
         $content = $version->getContent();
         $matches = array();
         if (empty($content) === true) {
             $error = 'Content missing for @version tag in file comment';
             $this->_currentFile->addError($error, $errorPos, 'VersionTagNotEmptyFileComment');
         } else {
             if (strstr($content, '$Id: ') === false) {
                 $error = "Invalid version \"{$content}\" in file comment; consider \"\$Id: \$\"";
                 $this->_currentFile->addWarning($error, $errorPos, 'VersionValidFileComment');
             }
         }
     }
 }
Пример #4
0
 /**
  * Process the version tag.
  *
  * @param int $errorPos The line number where the error occurs.
  *
  * @return void
  */
 private function _processVersion($errorPos)
 {
     $version = $this->commentParser->getVersion();
     if ($version !== null) {
         $content = $version->getContent();
         $matches = array();
         if (empty($content) === true) {
             $error = 'Content missing for @version tag in file comment';
             $this->currentFile->addError($error, $errorPos);
         } else {
             if (strstr($content, 'CVS:') === false) {
                 $error = "Invalid version \"{$content}\" in file comment; Consider \"CVS: <cvs_id>\" instead.";
                 $this->currentFile->addWarning($error, $errorPos);
             }
         }
     }
 }
 /**
  * Process the version tag.
  *
  * @param int $errorPos The line number where the error occurs.
  *
  * @return void
  */
 protected function processVersion($errorPos)
 {
     $version = $this->commentParser->getVersion();
     if ($version !== null) {
         $content = $version->getContent();
         $matches = array();
         if (empty($content) === true) {
             $error = 'Content missing for @version tag in file comment';
             $this->currentFile->addError($error, $errorPos, 'EmptyVersion');
         } else {
             if (strstr($content, 'CVS:') === false && strstr($content, 'SVN:') === false && strstr($content, 'GIT:') === false) {
                 $error = 'Invalid version "%s" in file comment; consider "CVS: <cvs_id>" or "SVN: <svn_id>" or "GIT: <git_id>" instead';
                 $data = array($content);
                 $this->currentFile->addWarning($error, $errorPos, 'InvalidVersion', $data);
             }
         }
     }
 }
Пример #6
0
 /**
  * The version tag must have the exact keyword 'release_version'.
  *
  * @param int $errorPos The line number where the error occurs.
  *
  * @return void
  */
 protected function processVersion($errorPos)
 {
     $version = $this->commentParser->getVersion();
     if ($version !== null) {
         $content = $version->getContent();
         if (empty($content) === true) {
             $error = 'Content missing for @version tag in file comment';
             $this->currentFile->addError($error, $errorPos);
         } else {
             if ($content !== '%release_version%') {
                 if (preg_match('/^([0-9]+)\\.([0-9]+)\\.([0-9]+)/', $content) === 0) {
                     // Separate keyword so it does not get replaced when we commit.
                     $error = 'Expected keyword "%' . 'release_version%" for version number';
                     $this->currentFile->addError($error, $errorPos);
                 }
             }
         }
     }
 }