Skip to content

Commit

Permalink
Add ClassHasFactoryAttribute2.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Jul 13, 2024
1 parent 13c6c70 commit 9f46e62
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Fixture/Attribute/ClassHasFactoryAttribute2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Tests\Fixture\Attribute;

use Ghostwriter\Container\Attribute\Factory;
use Ghostwriter\Container\Attribute\Inject;

final readonly class ClassHasFactoryAttribute2
{
public function __construct(
#[Inject(Foobar2::class)]
#[Factory(Foobar2Factory::class)]
private Foobar2Interface $foobar
)
{
}

public function foobar(): Foobar2Interface
{
return $this->foobar;
}
}

0 comments on commit 9f46e62

Please sign in to comment.