public function enabledWhen(callable $enabledCallback)
    {
        $this->updateOptions(function (ObjectIdentityOptions $options) use ($enabledCallback) {
            return $options->withEnabledCallback($enabledCallback);
        });

        return $this;
    }
public function enabledWhen(callable $enabledCallback)
    {
        $this->updateOptions(function (ObjectIdentityOptions $options) use ($enabledCallback) {
            return $options->withEnabledCallback($enabledCallback);
        });

        return $this;
    }
public function enabledWhen ( callable $ enabledCallback ) { $ this -> updateOptions ( function ( ObjectIdentityOptions $ options ) use ( $ enabledCallback ) { return $ options -> withEnabledCallback ( $ enabledCallback ) ; } ) ; return $ this ; }
Enables the options according to the supplied callback.

Example:
<code>
->enabledWhen(function (SomeObject $object) : bool {
return $object->satisfiesCondition();
})
</code>

@param callable $enabledCallback

@return static
Enables the options according to the supplied callback .