Skip to content
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

Call to undefined method ReflectionUnionType::getName() due to specifying return types not added in Interface #250

Open
bonteke opened this issue Feb 7, 2025 · 0 comments

Comments

@bonteke
Copy link

bonteke commented Feb 7, 2025

Description:
When running the Magento setup or DI compile command, the following error occurs due to specifying return types that were not added in the Interface of the class:

Call to undefined method ReflectionUnionType::getName()#0 /var/www/html/vendor/magento/framework/Interception/Code/Generator/Interceptor.php(105): Magento\Framework\Interception\Code\Generator\Interceptor->getReturnTypeValue(Object(ReflectionMethod))
#1 /var/www/html/vendor/magento/framework/Interception/Code/Generator/Interceptor.php(76): Magento\Framework\Interception\Code/Generator/Interceptor->_getMethodInfo(Object(ReflectionMethod))
#2 /var/www/html/vendor/magento/framework/Code/Generator/EntityAbstract.php(228): Magento\Framework\Interception\Code/Generator/Interceptor->_getClassMethods()
#3 /var/www/html/vendor/magento/framework/Interception/Code/Generator/Interceptor.php(177): Magento\Framework\Code/Generator/EntityAbstract->_generateCode()
#4 /var/www/html/vendor/magento/framework/Code/Generator/EntityAbstract.php(108): Magento\Framework\Interception/Code/Generator/Interceptor->_generateCode()
#5 /var/www/html/vendor/magento/framework/Code/Generator.php(133): Magento\Framework\Code/Generator/EntityAbstract->generate()
#6 /var/www/html/setup/src/Magento/Setup/Module/Di/Code/Generator.php(69): Magento\Framework\Code/Generator->generateClass('Tweakwise\\Magen...')
#7 /var/www/html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Interception.php(100): Magento\Setup\Module/Di/Code/Generator->generateList(Array)
#8 /var/www/html/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module/Di/App/Task/Operation/Interception->doOperation()
#9 /var/www/html/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module/Di/App/Task/Manager->process(Object(Closure), Object(Closure))
#10 /var/www/html/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console/Command/DiCompileCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/html/vendor/symfony/console/Application.php(1021): Symfony\Component\Console/Command/Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console/Application->doRunCommand(Object(Magento\Setup\Console/Command/DiCompileCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console/Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/vendor/symfony/console/Application.php(149): Magento\Framework\Console/Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/bin/magento(23): Symfony\Component\Console/Application->run()
#16 {main}

Steps to Reproduce:

  1. Run the Magento setup or DI compile command.
  2. Observe the error.

Expected Result:
The command should execute without errors.

Actual Result:
The command fails with the error mentioned above.

Additional Information:

  • Magento version: Adobe Commerce ver. 2.4.5-p8
  • PHP version: 8.1.27

Possible Solution:
Remove the return types from the methods in the class. File: vendor/tweakwise/magento2-tweakwise/Controller/Ajax/FacetAttributes.php

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

No branches or pull requests

1 participant