diff --git a/composer.json b/composer.json index 330453d..2a47a99 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,6 @@ "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "ext-simplexml": "*", "friendsofphp/php-cs-fixer": "^3.51", "league/flysystem-async-aws-s3": "^2.0 || ^3.0", "league/flysystem-aws-s3-v3": "^2.0 || ^3.0", diff --git a/src/DependencyInjection/OneupFlysystemExtension.php b/src/DependencyInjection/OneupFlysystemExtension.php index ffd3634..a3f2dc3 100644 --- a/src/DependencyInjection/OneupFlysystemExtension.php +++ b/src/DependencyInjection/OneupFlysystemExtension.php @@ -21,23 +21,17 @@ class OneupFlysystemExtension extends Extension public function load(array $configs, ContainerBuilder $container): void { - if (class_exists(Loader\XmlFileLoader::class)) { - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loaderExt = '.xml'; - } else { - $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loaderExt = '.php'; - } + $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loader->load('factories' . $loaderExt); + $loader->load('factories.php'); $adapterFactories = $this->getFactories($container); $configuration = new Configuration($adapterFactories); $config = $this->processConfiguration($configuration, $configs); - $loader->load('adapters' . $loaderExt); - $loader->load('flysystem' . $loaderExt); + $loader->load('adapters.php'); + $loader->load('flysystem.php'); $adapters = []; @@ -52,13 +46,8 @@ public function load(array $configs, ContainerBuilder $container): void public function getConfiguration(array $config, ContainerBuilder $container): Configuration { - if (class_exists(Loader\XmlFileLoader::class)) { - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loader->load('factories.xml'); - } else { - $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loader->load(resource: 'factories.php'); - } + $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); + $loader->load('factories.php'); $adapterFactories = $this->getFactories($container); diff --git a/src/Resources/config/adapters.xml b/src/Resources/config/adapters.xml deleted file mode 100644 index 5557c0a..0000000 --- a/src/Resources/config/adapters.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Resources/config/factories.xml b/src/Resources/config/factories.xml deleted file mode 100644 index e58603f..0000000 --- a/src/Resources/config/factories.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Resources/config/flysystem.xml b/src/Resources/config/flysystem.xml deleted file mode 100644 index def72c0..0000000 --- a/src/Resources/config/flysystem.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Filesystems --> - - - - - - - - diff --git a/tests/DependencyInjection/OneupFlysystemExtensionTest.php b/tests/DependencyInjection/OneupFlysystemExtensionTest.php index 259b451..350f937 100644 --- a/tests/DependencyInjection/OneupFlysystemExtensionTest.php +++ b/tests/DependencyInjection/OneupFlysystemExtensionTest.php @@ -89,24 +89,6 @@ public function testDirectoryVisibilitySettings(): void self::assertSame(Visibility::PUBLIC, $directory6Attributes->visibility()); } - public function testAdapterAvailability(): void - { - /** @var \SimpleXMLElement $adapters */ - $adapters = simplexml_load_string((string) file_get_contents(__DIR__ . '/../../src/Resources/config/adapters.xml')); - - foreach ($adapters->children()->children() as $service) { - if (null === $service->attributes()) { - continue; - } - - foreach ($service->attributes() as $key => $attribute) { - if ('class' === (string) $key) { - self::assertTrue(class_exists((string) $attribute), 'Could not load class: ' . $attribute); - } - } - } - } - public function testGetConfiguration(): void { $extension = new OneupFlysystemExtension();