<?php

namespace App\Modules\Shared\Domain\Criteria;

class CallbackSpecification implements Specification
{
    private mixed $callback;
    public function __construct(
        callable $callback
    ) {
        $this->callback = $callback;
    }

    public function isSatisfiedBy(mixed $element): bool
    {
        return ($this->callback)($element);
    }
}
