mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-06 14:04:55 +02:00
18 lines
287 B
PHP
18 lines
287 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Behavioral\Strategy;
|
|
|
|
class IdComparator implements ComparatorInterface
|
|
{
|
|
/**
|
|
* @param mixed $a
|
|
* @param mixed $b
|
|
*
|
|
* @return int
|
|
*/
|
|
public function compare($a, $b): int
|
|
{
|
|
return $a['id'] <=> $b['id'];
|
|
}
|
|
}
|