Skip to content

Symfony 7.0 support and refactoring #240

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

Merged
merged 5 commits into from
Jun 6, 2024
Merged

Conversation

michnovka
Copy link
Contributor

Strong typed everything. Symfony 7 support. Dropped Symfony 5 support. Bump min PHP version to 8.0.2. Minor logic fixes. Migrate to new ECS version.

…. Bump min PHP version to 8.0.2. Minor logic fixes. Migrate to new ECS version.
Copy link
Contributor Author

@michnovka michnovka left a comment

Choose a reason for hiding this comment

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

Please review my explanation for some of the controversial changes

@@ -74,7 +62,7 @@ public function saveAsFile($contents): string

public function collectGarbage(): bool
{
if (1 == !mt_rand(1, $this->gcFreq)) {
if (1 != mt_rand(1, $this->gcFreq)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Gregwar I think this had to be a long-time bug in the code, as the old code would be ALWAYS false. Hence the garbage collection was running EVERY SINGLE TIME. But check, maybe I didnt understant properly

Copy link

Choose a reason for hiding this comment

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

I think you should use strict comparison here

Suggested change
if (1 != mt_rand(1, $this->gcFreq)) {
if (1 !== mt_rand(1, $this->gcFreq)) {

ecs.php Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was unable to port completely all ECS rules from the old YAML file (dropped support for YAML was with ECS 9). But I did copy most of them. Some are even discontinued now. The ECS <=7 did not support PHP 8, so I had to update it

},
{
"name": "Jeremy Livingston",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.1.3",
"php": ">=8.0.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the PHP version required by Symfony 6.0

"symfony/form": "~5.0|~6.0",
"symfony/framework-bundle": "~5.0|~6.0",
"symfony/translation": "~5.0|^6.0",
"twig/twig": "^2.10|^3.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

twig 2.x is EOL as of Dec 2023

Choose a reason for hiding this comment

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

I would even force Symfony 6.0 to 6.4, as it will be the only supported in ~6

@michnovka
Copy link
Contributor Author

@Gregwar can you please review this? We are stuck with symfony 6.x just because of this package. thanks!

@Gregwar Gregwar merged commit 8eb95c0 into Gregwar:master Jun 6, 2024
@Gregwar
Copy link
Owner

Gregwar commented Jun 6, 2024

Sounds good to me, thanks for contributing
I tagged v2.2.1

@michnovka can you confirm me everything it's ok ?

@ajgarlag
Copy link

ajgarlag commented Jun 6, 2024

@Gregwar The v2.2.1 tag conflicts with the README.md compatibility table. The PR expects the new version to be tagged as v2.3.0

@Gregwar
Copy link
Owner

Gregwar commented Jun 7, 2024

@ajgarlag I deleted v2.2.1 and re-tagged v2.3.0

@blankse
Copy link

blankse commented Jun 7, 2024

@Gregwar Do you maintain this repository again?

It would be nice to have #241 in a release.

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.

5 participants