Fix use of ConstraintViolation instead of ConstraintViolationInterface in CKEditor5 tests

Created on 10 September 2024, 3 months ago

Problem/Motivation

The CKEditor5::validatePair method returns a ConstraintViolationListInterface object, which is a collection of ConstraintViolationInterface. This method is used many times in tests and passed to a typed callback function which expects the more specific ConstraintViolation.

To resolve 📌 Fix strict type errors detected by phpstan Active we need to loosen the param type to ConstraintViolationInterface.

Steps to reproduce

Add to phpstan.neon.dist:

parameters:
  checkFunctionArgumentTypes: true

Run phpstan

Grep output for something like this:
grep "ConstraintViolation" output.txt

Proposed resolution

Update param type to ConstraintViolationInterface, or better yet, see if we can introduce a trait that avoids the reuse.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

RTBC

Version

11.0 🔥

Component
CKEditor 5 

Last updated 1 day ago

Created by

🇦🇺Australia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024