Skip to content

Conversation

@Kocal
Copy link
Member

@Kocal Kocal commented Nov 22, 2025

Q A
Bug fix? no
New feature? yes
Deprecations? no
Documentation? no
Issues Fix #...
License MIT

Forgotten from #2754

EDIT: failing checks PHPStan & Turbo tests will be fixed in #3185

@Kocal Kocal added this to the 3.0 milestone Nov 22, 2025
@Kocal Kocal self-assigned this Nov 22, 2025
@Kocal Kocal force-pushed the uncomment-new-parameters-and-methods branch 5 times, most recently from bda8eb8 to a5cea09 Compare November 22, 2025 15:56
Copilot finished reviewing on behalf of Kocal November 22, 2025 17:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes backward compatibility (BC) layers for the Turbo and Autocomplete packages as part of the preparation for Symfony UX 3.0. The changes make previously optional method parameters mandatory and remove deprecated interfaces that were used to maintain backward compatibility.

Key Changes:

  • Made $eventSourceOptions parameter mandatory in TurboStreamListenRendererInterface::renderTurboStreamListen()
  • Made getAttributes() and getGroupBy() methods mandatory in EntityAutocompleterInterface
  • Removed the TurboStreamListenRendererWithOptionsInterface marker interface

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Turbo/src/Twig/TurboStreamListenRendererInterface.php Added mandatory $eventSourceOptions parameter with type hint and PHPDoc
src/Turbo/src/Twig/TurboStreamListenRendererWithOptionsInterface.php Removed deprecated marker interface that extended the base interface
src/Turbo/src/Twig/TurboRuntime.php Removed BC layer checking for TurboStreamListenRendererWithOptionsInterface
src/Turbo/src/Bridge/Mercure/TurboStreamListenRenderer.php Updated implementation to use standard parameter instead of func_get_arg()
src/Turbo/tests/Twig/TurboRuntimeTest.php Updated test mock to use base interface instead of deprecated one
src/Autocomplete/src/EntityAutocompleterInterface.php Uncommented getAttributes() and getGroupBy() method declarations
src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php Added getAttributes() implementation and removed BC layer for form option lookup
src/Autocomplete/src/AutocompleteResultsExecutor.php Removed method_exists() checks for getAttributes() and getGroupBy()
src/Autocomplete/src/Form/BaseEntityAutocompleteType.php Added additional_attributes form option with type validation
src/Turbo/CHANGELOG.md Documented removal of BC layer for $eventSourceOptions parameter
src/Autocomplete/CHANGELOG.md Documented removal of BC layers for interface methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

*/
public function isGranted(Security $security): bool;

/*
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getGroupBy() method should use PHPDoc comment syntax (/** and */) instead of block comment syntax (/* and */) to maintain consistency with other methods in the interface and to allow proper documentation generation.

Suggested change
/*
/**

Copilot uses AI. Check for mistakes.
return $attributesOption($entity);
}

return $attributesOption;
Copy link

Copilot AI Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getAttributes() method declares a return type of array (as per the interface), but this code path returns $attributesOption as-is when it's not null, not an array, and not callable. This could potentially return a non-array value, causing a type error. Consider either:

  1. Removing this fallback return and throwing an exception for invalid types, or
  2. Casting the value to an array (e.g., return (array) $attributesOption;)
Suggested change
return $attributesOption;
return (array) $attributesOption;

Copilot uses AI. Check for mistakes.
@Kocal Kocal force-pushed the uncomment-new-parameters-and-methods branch from a5cea09 to 0eb4a4c Compare November 22, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants