Skip to content

Strict type hint issue: mixed is not supported #28

@matks

Description

@matks

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions