Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the codebase to PHP 8.1 #6747

Open
wants to merge 5 commits into
base: 5.1
Choose a base branch
from
Open

Conversation

TavoNiievez
Copy link
Member

I cherry-picked the commit from my other PR (#6746) to demonstrate that the tests run correctly.
I will delete it as soon as it is merged.

This PR should be merged with the Squash and merge strategy.

Comment on lines -195 to -201
private function absolutePath(string $path): string
{
if ((str_starts_with($path, '/')) or (strpos($path, ':') === 1)) { // absolute path
return $path;
}
return Configuration::outputDir() . $path;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this function since it seems that it is not used anywhere.

@TavoNiievez TavoNiievez marked this pull request as ready for review April 1, 2024 05:19
Copy link
Member

@Naktibalda Naktibalda left a comment

Choose a reason for hiding this comment

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

What version is it going to be? 5.2.0? 6.0.0?

I think that 5.1 branch should stay compatible with PHP 8.0 in cases there is some critical bug that must be fixed.

@@ -36,7 +36,7 @@ public function testFunctionForStrippingClassNames()
$matches = [];
$this->assertSame(1, preg_match('#\\\?(\w*?Helper)$#', '\\Codeception\\Module\\UserHelper', $matches));
$this->assertSame('UserHelper', $matches[1]);
$this->assertSame(1, preg_match('#\\\?(\w*?Helper)$#', 'UserHelper', $matches));
$this->assertSame(1, preg_match('#\\\?(\w*?Helper)$#', 'UserHelper', $matches));
Copy link
Member

Choose a reason for hiding this comment

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

must be an accident :)

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it was, well seen, thank you.

if (method_exists($this->filter->getFilter(), 'isExcluded')) {
//php-code-coverage 9+
$filterMethod = 'isExcluded';
Copy link
Member

Choose a reason for hiding this comment

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

getFilterMethod wrapper can be eliminated,
php-code-coverage 9.0 is used by PHPUnit ^9.3 and Codeception 5 has never supported anything older than 9.5.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@TavoNiievez
Copy link
Member Author

@Naktibalda In my PR for the command folder I also had to move the minimum version of Symfony to 5.4.

I don't plan to add any breaking changes, I'm just going to remove inconsistencies in the code where I find them or rewrite small pieces of code for some simpler or more modern alternative from a Symfony or PHP version point of view.
Considering this, it can be called 5.2
People who need Symfony 4.4 or PHP 8.0 can stay on Codeception 5.1 and those who can upgrade will do so without having to change anything in their code.

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.

None yet

2 participants