mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
81 lines
1.5 KiB
PHP
Executable File
81 lines
1.5 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Jingga
|
|
*
|
|
* PHP Version 8.2
|
|
*
|
|
* @package phpOMS\Algorithm\Sort;
|
|
* @copyright Dennis Eichhorn
|
|
* @license OMS License 2.0
|
|
* @version 1.0.0
|
|
* @link https://jingga.app
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace phpOMS\Algorithm\Sort;
|
|
|
|
/**
|
|
* SortableInterface class.
|
|
*
|
|
* @package phpOMS\Algorithm\Sort;
|
|
* @license OMS License 2.0
|
|
* @link https://jingga.app
|
|
* @since 1.0.0
|
|
*/
|
|
interface SortableInterface
|
|
{
|
|
/**
|
|
* Compare current object with other object
|
|
*
|
|
* @param SortableInterface $obj Object to compare with
|
|
* @param int $order Sort order
|
|
*
|
|
* @return bool
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function compare(self $obj, int $order = SortOrder::ASC) : bool;
|
|
|
|
/**
|
|
* Get element value
|
|
*
|
|
* @return mixed
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function getValue();
|
|
|
|
/**
|
|
* Is value the same
|
|
*
|
|
* @param SortableInterface $obj Object to compare with
|
|
*
|
|
* @return bool
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function equals(self $obj) : bool;
|
|
|
|
/**
|
|
* Get maximum element
|
|
*
|
|
* @param SortableInterface[] $list List to order
|
|
*
|
|
* @return mixed
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public static function max(array $list);
|
|
|
|
/**
|
|
* Get minimum element
|
|
*
|
|
* @param SortableInterface[] $list List to order
|
|
*
|
|
* @return mixed
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public static function min(array $list);
|
|
}
|