21 lines
660 B
PHP
21 lines
660 B
PHP
|
<?php
|
||
|
// IComparable.php
|
||
|
// Created: 2021-04-30
|
||
|
// Updated: 2021-05-12
|
||
|
|
||
|
namespace Index;
|
||
|
|
||
|
/**
|
||
|
* Provides an interface for comparison between objects. Allows for order/sorting instances.
|
||
|
*/
|
||
|
interface IComparable {
|
||
|
/**
|
||
|
* Compares the current instance with another and returns an integer that indicates whether
|
||
|
* the current object comes before or after or the same position and the other object.
|
||
|
*
|
||
|
* @return int A value that indicates the relative order of the objects being compared.
|
||
|
* Less than zero for before, zero for same position, greater than zero for after.
|
||
|
*/
|
||
|
function compare(mixed $other): int;
|
||
|
}
|