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: 10MBSteps to reproduce
Run phpcs in the module.
Proposed resolution
Fix them all.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork entity_delete-3258060
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
Comment #2
anagomes commentedComment #4
anagomes commentedFor anyone who is going to review this MR, running phpcs will still show warnings about dependency injections, but those are being handled in [#3258058].
Comment #5
tmaiochi commentedComment #6
tmaiochi commentedHi @anagomes. All code standards was fixed, but when I was testing I received an error like:
So you need to fix this before merge the branch.
Comment #7
anagomes commentedComment #8
anagomes commentedThanks @tmaiochi!
Comment #9
baikho commentedComment #10
beatrizrodriguesi will do the review
Comment #11
beatrizrodriguesWhen 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
-----------------------------------------------------------------------------------------------------------------------------------------
Comment #12
anagomes commentedComment #13
anagomes commentedThanks @beatrizrodrigues, I fixed the warning.
Comment #14
victoria-marina commentedComment #15
victoria-marina commentedAfter 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.
Comment #16
anagomes commentedComment #17
anagomes commentedComment #18
baikho commentedComment #19
anagomes commentedComment #20
j-barnes commented@anagomes
Confirmed it is now deleting entities with the latest commit, PHPCS also shows that everything is Drupal Standard.
Comment #22
baikho commented