diff --git a/composer.json b/composer.json index 479fb9b..032feba 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "packaged/config": "~1.5", "packaged/context": "^1.11", "packaged/context-i18n": "~1.0", - "packaged/di-container": "^1.7", + "packaged/di-container": "dev-multi-observer as 1.7", "packaged/event": "~1.2", "packaged/figlet": "~0.0", "packaged/helpers": "^2.15", @@ -51,5 +51,11 @@ "psr-4": { "Cubex\\Tests\\": "tests/" } - } + }, + "repositories": [ + { + "type": "git", + "url": "git@github.com:msievenpiper/di-container.git" + } + ] } diff --git a/src/Attributes/AttributeResult.php b/src/Attributes/AttributeResult.php new file mode 100644 index 0000000..4968264 --- /dev/null +++ b/src/Attributes/AttributeResult.php @@ -0,0 +1,17 @@ +_class = $class; - $this->_args = $args; } public function getClass(): string @@ -20,7 +17,7 @@ public function getClass(): string return $this->_class; } - public function result(?DependencyInjector $di): ConditionResult + public function result(?DependencyInjector $di): AttributeResult { $obj = null; @@ -33,7 +30,7 @@ public function result(?DependencyInjector $di): ConditionResult $obj = new $this->_class(...$this->_args); } - if($obj instanceof ConditionResult) + if($obj instanceof AttributeResult) { return $obj; } diff --git a/src/Attributes/PreCondition.php b/src/Attributes/Conditional/PreCondition.php similarity index 78% rename from src/Attributes/PreCondition.php rename to src/Attributes/Conditional/PreCondition.php index b0670cd..1eb0a2d 100644 --- a/src/Attributes/PreCondition.php +++ b/src/Attributes/Conditional/PreCondition.php @@ -1,6 +1,6 @@ getName() === PreCondition::class) { - /** @var \Cubex\Attributes\AbstractConditionAttribute $condition */ + /** @var AbstractConditionAttribute $condition */ $condition = $attribute->newInstance(); $this->_conditions[$condition->getClass()] = $condition; }