for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Larium\Specification;
/**
* HardCodedSpecification class.
*
* Implemented by coding the selection criteria into the isSatisfiedBy method
* as a block of code.
* @link https://martinfowler.com/apsupp/spec.pdf Specifications page 8.
* @author Andreas Kollaros <[email protected]>
*/
final class HardCodedSpecification extends LeafSpecification
{
private $callable;
public function __construct(callable $callable)
$this->callable = $callable;
}
public function isSatisfiedBy(Candidate $candidate): bool
$callable = $this->callable;
return $callable($candidate);