Skip to content

Fix MakeAbilityCommand::getDefaultNamespace signature incompatibility#4

Merged
retlehs merged 1 commit intomainfrom
fix/make-ability-command-namespace
Feb 27, 2026
Merged

Fix MakeAbilityCommand::getDefaultNamespace signature incompatibility#4
retlehs merged 1 commit intomainfrom
fix/make-ability-command-namespace

Conversation

@retlehs
Copy link
Member

@retlehs retlehs commented Feb 27, 2026

Closes #3

Problem

MakeAbilityCommand::getDefaultNamespace declares a string type on the $rootNamespace parameter, but the parent Illuminate\Console\GeneratorCommand::getDefaultNamespace has no type hint. In PHP 8, adding a parameter type in a subclass is a covariance violation, resulting in:

Fatal error: Declaration of Roots\AcornAi\Console\Commands\MakeAbilityCommand::getDefaultNamespace(string $rootNamespace): string must be compatible with Illuminate\Console\GeneratorCommand::getDefaultNamespace($rootNamespace)

Fix

Remove the string type hint from the $rootNamespace parameter to match the parent signature. The return type string is kept as PHP allows narrowing return types in subclasses.

🤖 Generated with Claude Code

Remove the `string` type hint from the $rootNamespace parameter to match
the untyped parent GeneratorCommand::getDefaultNamespace($rootNamespace)
signature, resolving the fatal declaration compatibility error in PHP 8.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@retlehs retlehs merged commit 1698e39 into main Feb 27, 2026
1 check passed
@retlehs retlehs deleted the fix/make-ability-command-namespace branch February 27, 2026 14:53
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.

Error when trying to vendor:publish

1 participant