Skip to content

Conversation

@vicb
Copy link
Contributor

@vicb vicb commented Mar 8, 2011

No description provided.

SofHad pushed a commit to SofHad/symfony that referenced this pull request Oct 12, 2015
…kovich)

This PR was squashed before being merged into the master branch (closes symfony#199).

Discussion
----------

Redirect a client to an appropriate locale

A simple example of how to use the event listeners

Commits
-------

1386c2c Redirect a client to an appropriate locale
SofHad pushed a commit to SofHad/symfony that referenced this pull request Oct 12, 2015
…e listener (javiereguiluz)

This PR was squashed before being merged into the master branch (closes symfony#209).

Discussion
----------

Simplified the code of the RedirectToPreferredLocale listener

Some minor changes after the merge of symfony#199.

@voronkovich could you please review that this simplifications don't break your code? Thanks!

Commits
-------

5dc5e33 Simplified the code of the RedirectToPreferredLocale listener
fabpot added a commit that referenced this pull request Nov 29, 2025
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
-------

4643bf1 [Console] Fix profile invokable command
This pull request was closed.
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