Php 8 Compatibility Issue

Created on 28 March 2022, over 2 years ago
Updated 21 March 2023, over 1 year ago

Problem/Motivation

Php 8 is not supporting a required parameter after an optional one in method declaration and giving the below warnings in phpcs compatibility check

FILE: /var/www/docroot/sites/all/modules/contrib/admin_menu/tests/admin_menu.test
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------
51 | WARNING | Declaring a required parameter after an optional one is deprecated since PHP 8.0. Parameter
   |         | $arguments is optional, while parameter $message is required.
72 | WARNING | Declaring a required parameter after an optional one is deprecated since PHP 8.0. Parameter
   |         | $arguments is optional, while parameter $message is required.
---------------------------------------------------------------------------------------------------------------

Proposed resolution

Proposing the attached patch to fix the issue

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States suvasish.manna

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024