Files
DesignPatternsPHP/Behavioral/Strategy/IdComparator.php
2019-08-19 18:11:49 +02:00

18 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'];
}
}