Running phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme modules/custom/codesnippet/ shows the following warnings/errors, which should be fixed.

FILE: src/Plugin/CKEditorPlugin/CodeSnippet.php
------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------
 74 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 79 | WARNING | [ ] t() calls should be avoided in classes, use
    |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 95 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jay Jangid created an issue. See original summary.

jay jangid’s picture

Assigned: jay jangid » Unassigned
Status: Active » Needs review

Created MR , please review.

Thank you.

avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by PHP_CodeSniffer
Category: Bug report » Task
Status: Needs review » Needs work
Issue tags: +Needs reroll

It would be better to apply both the PHP_CodeSniffer Drupal rulesets, instead of using just one.

Ashutosh Ahirwal made their first commit to this issue’s fork.

ashutosh ahirwal’s picture

Status: Needs work » Needs review
Issue tags: +Coding standards

Updated MR7 with some fixes.
Error found in readme can't update because its a function.

avpaderno’s picture

Status: Needs review » Needs work

The README.txt file has been updated in the project branch. The MR needs to be updated.

avpaderno’s picture

Issue summary: View changes

sakthi_dev made their first commit to this issue’s fork.

sakthi_dev’s picture

Status: Needs work » Needs review

Please review. Updated the MR by rebase.

avpaderno’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll
sakthi_dev’s picture

Status: Needs work » Needs review

Addressed comments in MR. Please review.

nikolay shapovalov’s picture

Issue summary: View changes

Update IS, add latest phpcs report.

nikolay shapovalov’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good.
Mark this as RTBC.