Problem/Motivation

Running PHPCS in the module I figured out that there are several sniff violations that needs to be fixed in order to achieve Drupal's best practices in code standards.

Steps to reproduce

1. Run phpcs in the file src/Plugin/Block/WeMegaMenuBlock.php:

phpcs --standard=Drupal,DrupalPractice --extensions=php

Proposed resolution

Fix the indicated errors in the command output.

Remaining tasks

User interface changes

API changes

Data model changes

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

gabrielda created an issue. See original summary.

gabrielda’s picture

I will work on this today

gabrielda’s picture

Assigned: gabrielda » Unassigned
Status: Active » Needs review
beatrizrodrigues’s picture

Status: Needs review » Needs work

So, i did the review and when run phpcs command it not return any errors although it returns me a warning about use dependency injection. I don't know if it is a case of open another issue for this, or it must be resolved on that. I'll assume the second case and change to needs work, but if there is no need of that dependency injection being resolved in that issue, someone can tell me and I change to RTBC (or someone can change yourself).

vicheldt’s picture

I think the dependency injection warning should be another issue, it's not related to the code pattern, but there's no other issue open on this specific case. Thoughts?

lucienchalom’s picture

Assigned: Unassigned » lucienchalom

I'll try to work on the Dependency Injection.

lucienchalom’s picture

Assigned: lucienchalom » Unassigned
Status: Needs work » Needs review

I did the last dependency injection and the
phpcs --standard=Drupal,DrupalPractice --extensions=php
returns clean.
I had to implement the ContainerFactoryPluginInterface as no parent for the BlockBase implements it.

Thank you

Matheus Macario’s picture

Assigned: Unassigned » Matheus Macario
Matheus Macario’s picture

Assigned: Matheus Macario » Unassigned
Status: Needs review » Reviewed & tested by the community

I did the review and these were the steps performed :
- Installed module
- Code review on changes made on the commit (2076f7ae - 3247954- fixing DI)
- reviewed again, and nothing wrong was found.

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

  • rjjakes committed 1a008574 on 8.x-1.x authored by gabrielda
    Issue #3247954 by gabrielda, lucienchalom, Matheus Macario, vicheldt,...
rjjakes’s picture

Status: Reviewed & tested by the community » Fixed

Merged to 8.x-1.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.