Skip to content

Commit

Permalink
docs improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikbosch committed May 22, 2024
1 parent e3c598f commit 567f29b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,21 +196,21 @@ annotate methods with it inside a `Controller` class.
```php
#[\Attribute]
use Aura\Di\AttributeConfigInterface;
use Aura\Di\Container;
use Aura\Di\Injection\Lazy;
use Aura\Di\Injection\LazyLazy;
use Aura\Di\Injection\LazyNew;
use Aura\Di\Resolver\Resolver;

class Route implements AttributeConfigInterface {
public function __construct(private string $method, private string $uri) {
}

public function define(Resolver $resolver, \Reflector $reflector): void
public function define(Container $di, \ReflectionAttribute $attribute, \Reflector $annotatedTo): void
{
if ($reflector instanceof \ReflectionMethod) {
// considering the routes key is a lazy array, defined like this
// $resolver->values['routes'] = $container->lazyArray([]);
$resolver->values['routes']->append(
$di->values['routes']->append(
new RealRoute(
$this->method,
$this->uri,
Expand Down

0 comments on commit 567f29b

Please sign in to comment.