-
Notifications
You must be signed in to change notification settings - Fork 97
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
* When using property promotion and needing to add an @param annotation for a property, use the constructor docblock as fallback when an @var isn't available * Fixed tests * Corrected some logic and improved for durability * Added tests * Removed incorrect comment * Check for instanceof Param
- Loading branch information
Showing
7 changed files
with
167 additions
and
14 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TheCodingMachine\GraphQLite\Fixtures80; | ||
|
||
use TheCodingMachine\GraphQLite\Annotations as GraphQLite; | ||
|
||
#[GraphQLite\Input] | ||
class PropertyPromotionInputType | ||
{ | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param array<int> $amounts | ||
*/ | ||
public function __construct( | ||
#[GraphQLite\Field] | ||
public array $amounts, | ||
) {} | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/Fixtures80/PropertyPromotionInputTypeWithoutGenericDoc.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\Fixtures80; | ||
|
||
use TheCodingMachine\GraphQLite\Annotations as GraphQLite; | ||
|
||
#[GraphQLite\Input] | ||
class PropertyPromotionInputTypeWithoutGenericDoc | ||
{ | ||
|
||
/** | ||
* We expect this to fail since the array must have a generic type `array<int>` | ||
*/ | ||
public function __construct( | ||
#[GraphQLite\Field] | ||
public array $amounts, | ||
) {} | ||
} |
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