Problem/Motivation

FILE: src/Form/EntityDeleteConfirmationForm.php
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------
  13 | WARNING | The class short comment should describe what the class does and not simply repeat the class
     |         | name
-------------------------------------------------------------------------------------------------------------


FILE: src/Form/EntityDeleteForm.php
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------
  17 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the
     |         |     class name
  81 | WARNING | [ ] t() calls should be avoided in classes, use
     |         |     \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  87 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------


FILE: src/DeleteEntity.php
-------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------
 26 | ERROR | PHP4 style constructors are not allowed; use "__construct()" instead
 27 | ERROR | The array declaration extends to column 133 (the limit is 80). The array content should be
    |       | split up over multiple lines
 47 | ERROR | The array declaration extends to column 124 (the limit is 80). The array content should be
    |       | split up over multiple lines
-------------------------------------------------------------------------------------------------------------

Time: 147ms; Memory: 10MB

Steps to reproduce

Run phpcs in the module.

Proposed resolution

Fix them all.

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

hmendes created an issue. See original summary.

anagomes’s picture

Assigned: Unassigned » anagomes

anagomes’s picture

Assigned: anagomes » Unassigned
Status: Active » Needs review

For anyone who is going to review this MR, running phpcs will still show warnings about dependency injections, but those are being handled in [#3258058].

tmaiochi’s picture

Assigned: Unassigned » tmaiochi
tmaiochi’s picture

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

Hi @anagomes. All code standards was fixed, but when I was testing I received an error like:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=17&op=do_nojs&op=do
StatusText: OK
ResponseText: Fatal error: Constructor Drupal\entity_delete\DeleteEntity::__construct() cannot be static in /app/web/modules/contrib/entity_delete/src/DeleteEntity.php on line 8

So you need to fix this before merge the branch.

anagomes’s picture

Assigned: Unassigned » anagomes
anagomes’s picture

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

Thanks @tmaiochi!

baikho’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues

i will do the review

beatrizrodrigues’s picture

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

When I run phpcs still 1 problem to me:

FILE: entity_delete/src/DeleteEntity.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
27 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

anagomes’s picture

Assigned: Unassigned » anagomes
anagomes’s picture

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

Thanks @beatrizrodrigues, I fixed the warning.

victoria-marina’s picture

Assigned: Unassigned » victoria-marina
victoria-marina’s picture

Assigned: victoria-marina » Unassigned
Status: Needs review » Needs work

After the MR all the phpcs errors were gone, but when I tried to use the module, I've had this error:

Error: Call to undefined function Drupal\entity_delete\drupal_set_message() in Drupal\entity_delete\DeleteEntity::deleteEntityFinishedCallback() (line 70 of /app/web/modules/contrib/entity_delete/src/DeleteEntity.php)
#0 /app/web/core/includes/batch.inc(456): Drupal\entity_delete\DeleteEntity::deleteEntityFinishedCallback(true, Array, Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup))
#1 /app/web/core/includes/batch.inc(98): _batch_finished()
#2 /app/web/core/modules/system/src/Controller/BatchController.php(55): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#3 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request))
#4 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#5 /app/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#6 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#7 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#8 /app/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#9 /app/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#10 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /app/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#19 {main}

Before the MR, this error wasn't showing.

anagomes’s picture

Assigned: Unassigned » anagomes
anagomes’s picture

Assigned: anagomes » Unassigned
Status: Needs work » Needs review
baikho’s picture

Status: Needs review » Needs work
anagomes’s picture

Status: Needs work » Needs review
j-barnes’s picture

@anagomes

Confirmed it is now deleting entities with the latest commit, PHPCS also shows that everything is Drupal Standard.

  • baikho committed 56e7f27 on 2.0.x authored by anagomes
    Issue #3258060: Fix coding standards problems in this module
    
baikho’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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