Skip to content

Strict type hint issue: mixed is not supported #28

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

Open
matks opened this issue May 4, 2021 · 0 comments
Open

Strict type hint issue: mixed is not supported #28

matks opened this issue May 4, 2021 · 0 comments

Comments

@matks
Copy link
Collaborator

matks commented May 4, 2021

When phpstan-prestashop analyzes https://github.com/PrestaShop/PrestaShop/blob/develop/src/Core/ConstraintValidator/NoTagsValidator.php

It is output


 ------ -----------------------------------------------------------------------------------------
  Line   src/Core/ConstraintValidator/NoTagsValidator.php
 ------ -----------------------------------------------------------------------------------------
  45     Every parameter of function validate should be type hinted (untyped parameters: value).
 ------ -----------------------------------------------------------------------------------------

The issue is that $value is of type mixed. PHPStan can acknowledge this type if PHPDoc is used

    /**
     * @param mixed $value
     * @param Constraint $constraint
     */
    public function validate($value, Constraint $constraint): void

But the extension phpstan-prestashop does not acknowledge the PHPDoc.

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 a pull request may close this issue.

1 participant