-
-
Notifications
You must be signed in to change notification settings - Fork 922
fix: symfony deprecations #7277
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
], | ||
"require": { | ||
"php": ">=8.2", | ||
"api-platform/metadata": "^4.1.11", | ||
"api-platform/metadata": "^4.1.16", | ||
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. The AccessDeniedException was introduced in 4.1.16. |
||
"api-platform/state": "^4.1.11", | ||
"symfony/property-access": "^6.4 || ^7.0", | ||
"symfony/property-info": "^6.4 || ^7.1", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,11 @@ | |
public static function supportsProvider(): \Generator | ||
{ | ||
yield 'email' => [new Email(), new ApiProperty(), true]; | ||
yield 'url' => [new Url(), new ApiProperty(), true]; | ||
if (property_exists(Url::class, 'requireTld')) { | ||
yield 'url' => [new Url(requireTld: true), new ApiProperty(), true]; | ||
Check warning on line 50 in src/Symfony/Tests/Validator/Metadata/Property/Restriction/PropertySchemaFormatTest.php
|
||
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. Not passing requireTld imply a deprecation for sf > 7.1 ; but the property only exists since 7.1 |
||
} else { | ||
yield 'url' => [new Url(), new ApiProperty(), true]; | ||
Check warning on line 52 in src/Symfony/Tests/Validator/Metadata/Property/Restriction/PropertySchemaFormatTest.php
|
||
} | ||
if (class_exists(Hostname::class)) { | ||
yield 'hostname' => [new Hostname(), new ApiProperty(), true]; | ||
} | ||
|
@@ -67,7 +71,11 @@ | |
public static function createProvider(): \Generator | ||
{ | ||
yield 'email' => [new Email(), new ApiProperty(), ['format' => 'email']]; | ||
yield 'url' => [new Url(), new ApiProperty(), ['format' => 'uri']]; | ||
if (property_exists(Url::class, 'requireTld')) { | ||
yield 'url' => [new Url(requireTld: true), new ApiProperty(), ['format' => 'uri']]; | ||
Check warning on line 75 in src/Symfony/Tests/Validator/Metadata/Property/Restriction/PropertySchemaFormatTest.php
|
||
} else { | ||
yield 'url' => [new Url(), new ApiProperty(), ['format' => 'uri']]; | ||
Check warning on line 77 in src/Symfony/Tests/Validator/Metadata/Property/Restriction/PropertySchemaFormatTest.php
|
||
} | ||
if (class_exists(Hostname::class)) { | ||
yield 'hostname' => [new Hostname(), new ApiProperty(), ['format' => 'hostname']]; | ||
} | ||
|
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.
Using withNativeType was triggering the symfony deprecation.
Instead we should hydrate the buildinTypes only if necessary, which means, only if
getBuildinTypes
is called.This solve the deprecations.