Skip to content
Snippets Groups Projects
Commit 4dd401dc authored by Marcin Kolanko's avatar Marcin Kolanko
Browse files

fix: bugs

parent ddca3cac
No related branches found
No related tags found
1 merge request!3improve into wp-hook and some additional unfinished things
......@@ -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;
  • Owner

    Czemu z aliasem?

  • Marcin Kolanko @marcinkolanko ·
    Author Owner

    bo klasa StoppableBinder znajduje się w przestrzeni nazw WPDesk\Init\Binding\Binder, tak samo jak ta przestrzeń nazw ulokowany jest interfejs Binder którego importujemy poprzez use WPDesk\Init\Binding\Binder. Wcześniej w konstruktorze była podana nieprawidłowa lokalizacja Bindera, konstruktor oczekiwał interfejsu WPDesk\Init\Binding\Binder\Binder co powodowało smród, dlatego żeby się nie pierdzieliło dodałem alias.

  • Please register or sign in to reply
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;
}
......
......@@ -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;
}
......
......@@ -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) {
  • Owner

    Czemu dwie pętle? Przecież to nic nie zmienia.

    Btw, proszę o phpcbf, jeśli styl kodu się nie zgadza.

  • Marcin Kolanko @marcinkolanko ·
    Author Owner

    bo ExtensionsSet nie ma metody bindings i wszystko się wywalało :P, zawiera za to inne extensions które już takową metodę posiadają. Po tej poprawce skrypt przestał się wypierdzielać, także strzelam że jest git.

    Edited by Marcin Kolanko
  • Owner

    Ok, I'm blind. Absolutnie masz rację.

  • Please register or sign in to reply
foreach ($extension->bindings($container) as $bindings) {
$loader->add($bindings);
}
}
$driver = new GenericDriver(
$loader,
......
<?php
if ( ! ( PHP_VERSION_ID >= 72000 ) ) {
if ( ! ( PHP_VERSION_ID >= 70200 ) ) {
  • Owner

    Czemu? Ta biblioteka ma wspierać od 7.2 w górę

  • Owner

    Nawet bym się pokusił o 7.3, ale trzeba gremialnie podjąć decyzję

  • Marcin Kolanko @marcinkolanko ·
    Author Owner

    u siebie lokalnie mam wersję php 7.4.33 id jakie wypluwa PHP_VERSION_ID to 70433 wiec strzelam ze w przypadku php 7.2 będzie to 70200 a nie 72000

    Edited by Marcin Kolanko
  • Owner

    ok, racja, my bad

  • Please register or sign in to reply
add_action(
'admin_notices',
function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment