Use null coalesce operator instead of ternary operator

Created on 28 October 2022, almost 3 years ago
Updated 2 September 2025, 11 days ago

Problem/Motivation

Many files from module shows the error "Use null coalesce operator instead of ternary operator" when verifying code standards with PHPCS.

Steps to reproduce

Run the following command at module folder:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,md,yml *

Proposed resolution

Change the code to use coalesce operator.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇷Brazil adaucyj Irupi, ES

Live updates comments and jobs are added and updated live.
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