Beispiel #1
0
 /**
  * Compares two projects by age
  *
  * @param GitPHP_Project $a first project
  * @param GitPHP_Project $b second project
  * @return integer comparison result
  */
 public static function CompareAge($a, $b)
 {
     $catCmp = strcmp($a->GetCategory(), $b->GetCategory());
     if ($catCmp !== 0) {
         return $catCmp;
     }
     if ($a->GetAge() === $b->GetAge()) {
         return 0;
     }
     return $a->GetAge() < $b->GetAge() ? -1 : 1;
 }