Select Git revision
StoppableBinder.php
-
Bartek Jaskulski authored
Previously stoppable binder was working for all binders, although it only supported to signal stop execution with class-based binders. This changes the behavior, as having all binders wrapped in stoppable binder resulted in execution of all collection binders, without regard for the stop signal. This is convoluted and gets even worse, so this part of the API should be rewritten. The side effect of this change is that any callable based binder (e.g. database migrations) will not be stopped, no matter what happens. This is a serious quirk, and may be better to remove other kinds of binders than hookable or rethink the stoppable binder. Signed-off-by:
Bart Jaskulski <bjaskulski@protonmail.com>
Bartek Jaskulski authoredPreviously stoppable binder was working for all binders, although it only supported to signal stop execution with class-based binders. This changes the behavior, as having all binders wrapped in stoppable binder resulted in execution of all collection binders, without regard for the stop signal. This is convoluted and gets even worse, so this part of the API should be rewritten. The side effect of this change is that any callable based binder (e.g. database migrations) will not be stopped, no matter what happens. This is a serious quirk, and may be better to remove other kinds of binders than hookable or rethink the stoppable binder. Signed-off-by:
Bart Jaskulski <bjaskulski@protonmail.com>
ConstantNotDefinedStrategy.php 329 B
<?php
namespace WPDesk\ShowDecision;
class ConstantNotDefinedStrategy implements ShouldShowStrategy
{
/**
* @var string
*/
private string $constant;
public function __construct(string $constant)
{
$this->constant = $constant;
}
public function shouldDisplay(): bool
{
return ! defined($this->constant);
}
}