mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
PHP8
This commit is contained in:
@@ -7,8 +7,6 @@ interface Comparator
|
||||
/**
|
||||
* @param mixed $a
|
||||
* @param mixed $b
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function compare($a, $b): int;
|
||||
}
|
||||
|
@@ -4,11 +4,8 @@ namespace DesignPatterns\Behavioral\Strategy;
|
||||
|
||||
class Context
|
||||
{
|
||||
private Comparator $comparator;
|
||||
|
||||
public function __construct(Comparator $comparator)
|
||||
public function __construct(private Comparator $comparator)
|
||||
{
|
||||
$this->comparator = $comparator;
|
||||
}
|
||||
|
||||
public function executeStrategy(array $elements): array
|
||||
|
Reference in New Issue
Block a user