Add strict typing for Layout Builder Restrictions

Created on 3 January 2024, 12 months ago
Updated 9 July 2024, 5 months ago

Problem/Motivation

Per https://www.drupal.org/project/drupal/releases/10.2.0: β†’

Drupal core automated tests and test APIs are being converted to require strict typing in all cases. So far, Drupal core test traits, build tests, and functional JavaScript tests all require strict typing. Going forward, all Drupal core tests will require strict typing. It is recommended that contributed and custom projects use the Drupal standard for strict type declaration.

Proposed resolution

1. Add strict type checking following the coding standard defined in https://www.drupal.org/node/3402544 β†’ to all PHPUnit test files.
2. Run the tests. If any fail due to this new martinet, rework the code in the module to properly provide strict typing. This usually will mean that variables in PHP classes need to have type hints. A multitude of examples of these types of fixes can be found by reviewing the code changes in issues linked to from πŸ“Œ Add declare(strict_types=1) to all tests Needs work . A more bite-sized model can be found in πŸ“Œ declare strict_types in Pathologic Needs work .

This module uses Gitlab CI for automated testing of proposed code changes. To contribute code changes, create a merge request. Patch files will not trigger automated testing and are not sufficient for review.
πŸ“Œ Task
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

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