- Issue created by @Shanu Chouhan
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 8:20am 22 May 2023 - Status changed to Needs work
over 1 year ago 12:48pm 23 May 2023 - 🇵🇭Philippines kenyoOwen
Hi Shanu Chouhan
I applied patch#2 and confirmed that phpcs mentioned is fixed except for the info.yml issues. Please see the screenshots attached.
For your review.
Thank you. - Assigned to imustakim
- 🇮🇹Italy apaderno Brescia, 🇮🇹
To make the previous comment more explicit, the following change is not correct.
- - commerce + - drupal:commerce
The Commerce Core → module is not a Drupal core module.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 3:23pm 23 May 2023 - 🇨🇦Canada imustakim Canada
Patch updated.
These errors are showing up because the constructor description including the class namespace, assuming this can be ignored.
Please review.❯ phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js . FILE: /Users/specbee/Sites/Projects/commerce_order_document/src/Form/OrderDocumentForm.php ------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------ 35 | WARNING | Line exceeds 80 characters; contains 84 characters ------------------------------------------------------------------------------------------ FILE: /Users/specbee/Sites/Projects/commerce_order_document/src/Form/OrderDocumentsForm.php ------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------- 40 | WARNING | Line exceeds 80 characters; contains 85 characters ------------------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/commerce_order_document/src/Plugin/Commerce/OrderDocument/OrderDocumentBase.php ------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------- 103 | WARNING | Line exceeds 80 characters; contains 109 characters ------------------------------------------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/commerce_order_document/src/OrderDocumentStorage.php ---------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------------------------- 30 | WARNING | Line exceeds 80 characters; contains 81 characters ---------------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/commerce_order_document/src/OrderDocumentManager.php ---------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ---------------------------------------------------------------------------------------- 19 | WARNING | Line exceeds 80 characters; contains 81 characters ---------------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/commerce_order_document/src/EventSubscriber/OrderEventEmailSubscriber.php ------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------- 22 | WARNING | Line exceeds 80 characters; contains 100 characters ------------------------------------------------------------------------------------------------------------- FILE: /Users/specbee/Sites/Projects/commerce_order_document/src/Event/FilterOrderDocumentsEvent.php --------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE --------------------------------------------------------------------------------------------------- 30 | WARNING | Line exceeds 80 characters; contains 93 characters --------------------------------------------------------------------------------------------------- Time: 461ms; Memory: 12MB
- Status changed to Needs work
over 1 year ago 3:26pm 14 June 2023 - 🇺🇸United States lisastreeter
Looks like the latest patch still has an incorrect change in the .info file.
Also, can somebody point me to the Drupal Coding Standards policy that states we need the full class namespace? I'm not seeing that format in any existing Commerce Core code, and personally, I feel like the original is more readable (and doesn't violate the 80 character line limit.)
For this change:
- // First entity should be order document; additional should be orders to be rendered. + // First entity should be order document; + // additional should be orders to be rendered.
Perhaps we can just reword the original comment instead of breaking it into two separate comments? I think that would look cleaner.
Also, here:
- // Pass the plugin configuration only if the plugin hasn't been changed via #ajax. + // Pass the plugin configuration only , + // if the plugin hasn't been changed via #ajax.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
Drupal core describes constructors using a phrase similar to the following one.
Constructs a \Drupal\views\Plugin\views\argument_validator\Entity object.
As for the comments, I am not sure it is possible to reduce a sentence that is longer than 80 character into a shorter sentence.
- 🇺🇸United States lisastreeter
@apaderno Thanks for the example class comment. In that same Core views module, I also see a constructor in
class BlockForm extends EntityForm {
that does not use the full namespace:* Constructs a BlockForm object.
So core doesn't seem to be consistent in its phrasing. When working within the Commerce ecosystem, I tend to follow the coding standards used within Commerce Core. I read through this document, but wasn't able to find specific guidance:
https://www.drupal.org/docs/develop/standards/php/api-documentation-and-comment-standards →One possible shorter sentence for:
// First entity should be order document; additional should be orders to be rendered.
// Entities should be order document followed by orders to be rendered.