Skip to content

Commit

Permalink
Merge pull request #240 from koriym/NamedArgumentConstructor
Browse files Browse the repository at this point in the history
Replace deprecated marker interface
  • Loading branch information
koriym committed Mar 12, 2021
2 parents d8f131d + f59764f commit c7cb189
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 106 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": "^7.2 || ^8.0",
"doctrine/annotations": "^1.11",
"doctrine/annotations": "^1.12",
"doctrine/cache": "^1.10",
"koriym/attributes": "^1.0",
"koriym/null-object": "^0.1",
Expand Down
4 changes: 3 additions & 1 deletion src/di/Di/Assisted.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Ray\Di\Di;

use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation;
use Ray\Aop\Annotation\AbstractAssisted;

Expand All @@ -13,9 +14,10 @@
*
* @Annotation
* @Target("METHOD")
* @NamedArgumentConstructor
*/
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_PARAMETER)]
final class Assisted extends AbstractAssisted implements NamedArgumentConstructorAnnotation
final class Assisted extends AbstractAssisted
{
/** @var array<string> */
public $values;
Expand Down
4 changes: 3 additions & 1 deletion src/di/Di/Inject.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
namespace Ray\Di\Di;

use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation;

/**
* Annotates your class methods into which the Injector should inject values
*
* @Annotation
* @Target("METHOD")
* @NamedArgumentConstructor
*/
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_PARAMETER)]
final class Inject implements InjectInterface, NamedArgumentConstructorAnnotation
final class Inject implements InjectInterface
{
/**
* If true, and the appropriate binding is not found, the Injector will skip injection of this method or field rather than produce an error.
Expand Down
4 changes: 3 additions & 1 deletion src/di/Di/Named.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
namespace Ray\Di\Di;

use Attribute;
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation;

/**
* Annotates named things
*
* @Annotation
* @Target("METHOD")
* @NamedArgumentConstructor
*/
#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_METHOD)]
final class Named implements NamedArgumentConstructorAnnotation
final class Named
{
/** @var string */
public $value = '';
Expand Down
Loading

0 comments on commit c7cb189

Please sign in to comment.