-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure decorator collections work, update changelog, deprecate cacheD…
…ir (#391) * Ensure decorator collections work, update changelog, deprecate cacheDir * Fix missing closure return type
- Loading branch information
Showing
16 changed files
with
218 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
fixture_src/InjectServiceCollectionDecorator/BarImplementation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator; | ||
|
||
use Cspray\AnnotatedContainer\Attribute\Service; | ||
|
||
#[Service] | ||
class BarImplementation implements FooInterface { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
fixture_src/InjectServiceCollectionDecorator/BazImplementation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator; | ||
|
||
use Cspray\AnnotatedContainer\Attribute\Service; | ||
|
||
#[Service] | ||
class BazImplementation implements FooInterface { | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
fixture_src/InjectServiceCollectionDecorator/CompositeFooImplementation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator; | ||
|
||
use Cspray\AnnotatedContainer\Attribute\Inject; | ||
use Cspray\AnnotatedContainer\Attribute\Service; | ||
use Cspray\AnnotatedContainer\ContainerFactory\ListOfAsArray; | ||
|
||
#[Service(primary: true)] | ||
class CompositeFooImplementation implements FooInterface { | ||
|
||
public function __construct( | ||
#[Inject(new ListOfAsArray(FooInterface::class))] | ||
public readonly array $foos | ||
) {} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
fixture_src/InjectServiceCollectionDecorator/FooImplementation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator; | ||
|
||
use Cspray\AnnotatedContainer\Attribute\Service; | ||
|
||
#[Service] | ||
class FooImplementation implements FooInterface { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
fixture_src/InjectServiceCollectionDecorator/FooInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator; | ||
|
||
use Cspray\AnnotatedContainer\Attribute\Service; | ||
|
||
#[Service] | ||
interface FooInterface { | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
fixture_src/InjectServiceCollectionDecorator/FooService.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator; | ||
|
||
use Cspray\AnnotatedContainer\Attribute\Service; | ||
|
||
#[Service] | ||
class FooService { | ||
|
||
public function __construct( | ||
public readonly FooInterface $foo | ||
) {} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Cspray\AnnotatedContainerFixture; | ||
|
||
use Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator\BarImplementation; | ||
use Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator\BazImplementation; | ||
use Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator\CompositeFooImplementation; | ||
use Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator\FooImplementation; | ||
use Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator\FooInterface; | ||
use Cspray\AnnotatedContainerFixture\InjectServiceCollectionDecorator\FooService; | ||
use Cspray\Typiphy\ObjectType; | ||
use function Cspray\Typiphy\objectType; | ||
|
||
class InjectServiceCollectionDecoratorFixture implements Fixture { | ||
|
||
public function getPath() : string { | ||
return __DIR__ . '/InjectServiceCollectionDecorator'; | ||
} | ||
|
||
public function fooService() : ObjectType { | ||
return objectType(FooService::class); | ||
} | ||
|
||
public function compositeFoo() : ObjectType { | ||
return objectType(CompositeFooImplementation::class); | ||
} | ||
|
||
public function fooInterface() : ObjectType { | ||
return objectType(FooInterface::class); | ||
} | ||
|
||
public function fooImplementation() : ObjectType { | ||
return objectType(FooImplementation::class); | ||
} | ||
|
||
public function barImplementation() : ObjectType { | ||
return objectType(BarImplementation::class); | ||
} | ||
|
||
public function bazImplementation() : ObjectType { | ||
return objectType(BazImplementation::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters