function attachExistenceAssertion(PatchHandle $handle, $target) { $handle->addExpirationHandler(function () use($target) { if (!Utils\callbackTargetDefined($target)) { # Not using exceptions because this might happen during PHP shutdown $message = "%s was never defined during the lifetime of its redefinition"; trigger_error(sprintf($message, Utils\callbackToString($target)), E_USER_WARNING); } }); }
function __construct($callback) { parent::__construct(sprintf($this->message, Utils\callbackToString($callback))); }