-
-
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
base: main
Are you sure you want to change the base?
fix: symfony deprecations #7277
Conversation
VincentLanglet
commented
Jul 3, 2025
Q | A |
---|---|
Branch? | main for features / current stable version branch for bug fixes |
Tickets | Closes #..., closes #... |
License | MIT |
Doc PR | api-platform/docs#... |
368e6bd
to
362c0f1
Compare
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
The AccessDeniedException was introduced in 4.1.16.
b2b5f99
@@ -541,7 +545,6 @@ public function withNativeType(?Type $nativeType): self | |||
{ | |||
$self = clone $this; | |||
$self->nativeType = $nativeType; | |||
$self->builtinTypes = PropertyInfoToTypeInfoHelper::convertTypeToLegacyTypes($nativeType) ?? []; |
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.
@@ -46,7 +46,11 @@ public function testSupports(Constraint $constraint, ApiProperty $propertyMetada | |||
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]; |
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.
Not passing requireTld imply a deprecation for sf > 7.1 ; but the property only exists since 7.1