Skip to content

Commit

Permalink
Add command to services.yaml file (#131)
Browse files Browse the repository at this point in the history
The symfony console first tries to load the command name [from the
service-definition][1], if this fails it loads the command name via the
[getDefaultName() method][2], which does not work sometimes. We saw this
error lately in our logs:

```
[file /var/www/html/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php]
[message Uncaught Error: Call to undefined method OxidCommunity\ModuleInternals\Command\ModuleFixCommand::getDefaultName()
in /var/www/html/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php:61
[...]
```

[1]: https://github.com/symfony/console/blob/v3.4.15/DependencyInjection/AddConsoleCommandPass.php#L47-L53
[2]: https://github.com/symfony/console/blob/v3.4.15/DependencyInjection/AddConsoleCommandPass.php#L61
  • Loading branch information
alfredbez authored May 7, 2020
1 parent 76aae8a commit c6fbf2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ services:
oxid_community.moduleinternals.module.fix.command:
class: OxidCommunity\ModuleInternals\Command\ModuleFixCommand
tags:
- { name: 'console.command' }
- { name: 'console.command', command: 'module:fix', description: 'Fixes modules metadata states'}

0 comments on commit c6fbf2e

Please sign in to comment.