mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 22:09:23 +02:00
19 lines
303 B
PHP
19 lines
303 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Behavioral\Strategy;
|
|
|
|
class IdComparator implements Comparator
|
|
{
|
|
/**
|
|
* @param mixed $a
|
|
* @param mixed $b
|
|
*
|
|
* @return int
|
|
*/
|
|
public function compare($a, $b): int
|
|
{
|
|
return $a['id'] <=> $b['id'];
|
|
}
|
|
}
|