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

Enabling psalm on php >= 7.1, fixing #125, #168, #169, partially fixing #177 #190

Merged
merged 14 commits into from
Jan 20, 2020

Conversation

SignpostMarv
Copy link
Contributor

  • re: 210ac3c & da2e0c6, there's an @psalm-suppress or two in there rather than a baseline file because the older versions of psalm required for php < 7 consider the baseline attribute invalid so that'd be best put off until you make the decision to drop support for php 5 in a given release.
  • c504af2 only partially resolves Using polyfill for ext-intl if  #177 because the SpoofChecker class isn't polyfilled. The options there would be to find a polyfill just for SpoofChecker, or to fork out the SpoofCheckValidation class into a package that explicitly requires ext-intl:*
  • 6812a28 & 02a6193 were done for value-added giggles.

@egulias
Copy link
Owner

egulias commented Jan 20, 2019

Hi @SignpostMarv great PR, thanks. I'll take a deeper look into Psalm. However, I'm relying on Scrutinizer for static analysis and would like to know if it is worth to have both.

@SignpostMarv
Copy link
Contributor Author

SignpostMarv commented Jan 20, 2019

I've been using a combination of phpstan, psalm, and scrutinizer for quite a while now- my experience is that scrutinizer doesn't catch everything and that running static analysis on your local machine leads to a more rapid development cycle as you're not waiting for CI to spin up multiple instances & finish all the matrices. This leaves scrutinizer's main purpose down to tracking overall code quality & code coverage.

sebastian/phpcpd can be useful in identifying deduplication issues before they reach scrutinizer.

povils/phpmnd can help identify integers that should probably be consts.

maglnet/composer-require-checker checks if your code uses any php extensions or downstream code not explicitly required by the project.

edited to update
I've since changed my opinion regarding scrutinizer, leaning further towards scrutinizer being obsolete.

@k00ni
Copy link

k00ni commented Feb 25, 2019

When do you plan to merge this?

@SignpostMarv SignpostMarv force-pushed the tinkering branch 3 times, most recently from cf43861 to 601ca97 Compare September 1, 2019 10:59
@SignpostMarv SignpostMarv changed the title Enabling psalm on php >= 5.6, fixing #125, #168, #169, partially fixing #177 Enabling psalm on php >= 7.0, fixing #125, #168, #169, partially fixing #177 Sep 2, 2019
Copy link
Owner

@egulias egulias left a comment

Choose a reason for hiding this comment

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

Thanks for such a work @SignpostMarv and thanks for your patience.
I understand the value that psalm brings, however I have to make up my mind on adding so many comments for the sake of a tool.
Meanwhile I have left some comments and will make Codacy go green.

public function __construct()
{
if (!extension_loaded('intl')) {
if (!function_exists('idn_to_ascii')) {
throw new \LogicException(sprintf('The %s class requires the Intl extension.', __CLASS__));
Copy link
Owner

Choose a reason for hiding this comment

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

How does idn_to_ascii correlates to intl extension? Are they the same?
If so, please also update the error message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

symfony/polyfill-intl-idn will take over when the extension isn't loaded, thus the condition needs to check for the function used.

composer.json Outdated
"repositories": [
{
"type": "git",
"url": "https://github.com/dominicsayers/isemail"
Copy link
Owner

Choose a reason for hiding this comment

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

Why are you removing this? it is needed for the tests comparision :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as mentioned in the commit message, the package is listed on packagist & directly listing the repo causes install issues on windows & git bash.

@GrahamCampbell
Copy link
Contributor

This PR does a lot of different things, which makes it hard to merge. I think it should be broken up into more atomic pieces. Not all of the changes are still relevant now too.

@SignpostMarv
Copy link
Contributor Author

checking a rebase builds before splitting things off.

@egulias
Copy link
Owner

egulias commented Jan 5, 2020

@SignpostMarv apparently Psalm version you are requiring does not supports php 7.0 (https://travis-ci.org/egulias/EmailValidator/jobs/631128083?utm_medium=notification&utm_source=github_status)

@SignpostMarv
Copy link
Contributor Author

@SignpostMarv apparently Psalm version you are requiring does not supports php 7.0 (https://travis-ci.org/egulias/EmailValidator/jobs/631128083?utm_medium=notification&utm_source=github_status)

no version constraint is applied, so this may occasionally fail (necessitating an adjustment to the matrix as in 079ac0e)

@SignpostMarv SignpostMarv changed the title Enabling psalm on php >= 7.0, fixing #125, #168, #169, partially fixing #177 Enabling psalm on php >= 7.1, fixing #125, #168, #169, partially fixing #177 Jan 6, 2020
composer.json Outdated
},
"require-dev": {
"ext-intl": "*",
Copy link
Owner

Choose a reason for hiding this comment

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

Relates to #231 , since intl is still required for the spoof checker.
Maybe you can revert this change to avoid blocking this PR because of the INTL dependency fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

Answered. However, we can still remove this changes from the current PR in order to merge it and solve the INTL issue there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed in affd3dd

@egulias egulias merged commit e834eea into egulias:master Jan 20, 2020
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.

Using polyfill for ext-intl if
4 participants