-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComparableInterface.php
More file actions
30 lines (28 loc) · 1.19 KB
/
ComparableInterface.php
File metadata and controls
30 lines (28 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* This interface imposes a total ordering on the objects of each class that implements
* it. This ordering is referred to as the class's natural ordering, and the class's
* compareTo method is referred to as its natural comparison method
* @author Azeem Michael
*/
interface ComparableInterface
{
/**
* Compares this object with the specified object for order. Returns a negative
* integer, zero, or a positive integer as this object is less than, equal to,
* or greater than the specified object
*
* @uses Compares this object with the specified object for order
* @param ComparableInterface $o - the object to be compared
* @return int a negative integer, zero, or a positive integer as this object is
* less than, equal to, or greater than the specified object
*/
public function compareTo(ComparableInterface $o);
/**
* Case Insensitive Comparator
* @param ComparableInterface $o - the object to be compared
* @return int a negative integer, zero, or a positive integer as this object is
* less than, equal to, or greater than the specified object
*/
public function compareToIgnoreCase(ComparableInterface $o);
}