diff --git a/src/circuit-breaker/src/Annotation/CircuitBreaker.php b/src/circuit-breaker/src/Annotation/CircuitBreaker.php index d2aac57ec..5d065e4ca 100644 --- a/src/circuit-breaker/src/Annotation/CircuitBreaker.php +++ b/src/circuit-breaker/src/Annotation/CircuitBreaker.php @@ -59,8 +59,6 @@ class CircuitBreaker extends AbstractAnnotation public function __construct(...$value) { - parent::__construct(...$value); - - $this->value = $this->formatParams($value); + $this->value = parent::__construct(...$value); } } diff --git a/src/config/src/Annotation/Value.php b/src/config/src/Annotation/Value.php index 1efba655c..eb9fca447 100644 --- a/src/config/src/Annotation/Value.php +++ b/src/config/src/Annotation/Value.php @@ -28,8 +28,7 @@ class Value extends AbstractAnnotation public function __construct(...$value) { - parent::__construct(...$value); - $value = $this->formatParams($value); + $value = parent::__construct(...$value); $this->bindMainProperty('key', $value); } } diff --git a/src/crontab/src/Annotation/Crontab.php b/src/crontab/src/Annotation/Crontab.php index 85242ba82..7f1a54ac5 100644 --- a/src/crontab/src/Annotation/Crontab.php +++ b/src/crontab/src/Annotation/Crontab.php @@ -76,8 +76,7 @@ class Crontab extends AbstractAnnotation public function __construct(...$value) { - parent::__construct(...$value); - $value = $this->formatParams($value); + $value = parent::__construct(...$value); $this->bindMainProperty('rule', $value); if (! empty($this->rule)) { $this->rule = str_replace('\\', '', $this->rule); diff --git a/src/di/src/Annotation/AbstractAnnotation.php b/src/di/src/Annotation/AbstractAnnotation.php index 289bf8016..522e96ca4 100644 --- a/src/di/src/Annotation/AbstractAnnotation.php +++ b/src/di/src/Annotation/AbstractAnnotation.php @@ -25,6 +25,7 @@ abstract class AbstractAnnotation implements AnnotationInterface, Arrayable $this->{$key} = $val; } } + return $value; } protected function formatParams($value): array diff --git a/src/di/src/Annotation/AnnotationReader.php b/src/di/src/Annotation/AnnotationReader.php index 3f5228b5e..e5229b554 100644 --- a/src/di/src/Annotation/AnnotationReader.php +++ b/src/di/src/Annotation/AnnotationReader.php @@ -71,7 +71,8 @@ class AnnotationReader implements Reader 'example' => true, 'filesource' => true, 'global' => true, - 'ignore' => true, /* Can we enable this? 'index' => true, */ 'internal' => true, + 'ignore' => true, /* Can we enable this? 'index' => true, */ + 'internal' => true, 'license' => true, 'link' => true, 'method' => true, 'package' => true, 'param' => true, 'property' => true, 'property-read' => true, 'property-write' => true, @@ -232,7 +233,9 @@ class AnnotationReader implements Reader public function getAttributes(\Reflector $reflection): ?array { if (method_exists($reflection, 'getAttributes') && $attributes = $reflection->getAttributes()) { - return array_map(fn(\ReflectionAttribute $attribute) => $attribute->newInstance(), $attributes); + return array_map(function (\ReflectionAttribute $attribute) { + return $attribute->newInstance(); + }, $attributes); } return null; } diff --git a/src/http-server/src/Annotation/Middleware.php b/src/http-server/src/Annotation/Middleware.php index 237946adc..3cca9fe63 100644 --- a/src/http-server/src/Annotation/Middleware.php +++ b/src/http-server/src/Annotation/Middleware.php @@ -28,8 +28,7 @@ class Middleware extends AbstractAnnotation public function __construct(...$value) { - parent::__construct(...$value); - $value = $this->formatParams($value); + $value = parent::__construct(...$value); $this->bindMainProperty('middleware', $value); } } diff --git a/src/http-server/src/Annotation/RequestMapping.php b/src/http-server/src/Annotation/RequestMapping.php index 1f4c9e0cf..85dbda256 100644 --- a/src/http-server/src/Annotation/RequestMapping.php +++ b/src/http-server/src/Annotation/RequestMapping.php @@ -42,8 +42,7 @@ class RequestMapping extends Mapping public function __construct(...$value) { - parent::__construct(...$value); - $value = $this->formatParams($value); + $value = parent::__construct(...$value); if (isset($value['methods'])) { if (is_string($value['methods'])) { // Explode a string to a array diff --git a/src/model-listener/src/Annotation/ModelListener.php b/src/model-listener/src/Annotation/ModelListener.php index e59133db2..391e38586 100644 --- a/src/model-listener/src/Annotation/ModelListener.php +++ b/src/model-listener/src/Annotation/ModelListener.php @@ -30,8 +30,7 @@ class ModelListener extends AbstractAnnotation public function __construct(...$value) { - parent::__construct(...$value); - $value = $this->formatParams($value); + $value = parent::__construct(...$value); if ($value = $value['value'] ?? null) { if (is_string($value)) { diff --git a/src/socketio-server/src/Annotation/Event.php b/src/socketio-server/src/Annotation/Event.php index aeb52b8b9..af5ffe81a 100644 --- a/src/socketio-server/src/Annotation/Event.php +++ b/src/socketio-server/src/Annotation/Event.php @@ -27,8 +27,7 @@ class Event extends AbstractAnnotation public function __construct(...$value) { - parent::__construct(...$value); - $value = $this->formatParams($value); + $value = parent::__construct(...$value); $this->bindMainProperty('event', $value); } diff --git a/src/socketio-server/src/Annotation/SocketIONamespace.php b/src/socketio-server/src/Annotation/SocketIONamespace.php index cefac8cb1..4d6e50051 100644 --- a/src/socketio-server/src/Annotation/SocketIONamespace.php +++ b/src/socketio-server/src/Annotation/SocketIONamespace.php @@ -26,8 +26,7 @@ class SocketIONamespace extends AbstractAnnotation public function __construct(...$value) { - parent::__construct(...$value); - $value = $this->formatParams($value); + $value = parent::__construct(...$value); $this->bindMainProperty('namespace', $value); }