Skip to content
Snippets Groups Projects
Verified Commit e4b6d594 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

fix: improve the work of stoppable binder


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: default avatarBart Jaskulski <bjaskulski@protonmail.com>
parent 9b6a1708
No related branches found
No related tags found
1 merge request!5feat: remove compilation command
......@@ -9,7 +9,6 @@ use WPDesk\Init\Binding\ComposableBinder;
use WPDesk\Init\Binding\StoppableBinder as Stop;
use WPDesk\Init\Binding\Definition;
use WPDesk\Init\Binding\Binder as BinderInstance;
use WPDesk\Init\Binding\Definition\HookableDefinition;
class StoppableBinder implements ComposableBinder {
......
......@@ -7,7 +7,6 @@ use DI\Container;
use DI\ContainerBuilder as DiBuilder;
use Psr\Container\ContainerInterface;
use WPDesk\Init\Binding\Binder\CallableBinder;
use WPDesk\Init\Binding\Binder\CollectionBinder;
use WPDesk\Init\Binding\Binder\CompositeBinder;
use WPDesk\Init\Binding\Binder\HookableBinder;
use WPDesk\Init\Binding\Binder\StoppableBinder;
......@@ -132,12 +131,9 @@ final class Kernel {
$driver = new GenericDriver(
$loader,
new StoppableBinder(
new CompositeBinder(
new HookableBinder( $container ),
new StoppableBinder( new HookableBinder( $container ), $container ),
new CallableBinder( $container )
),
$container
)
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment