Skip to content

Wrong version in new release#1506

Closed
MarcelloDuarte wants to merge 2 commits intophpspec:mainfrom
MarcelloDuarte:fix-wrong-version
Closed

Wrong version in new release#1506
MarcelloDuarte wants to merge 2 commits intophpspec:mainfrom
MarcelloDuarte:fix-wrong-version

Conversation

@MarcelloDuarte
Copy link
Copy Markdown
Member

Fixes #1504

cc @theofidry

Comment on lines +71 to +74
$this->addCommand($command);
} else {
$this->add($command);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this part should be resolved here and should not be a part of this PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my part, I feel that the current proposal is the right approach. Simply replacing it with addCommand would risk breaking compatibility with Symfony 5.4, 6.x, and 7.x.

Using if (method_exists()) seems appropriate to me to ensure backward compatibility between versions. Alternatively, we could use addCommands([$command]), which is available everywhere, even if it is indeed a little less elegant. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @roukmoute for his solution to support more symfony versions.
But i think it should be moved to a seperate PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: It is already merged in a sperate PR. Looks like addCommand() is supported since 5.4 accoring to test-runs.

@roukmoute
Copy link
Copy Markdown

Hello @stof, would you have a moment to take a look at this PR :) ?

@torchello torchello mentioned this pull request Jan 24, 2026
@torchello
Copy link
Copy Markdown
Contributor

Fixed in #1509

@torchello torchello closed this Jan 24, 2026
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.

The PhpSpec PHAR version is incorrect

5 participants