forked from FriendsOfSymfony/FOSRestBundle
-
Notifications
You must be signed in to change notification settings - Fork 1
Add Symfony 8.0 support #1
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
25 commits
Select commit
Hold shift + click to select a range
98491a5
Update AbstractScalarParam.php
dev-craftec aa58577
Update AbstractScalarParam.php
dev-craftec a0b160a
Fix deprecations in symfony/validator, including the fix in #2417
tjveldhuizen f3e6058
Fix MimeTypeTest for Symfony 7.4
alexander-schranz 115b818
Don't use deprecated `#[Route]` methods
HypeMC 8295112
Merge pull request #2423 from alexander-schranz/bugfix/test-mime-type
goetas 8ce9c0c
Merge pull request #2422 from HypeMC/dont-use-deprecated-methods
goetas 6c246b7
Merge pull request #2417 from dev-craftec/bugfix/regex-validator-cons…
goetas d5f98e5
Merge pull request #2418 from tjveldhuizen/validator-deprecations
goetas a78c127
Switch to php for service configurations
W0rma c3be05f
Merge pull request #2421 from W0rma/replace-xml-config
goetas 02d0e33
Fix usage of deprecated method Request::get()
W0rma 13213ab
Fix deprecated usages of symfony/validator
W0rma ce7380c
Add support for symfony 8
W0rma bd9acb0
Merge pull request #2427 from W0rma/symfony8
goetas d71a83c
Test against PHP 8.5
W0rma c7a4615
Fix noop call of deprecated setAccessible() in PHP > 8.0
W0rma ee64e63
Merge pull request #2426 from W0rma/php85
goetas 5dce860
Fix build status badge
W0rma 438a54d
Remove broken SensioLabsInsight badge
W0rma c93f1e7
Remove outdated scrutinizer badges
W0rma 342632e
Merge pull request #2428 from W0rma/fix-readme-badge
goetas 0cb1733
Allow usage with symfony/config v8
W0rma 113cb1b
Merge remote-tracking branch 'upstream/3.x' into symfony8-support
nikola-jovanovic-php 43ff4d5
Merge remote-tracking branch 'w0rma/fix-symfony8' into symfony8-support
nikola-jovanovic-php 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
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 |
|---|---|---|
|
|
@@ -75,40 +75,40 @@ public function testComplexRequirements() | |
| public function testFileRequirements() | ||
| { | ||
| $this->param->nullable = true; | ||
| $this->param->requirements = $requirements = ['mimeTypes' => 'application/json']; | ||
| $this->param->requirements = ['mimeTypes' => 'application/json']; | ||
| $this->assertEquals([ | ||
| new File($requirements), | ||
| new File(null, null, null, 'application/json'), | ||
| ], $this->param->getConstraints()); | ||
| } | ||
|
|
||
| public function testImageRequirements() | ||
| { | ||
| $this->param->image = true; | ||
| $this->param->requirements = $requirements = ['mimeTypes' => 'image/gif']; | ||
| $this->param->requirements = ['mimeTypes' => ['image/*']]; | ||
| $this->assertEquals([ | ||
| new NotNull(), | ||
| new Image($requirements), | ||
| new Image(null, null, null, ['image/*']), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ], $this->param->getConstraints()); | ||
| } | ||
|
|
||
| public function testImageConstraintsTransformWhenParamIsAnArray() | ||
| { | ||
| $this->param->image = true; | ||
| $this->param->map = true; | ||
| $this->param->requirements = $requirements = ['mimeTypes' => 'image/gif']; | ||
| $this->param->requirements = ['mimeTypes' => ['image/*']]; | ||
| $this->assertEquals([new All([ | ||
| new NotNull(), | ||
| new Image($requirements), | ||
| new Image(null, null, null, ['image/*']), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ])], $this->param->getConstraints()); | ||
| } | ||
|
|
||
| public function testFileConstraintsWhenParamIsAnArray() | ||
| { | ||
| $this->param->map = true; | ||
| $this->param->requirements = $requirements = ['mimeTypes' => 'application/pdf']; | ||
| $this->param->requirements = ['mimeTypes' => 'application/pdf']; | ||
| $this->assertEquals([new All([ | ||
| new NotNull(), | ||
| new File($requirements), | ||
| new File(null, null, null, 'application/pdf'), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ])], $this->param->getConstraints()); | ||
| } | ||
| } | ||
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
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.
The constructor for
Symfony\Component\Validator\Constraints\Filehas changed in newer Symfony versions. The current instantiationnew File(null, null, null, 'application/json')is incorrect as it passes the mime type as the 4th argument, which corresponds tomimeTypesMessage. It should be the 3rd argument (mimeTypes).