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

feat: drop support for PHP < 8.1 #52

Merged

Conversation

Chris53897
Copy link
Contributor

#51

This is the minimal work to drop support for PHP < 8.1

@loevgaard
Copy link
Member

Can you make this build or can you allow the static analysis to continue on error so that we can see the static analysis will be green for lower PHP versions than 8.4?

@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

@loevgaard we need to update the vimeo/psalm dependency to minimum 5.24.0
because of this commit: vimeo/psalm@431977c

@loevgaard
Copy link
Member

Okay, that's a problem because I have added that version as a conflict in the setono/code-quality-pack library. It would be okay for me if you removed the setono/code-quality-pack and added Psalm into require-dev.

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 98.62%. Comparing base (3f608de) to head (bf99626).

Files with missing lines Patch % Lines
src/Doctrine/DBAL/Types/CronExpressionType.php 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #52   +/-   ##
=========================================
  Coverage     98.62%   98.62%           
  Complexity       77       77           
=========================================
  Files             9        9           
  Lines           291      291           
=========================================
  Hits            287      287           
  Misses            4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Chris53897
Copy link
Contributor Author

Can the failing Static Code Analysis error be fixed in a follow up PR?
I do not know how to fix them at the moment.

@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

Can the failing Static Code Analysis error be fixed in a follow up PR? I do not know how to fix them at the moment.

Yeah, the Missing Template Param is already on my Radar

@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

@Chris53897

As for the MissingTemplateParam:

CronExpressionToPartsTransformer needs:

/**
 * @template-implements DataTransformerInterface<CronExpression, array<int>>
 */

CronExpressionToStringPartsTransformer needs:

/**
 * @template-implements DataTransformerInterface<CronExpression, array<string>>
 */

CronExpressionToStringTransformer needs:

/**
 * @template-implements DataTransformerInterface<CronExpression, string>
 */

CronExpressionTest needs:

/**
 * @template-implements ConstraintValidatorTestCase<CronExpressionValidator>
 */

FormCallbackTest needs:

/**
 * @template-implements ConstraintValidatorTestCase<CallbackValidator>
 */

@Chris53897
Copy link
Contributor Author

@Hanmac Thanks. I made your changes. But i still got errors

I would suggest to merge this at it is. And make Psalm happy in a follow up PR

@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

arg the template params are tricky :(

symfony 6+ wants template params
symfony 5+ doesn't want template params

also i manually run the symfony6 tests:

Error: src/Form/DataTransformer/CronExpressionToPartsTransformer.php:20:40: LessSpecificImplementedReturnType: The inherited return type 'array<array-key, int>|null' for Symfony\Component\Form\DataTransformerInterface::transform is more specific than the implemented return type for Setono\CronExpressionBundle\Form\DataTransformer\CronExpressionToPartsTransformer::transform 'array<array-key, mixed>' (see https://psalm.dev/166)
Error: src/Form/DataTransformer/CronExpressionToStringPartsTransformer.php:20:40: LessSpecificImplementedReturnType: The inherited return type 'array<array-key, string>|null' for Symfony\Component\Form\DataTransformerInterface::transform is more specific than the implemented return type for Setono\CronExpressionBundle\Form\DataTransformer\CronExpressionToStringPartsTransformer::transform 'array<array-key, mixed>' (see https://psalm.dev/166)

@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

The Tests need @template-extends instead of template-implements

@Chris53897
Copy link
Contributor Author

Chris53897 commented Oct 23, 2024

I think the solution is to just run psalm on one specific test-run. Not for every combination.
Like PHP 8.3 and Smyfony 7.1 as highest.

@loevgaard WDYT?

@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

@loevgaard @Chris53897 finally! All Green again!

@loevgaard
Copy link
Member

Good job! You can just merge when you find it acceptable, @Hanmac :-)

@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

@loevgaard it says "Review required", so you need to give your 👍, and might merge-squash yourself

@loevgaard
Copy link
Member

I think you can review and merge, can't you? :)

@Hanmac Hanmac merged commit cb8a015 into Setono:master Oct 23, 2024
26 checks passed
@Hanmac
Copy link
Collaborator

Hanmac commented Oct 23, 2024

it works when I am not the one that created the issue

@loevgaard
Copy link
Member

Yeah! Great! Thanks 🎉

@Chris53897 Chris53897 deleted the feature/drop-support-for-old-php-versions branch October 23, 2024 12:13
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.

4 participants