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

refactor: simplify definitions loader instantation

parent 6a09ab5c
Branches
Tags
2 merge requests!3improve into wp-hook and some additional unfinished things,!21.x
...@@ -5,22 +5,16 @@ declare(strict_types=1); ...@@ -5,22 +5,16 @@ declare(strict_types=1);
namespace WPDesk\Init\Extension; namespace WPDesk\Init\Extension;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use WPDesk\Init\Binding\DefinitionFactory;
use WPDesk\Init\Binding\Loader\BindingDefinitions; use WPDesk\Init\Binding\Loader\BindingDefinitions;
use WPDesk\Init\Binding\Loader\FilesystemDefinitions; use WPDesk\Init\Binding\Loader\FilesystemDefinitions;
use WPDesk\Init\Configuration\ReadableConfig; use WPDesk\Init\Configuration\ReadableConfig;
use WPDesk\Init\DependencyInjection\ContainerBuilder; use WPDesk\Init\DependencyInjection\ContainerBuilder;
use WPDesk\Init\Loader\PhpFileLoader;
use WPDesk\Init\Plugin\Plugin; use WPDesk\Init\Plugin\Plugin;
class BuiltinExtension implements Extension { class BuiltinExtension implements Extension {
public function bindings( ContainerInterface $c ): BindingDefinitions { public function bindings( ContainerInterface $c ): BindingDefinitions {
return new FilesystemDefinitions( return new FilesystemDefinitions( __DIR__ . '/../Resources/bindings' );
__DIR__ . '/../Resources/bindings',
new PhpFileLoader(),
new DefinitionFactory()
);
} }
public function build( ContainerBuilder $builder, Plugin $plugin, ReadableConfig $config ): void { public function build( ContainerBuilder $builder, Plugin $plugin, ReadableConfig $config ): void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment