This PR was merged into the 7.4 branch.
Discussion
----------
[Console] Fix profile invokable command
| Q | A
| ------------- | ---
| Branch? | 7.4
| Bug fix? | yes
| New feature? | no <!-- if yes, also update src/**/CHANGELOG.md -->
| Deprecations? | no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md -->
| Issues | Fix #... <!-- prefix each issue number with "Fix #"; no need to create an issue if none exists, explain below -->
| License | MIT
Hello,
I noticed that, when I try to profile an invokable command on 7.4, it raise the following exception :
```
[critical] Uncaught Error: ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, App\Command\MyAwesomeCommand given
TypeError {#199
#message: "ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, App\Command\MyAwesomeCommand given"
#code: 0
#file: "./vendor/symfony/console/Command/TraceableCommand.php"
#line: 172
trace: {
./vendor/symfony/console/Command/TraceableCommand.php:172 { …}
./vendor/symfony/console/Command/TraceableCommand.php:71 { …}
./vendor/symfony/framework-bundle/Console/Application.php:115 { …}
./vendor/symfony/console/Application.php:356 { …}
./vendor/symfony/framework-bundle/Console/Application.php:77 { …}
./vendor/symfony/console/Application.php:195 { …}
./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49 { …}
./vendor/autoload_runtime.php:32 { …}
./bin/console:15 {
```
The invokableCommand class changed, the code attribute doesn't longer contains the closure to code.
Let's use the $invokableCommand->invokable instead that contains the reflectionFunction needed.
Commits
-------
|
||
|---|---|---|
| .github | ||
| src/Symfony | ||
| .editorconfig | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .php-cs-fixer.dist.php | ||
| .twig-cs-fixer.dist.php | ||
| CHANGELOG-7.0.md | ||
| CHANGELOG-7.1.md | ||
| CHANGELOG-7.2.md | ||
| CHANGELOG-7.3.md | ||
| CHANGELOG-7.4.md | ||
| CODE_OF_CONDUCT.md | ||
| composer.json | ||
| CONTRIBUTING.md | ||
| CONTRIBUTORS.md | ||
| LICENSE | ||
| link | ||
| phpunit | ||
| phpunit.xml.dist | ||
| psalm.xml | ||
| README.md | ||
| UPGRADE-7.0.md | ||
| UPGRADE-7.1.md | ||
| UPGRADE-7.2.md | ||
| UPGRADE-7.3.md | ||
| UPGRADE-7.4.md | ||
Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Symfony is used by thousands of web applications and most of the popular PHP projects.
Installation
- Install Symfony with Composer (see requirements details).
- Symfony follows the semantic versioning strictly, publishes "Long Term Support" (LTS) versions and has a release process that is predictable and business-friendly.
Sponsor
Symfony 7.4 is backed by:
As the creator of Symfony, SensioLabs supports companies using Symfony, with an offering encompassing consultancy, expertise, services, training, and technical assistance to ensure the success of web application development projects.
Private Packagist is a fast, reliable, and secure Composer repository for your private packages. It mirrors all your open-source dependencies for better availability and monitors them for security vulnerabilities.
redirection.io logs all your website’s HTTP traffic, and lets you fix errors with redirect rules in seconds. Give your marketing, SEO and IT teams the right tool to manage your website traffic efficiently!
JoliCode is a team of passionate developers and open-source lovers, with a strong expertise in PHP & Symfony technologies. They can help you build your projects using state-of-the-art practices.
Help Symfony by sponsoring its development!
Documentation
- Read the Getting Started guide if you are new to Symfony.
- Try the Symfony Demo application to learn Symfony in practice.
- Discover Symfony ecosystem in detail with Symfony The Fast Track.
- Master Symfony with the Guides and Tutorials, the Components docs and the Best Practices reference.
Community
- Join the Symfony Community and meet other members at the Symfony events.
- Get Symfony support on GitHub Discussions, Slack, etc.
- Follow us on GitHub, Twitter and Facebook.
- Read our Code of Conduct and meet the CARE Team.
Contributing
Symfony is an Open Source, community-driven project with thousands of contributors. Join them contributing code or contributing documentation.
Security Issues
If you discover a security vulnerability within Symfony, please follow our disclosure procedure.
About Us
Symfony development is led by the Symfony Core Team and supported by Symfony contributors.