From 4dd401dcb974f87d6c239c9ac892c9d6641d2884 Mon Sep 17 00:00:00 2001
From: Marcin Kolanko <marcin.kolanko@wpdesk.net>
Date: Thu, 18 Jul 2024 16:24:24 +0200
Subject: [PATCH] fix: bugs

---
 src/Binding/Binder/StoppableBinder.php | 3 ++-
 src/Init.php                           | 3 ++-
 src/Kernel.php                         | 8 +++++---
 src/platform_check.php                 | 3 +--
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/Binding/Binder/StoppableBinder.php b/src/Binding/Binder/StoppableBinder.php
index e74c7e0..8917f78 100644
--- a/src/Binding/Binder/StoppableBinder.php
+++ b/src/Binding/Binder/StoppableBinder.php
@@ -8,6 +8,7 @@ use Psr\Container\ContainerInterface;
 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 {
@@ -20,7 +21,7 @@ class StoppableBinder implements ComposableBinder {
 
 	private $should_stop = false;
 
-	public function __construct( Binder $b, ContainerInterface $c ) {
+	public function __construct( BinderInstance $b, ContainerInterface $c ) {
 		$this->binder    = $b;
 		$this->container = $c;
 	}
diff --git a/src/Init.php b/src/Init.php
index 5b0a869..7d8e37e 100644
--- a/src/Init.php
+++ b/src/Init.php
@@ -11,6 +11,7 @@ use WPDesk\Init\Extension\ConfigExtension;
 use WPDesk\Init\Extension\ExtensionsSet;
 use WPDesk\Init\Util\PhpFileLoader;
 use WPDesk\Init\Configuration\Configuration;
+use WPDesk\Init\Extension\ConditionalExtension;
 
 final class Init {
 
@@ -51,7 +52,7 @@ final class Init {
 	/**
 	 * @param string|null $filename Filename of the booted plugin. May be null, if called from plugin's main file.
 	 */
-	public function boot( string? $filename = null ) {
+	public function boot( ?string $filename = null ) {
 		if ( self::$bootable === false ) {
 			return;
 		}
diff --git a/src/Kernel.php b/src/Kernel.php
index 931db22..7e9ed9b 100644
--- a/src/Kernel.php
+++ b/src/Kernel.php
@@ -108,9 +108,11 @@ final class Kernel {
 
 	private function prepare_driver( ContainerInterface $container ): HookDriver {
 		$loader = new CompositeBindingLoader();
-		foreach ( $this->extensions->bindings( $container ) as $bindings ) {
-			$loader->add( $bindings );
-		}
+        foreach ($this->extensions as $extension) {
+            foreach ($extension->bindings($container) as $bindings) {
+                $loader->add($bindings);
+            }
+        }
 
 		$driver = new GenericDriver(
 			$loader,
diff --git a/src/platform_check.php b/src/platform_check.php
index d030711..c90ebb7 100644
--- a/src/platform_check.php
+++ b/src/platform_check.php
@@ -1,6 +1,5 @@
 <?php
-
-if ( ! ( PHP_VERSION_ID >= 72000 ) ) {
+if ( ! ( PHP_VERSION_ID >= 70200 ) ) {
 	add_action(
 		'admin_notices',
 		function () {
-- 
GitLab