-
Notifications
You must be signed in to change notification settings - Fork 20
Support of graphqlite 7 and symfony 7 #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
48f9578
fix: replace doctrine annotations with attributes
fogrye f50476b
chore: bump dependencies for symfony and graphqlite
fogrye 3d48c7e
chore: remove doctrine annotation
fogrye 74afb13
Merge branch 'master' into master
fogrye eb0e031
chore: prepare for v7
fogrye f469df2
Merge remote-tracking branch 'origin/master'
fogrye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TheCodingMachine\GraphQLite\Validator\Annotations; | ||
|
||
use BadMethodCallException; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class AssertionTest extends TestCase | ||
{ | ||
|
||
public function testException1() | ||
public function testException1(): void | ||
{ | ||
$this->expectException(BadMethodCallException::class); | ||
$this->expectExceptionMessage('The @Assert annotation must be passed a target. For instance: "@Assert(for="$email", constraint=@Email)"'); | ||
$this->expectExceptionMessage('The Assert attribute must be passed a target. For instance: "#[Assert(for: "$email", constraint: new Email())"'); | ||
new Assertion([]); | ||
} | ||
|
||
public function testException2() | ||
public function testException2(): void | ||
{ | ||
$this->expectException(BadMethodCallException::class); | ||
$this->expectExceptionMessage('The @Assert annotation must be passed one or many constraints. For instance: "@Assert(for="$email", constraint=@Email)"'); | ||
new Assertion(['for'=>'foo']); | ||
$this->expectExceptionMessage('The Assert attribute must be passed one or many constraints. For instance: "#[Assert(for: "$email", constraint: new Email())"'); | ||
new Assertion(['for' => 'foo']); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,40 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TheCodingMachine\GraphQLite\Validator\Fixtures\Types; | ||
|
||
use Symfony\Component\Validator\Constraints as Assert; | ||
use TheCodingMachine\GraphQLite\Annotations\Field; | ||
use TheCodingMachine\GraphQLite\Annotations\Type; | ||
|
||
/** | ||
* @Type() | ||
*/ | ||
#[Type] | ||
class User | ||
{ | ||
/** | ||
* @Assert\Email( | ||
* message = "The email '{{ value }}' is not a valid email." | ||
* ) | ||
*/ | ||
private $email; | ||
#[Assert\Email(message: "The email '{{ value }}' is not a valid email.")] | ||
private string $email; | ||
|
||
/** | ||
* The NotCompromisedPassword assertion asks the "HaveIBeenPawned" service if your password has already leaked or not. | ||
* @Assert\Length(min=8) | ||
*/ | ||
private $password; | ||
#[Assert\Length(min: 8)] | ||
private string $password; | ||
|
||
public function __construct(string $email, string $password) | ||
{ | ||
$this->email = $email; | ||
$this->password = $password; | ||
} | ||
|
||
/** | ||
* @Field() | ||
*/ | ||
#[Field] | ||
public function getEmail(): string | ||
{ | ||
return $this->email; | ||
} | ||
} | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a breaking change, no ? I mean people upgrading might get errors if they are using Annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that's BC to support symfony 7