Skip to content

AC-2192: deprecations fix - #133

Open
Okspen wants to merge 3 commits into
paysera:masterfrom
Okspen:AC-2192-deprecation-fix
Open

AC-2192: deprecations fix#133
Okspen wants to merge 3 commits into
paysera:masterfrom
Okspen:AC-2192-deprecation-fix

Conversation

@Okspen

@Okspen Okspen commented Jun 1, 2026

Copy link
Copy Markdown

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors several Twig extensions and console commands to use namespaced Twig classes (such as AbstractExtension, TwigFilter, TwigFunction, TwigTest, and Environment) instead of deprecated legacy ones. Feedback on these changes highlights critical runtime issues, including a missing import for UnrecognizedTypeException in FieldDefinitionExtension, and references to non-existent methods (extractTypeName and getInlineArgumentNames) in FieldDefinitionExtension and ApiMethodExtension respectively.

Comment on lines +11 to +12
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The class UnrecognizedTypeException is thrown on line 61 of this file, but it is not imported. This will cause a runtime fatal error when the exception is thrown. Please import the class.

use Paysera\\Bundle\\CodeGeneratorBundle\\Exception\\UnrecognizedTypeException;\nuse Twig\\Extension\\AbstractExtension;\nuse Twig\\TwigFunction;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed

Comment thread src/Paysera/Bundle/JavascriptGeneratorBundle/Twig/FieldDefinitionExtension.php Outdated
new TwigFunction('php_inline_arguments_no_typehint', [$this, 'inlineArgumentsNoTypehint']),
new TwigFunction('php_get_return_type', [$this, 'getReturnType'], ['needs_context' => true]),
new TwigFunction('php_generate_method_arguments', [$this, 'generateMethodArguments'], ['needs_context' => true]),
new TwigFunction('php_inline_argument_names', [$this, 'getInlineArgumentNames']),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The method getInlineArgumentNames is not defined in ApiMethodExtension. Calling the Twig function php_inline_argument_names will result in a runtime error. Please implement the missing method or verify if inlineArgumentsNoTypehint should be used instead.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed

@Okspen
Okspen force-pushed the AC-2192-deprecation-fix branch from 0b7489f to cdc913d Compare June 1, 2026 10:45
@Okspen
Okspen force-pushed the AC-2192-deprecation-fix branch from 6bd9ead to 6e0e42c Compare June 1, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant