Skip to content

Fixed accessing non-interface methods in StructWrapperValidator#750

Merged
alongosz merged 1 commit into
4.6from
fix-accessing-constraint-methods-struct-wrapper-validator
May 11, 2026
Merged

Fixed accessing non-interface methods in StructWrapperValidator#750
alongosz merged 1 commit into
4.6from
fix-accessing-constraint-methods-struct-wrapper-validator

Conversation

@alongosz

@alongosz alongosz commented May 11, 2026

Copy link
Copy Markdown
Member
🎫 Issue n/a

Description:

Seems like PHPStan after the latest release started detecting 2 new issues:

 ------ -------------------------------------------------------------------------------------------------------- 
  Line   src/contracts/Validation/StructWrapperValidator.php                                                     
 ------ -------------------------------------------------------------------------------------------------------- 
  65     Call to an undefined method Symfony\Component\Validator\ConstraintViolationInterface::getConstraint().  
         🪪  method.notFound                                                                                     
  66     Call to an undefined method Symfony\Component\Validator\ConstraintViolationInterface::getCause().       
         🪪  method.notFound                                                                                     
 ------ --------------------------------------------------------------------------------------------------------

The report is valid, as neither getConstraint nor getCause method exist on ConstraintViolationInterface. The methods appeared on the contract in further Symfony version (the issue doesn't exist on 5.0 branch).

For QA:

No QA required.

Documentation:

No documentation required.

@sonarqubecloud

Copy link
Copy Markdown

@alongosz
alongosz merged commit 719d1bf into 4.6 May 11, 2026
49 checks passed
@alongosz
alongosz deleted the fix-accessing-constraint-methods-struct-wrapper-validator branch May 11, 2026 15:06
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