-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [#708] Re-introduce feature about supporting target method attribut…
…es for resolving parameter annotations
- Loading branch information
1 parent
0f1a112
commit f5cd4b5
Showing
5 changed files
with
81 additions
and
1 deletion.
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
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
16 changes: 16 additions & 0 deletions
16
tests/Fixtures/Annotations/ClassWithTargetMethodParameterAnnotation.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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TheCodingMachine\GraphQLite\Fixtures\Annotations; | ||
|
||
use stdClass; | ||
|
||
/** @internal */ | ||
final class ClassWithTargetMethodParameterAnnotation | ||
{ | ||
#[TargetMethodParameterAnnotation(target: 'bar')] | ||
public function method(stdClass $bar): void | ||
{ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/Fixtures/Annotations/TargetMethodParameterAnnotation.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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TheCodingMachine\GraphQLite\Fixtures\Annotations; | ||
|
||
use TheCodingMachine\GraphQLite\Annotations\ParameterAnnotationInterface; | ||
|
||
#[\Attribute(\Attribute::TARGET_METHOD)] | ||
final class TargetMethodParameterAnnotation implements ParameterAnnotationInterface | ||
{ | ||
public function __construct(private readonly string $target) | ||
{ | ||
} | ||
|
||
public function getTarget(): string | ||
{ | ||
return $this->target; | ||
} | ||
} |