Fix the issues reported by phpcs

Issue information

From user: omkar_yewale

Related to !5 (merged)

Contribution record

Fork management

Problem/Motivation

Getting the following errors/warnings.

FILE: /link_attributes/src/Plugin/Field/FieldWidget/LinkWithAttributesWidget.php
---------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------
  94 | ERROR | [x] Use null coalesce operator instead of ternary operator.
114 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------

FILE: /link_attributes/src/LinkAttributesManager.php
---------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 4 LINES
---------------------------------------------------------------------------------
66 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
66 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
67 | ERROR   | [x] Expected 1 space after FOREACH keyword; 0 found
67 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
68 | WARNING | [ ] Only string literals should be passed to t() where possible
70 | ERROR   | [x] Whitespace found at end of line
----------------------------------------------------------------------------------

Steps to reproduce

Run the following command

phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml link_attributes

Proposed resolution

The above errors/warnings need to be fixed.

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information