-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* ✨ [#708] Re-introduce feature about supporting target method attributes for resolving parameter annotations * 📦 Introduce runtime deprecation for deprecated functionality to hint about upgrade path
- Loading branch information
1 parent
183d373
commit 04d592f
Showing
5 changed files
with
111 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
21 changes: 21 additions & 0 deletions
21
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,21 @@ | ||
<?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 | ||
{ | ||
} | ||
|
||
#[TargetMethodParameterAnnotation(target: 'unexistent')] | ||
public function methodWithInvalidAnnotation(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; | ||
} | ||
} |