diff --git a/composer.json b/composer.json index b691a9c..837683a 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "require": { "php": ">= 8.2", "composer-runtime-api": "^2.2", - "archict/brick": "^0.1.0", + "archict/brick": "^0", "composer/class-map-generator": "^1.1", "azjezz/psl": "^2.9", "cuyz/valinor": "^1.12", diff --git a/composer.lock b/composer.lock index f6c06f2..6bf6a63 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3cfb2c60d798831db8c01c85f736b9ab", + "content-hash": "c447785e50b96fb3c5e89b43240adc7c", "packages": [ { "name": "archict/brick", - "version": "v0.1.0", + "version": "v0.2.0", "source": { "type": "git", "url": "https://github.com/Archict/brick.git", - "reference": "d0b4581b1b92d11427dcd332c4f65711fda5e966" + "reference": "442e7230807bd55f1cd0ef8abf1b36272967ec77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Archict/brick/zipball/d0b4581b1b92d11427dcd332c4f65711fda5e966", - "reference": "d0b4581b1b92d11427dcd332c4f65711fda5e966", + "url": "https://api.github.com/repos/Archict/brick/zipball/442e7230807bd55f1cd0ef8abf1b36272967ec77", + "reference": "442e7230807bd55f1cd0ef8abf1b36272967ec77", "shasum": "" }, "require": { @@ -42,9 +42,9 @@ "description": "Base library for Archict framework", "support": { "issues": "https://github.com/Archict/brick/issues", - "source": "https://github.com/Archict/brick/tree/v0.1.0" + "source": "https://github.com/Archict/brick/tree/v0.2.0" }, - "time": "2024-04-12T15:48:26+00:00" + "time": "2024-04-18T16:07:42+00:00" }, { "name": "azjezz/psl", @@ -4318,5 +4318,5 @@ "composer-runtime-api": "^2.2" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.2.0" } diff --git a/include/Bricks/LoadBricks.php b/include/Bricks/LoadBricks.php index 5730eae..dc5381f 100644 --- a/include/Bricks/LoadBricks.php +++ b/include/Bricks/LoadBricks.php @@ -28,7 +28,6 @@ namespace Archict\Core\Bricks; use Archict\Brick\Service; -use Archict\Brick\ServiceConfiguration; use Archict\Core\Services\ServiceRepresentation; use Composer\ClassMapGenerator\ClassMapGenerator; use Composer\InstalledVersions; @@ -41,7 +40,6 @@ final readonly class LoadBricks implements BricksLoader { /** - * @throws NotAServiceConfigurationException * @throws ReflectionException */ public function loadInstalledBricks(): array @@ -70,7 +68,6 @@ public function loadInstalledBricks(): array /** * @return ServiceRepresentation[] - * @throws NotAServiceConfigurationException * @throws ReflectionException */ private function loadServicesOfPackage(string $package_path): array @@ -86,20 +83,8 @@ private function loadServicesOfPackage(string $package_path): array continue; } - $service_attribute = $attributes[0]->newInstance(); - $configuration_attribute = null; - if ($service_attribute->configuration_classname !== null) { - $configuration_reflection = new ReflectionClass($service_attribute->configuration_classname); - - $configuration_attributes = $configuration_reflection->getAttributes(ServiceConfiguration::class); - if (empty($configuration_attributes)) { - throw new NotAServiceConfigurationException($service_attribute->configuration_classname, $reflection->name); - } - - $configuration_attribute = $configuration_attributes[0]->newInstance(); - } - - $result[] = new ServiceRepresentation($reflection, $service_attribute, $package_path); + $service_attribute = $attributes[0]->newInstance(); + $result[] = new ServiceRepresentation($reflection, $service_attribute, $package_path); } return $result; diff --git a/include/Bricks/NotAServiceConfigurationException.php b/include/Bricks/NotAServiceConfigurationException.php deleted file mode 100644 index bd9d626..0000000 --- a/include/Bricks/NotAServiceConfigurationException.php +++ /dev/null @@ -1,38 +0,0 @@ -