Skip to content

Commit 298fe69

Browse files
committed
Update AttributesEngine.php
1 parent ec24d29 commit 298fe69

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Ubiquity/attributes/AttributesEngine.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class AttributesEngine implements AnnotationsEngineInterface {
3232

3333
protected static array $registry;
3434

35-
protected array $uses;
36-
3735
protected function attributesNewInstances(array $attributes): array {
3836
$result = [];
3937
foreach ($attributes as $attribute) {
@@ -87,7 +85,6 @@ public function start(string $cacheDirectory): void {
8785
'autowired' => Autowired::class,
8886
'injected' => Injected::class
8987
];
90-
$this->uses = [];
9188
}
9289

9390
public function getAnnotationByKey(?string $key = null): ?string {
@@ -98,10 +95,10 @@ public function registerAnnotations(array $nameClasses): void {
9895
\array_merge(self::$registry, $nameClasses);
9996
}
10097

101-
public function getAnnotation(string $key, array $parameters = []): ?object {
98+
public function getAnnotation(object $container, string $key, array $parameters = []): ?object {
10299
if (isset(self::$registry[$key])) {
103100
$classname = self::$registry[$key];
104-
$this->uses[$classname] = true;
101+
$container->addUse($classname);
105102
$reflect = new \ReflectionClass($classname);
106103
return $reflect->newInstanceArgs($parameters);
107104
}
@@ -141,9 +138,5 @@ public function is(string $key, object $annotation): bool {
141138
}
142139
return false;
143140
}
144-
145-
public function getUses(): array {
146-
return \array_keys($this->uses);
147-
}
148141
}
149142

0 commit comments

Comments
 (0)