getPreviousRevision() public method

Returns the revision before the specified revision.
public getPreviousRevision ( string $rev ) : string
$rev string A revision.
return string The previous revision or null if the first revision.
Ejemplo n.º 1
0
Archivo: Git.php Proyecto: horde/horde
 /**
  * Returns the revision before the specified revision.
  *
  * @param string $rev  A revision.
  *
  * @return string  The previous revision or null if the first revision.
  */
 public function getPreviousRevision($rev)
 {
     $this->_ensureInitialized();
     if (empty($this->_branch)) {
         return parent::getPreviousRevision($rev);
     }
     $key = array_search($rev, $this->_revlist[$this->_branch]);
     return $key !== false && isset($this->_revlist[$this->_branch][$key + 1]) ? $this->_revlist[$this->_branch][$key + 1] : null;
 }