- Issue created by @urvashi_vora
- Open in Jenkins โ Open on Drupal.org โCore: 9.5.x + Environment: PHP 8.0 & MySQL 5.7 updated depslast update
over 1 year ago 2 pass - Status changed to RTBC
over 1 year ago 3:50pm 5 May 2023 - ๐ต๐ญPhilippines kenyoOwen
Hi urvashi_vora
I applied patch Fixed-all-issues.patch โ to the โCommerce Promo Barโ module and confirmed that the mentioned PHPCS issues are resolved. Please see the screenshots attached.
For your review.
Thank you. - Status changed to Needs work
over 1 year ago 6:35pm 5 May 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
+/** + * Implements class PromoBarEvents. + */
Class descriptions must not start with Implements class nor repeat the class name. Instead, they should describe the class purpose.
+ * @param \Drupal\Component\Datetime\TimeInterface $time + * The time service. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, - EntityTypeManagerInterface $entity_type_manager, + EntityTypeManagerInterface $entity_type_manager, CurrentStoreInterface $current_store, - AccountProxyInterface $current_user) { + AccountProxyInterface $current_user, + TimeInterface $time) {
Since that code is edited, it should also be edited to put the method declaration of a single line, since that is how Drupal coding standards say to format method/function declarations.
- $container->get('current_user') + $container->get('current_user'), + $container->get('datetime.time'), );
The comma after the last argument is only allowed on PHP 8. If that module does not explicitly require PHP 8, that comma must be removed.
- Status changed to Needs review
over 1 year ago 3:12am 6 May 2023 - Open in Jenkins โ Open on Drupal.org โCore: 9.5.x + Environment: PHP 8.0 & MySQL 5.7 updated depslast update
over 1 year ago 2 pass - ๐ฎ๐ณIndia Soham Sengupta
Hi, Updated the patch with the suggested changes.
- Status changed to Needs work
over 1 year ago 8:50am 6 May 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
- * - elements: An associative array containing the commerce promo bar information and any - * fields attached to the entity. + * - elements: An associative array + * It contains the commerce promo bar information and + * any fields attached to the entity.
An associative array containing the commerce promo bar information and any fields attached to the entity. was already correct; it was just necessary to reformat the text to avoid lines longer than 80 characters.
+/** + * Defines events for the commerce_promo_bar module. + */ final class PromoBarEvents {
Class descriptions do not need to contain the module machine name.
The verb should be Handles, and events should be better described as promo events.+ /** + * Constructor for the Promo bar block.
Short descriptions for constructors are Constructs a new [class name] object. where [class name] is replaced by the class name (namespace included).
- Status changed to Needs review
over 1 year ago 1:00pm 6 May 2023 - Open in Jenkins โ Open on Drupal.org โCore: 9.5.x + Environment: PHP 8.0 & MySQL 5.7 updated depslast update
over 1 year ago 2 pass - ๐ฎ๐ณIndia Soham Sengupta
Thanks, I have updated the patch with the suggested changes, however I was unable to include the namespace of the class in the block constructor short description, as it was exceeding 80characters and the short description should be in a single line.
- Status changed to Needs work
3 months ago 6:31am 20 August 2024 Hi @Soham Sengupta,
After applying the patch you provided, new errors/warnings were reported. Please see:
โ commerce_promo_bar git:(1.0.x) curl https://www.drupal.org/files/issues/2023-05-06/3358410-7.patch | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 7142 100 7142 0 0 18387 0 --:--:-- --:--:-- --:--:-- 18794 patching file README.md Hunk #2 FAILED at 33. 1 out of 2 hunks FAILED -- saving rejects to file README.md.rej patching file commerce_promo_bar.info.yml patching file commerce_promo_bar.module Reversed (or previously applied) patch detected! Assume -R? [n] y Hunk #1 succeeded at 36 (offset 1 line). Hunk #2 succeeded at 66 (offset 2 lines). patching file css/promo_bar.form.css patching file src/Event/PromoBarEvents.php Hunk #1 FAILED at 2. 1 out of 1 hunk FAILED -- saving rejects to file src/Event/PromoBarEvents.php.rej patching file src/Plugin/Block/PromoBarBlock.php Hunk #1 succeeded at 15 (offset 3 lines). Hunk #2 succeeded at 53 with fuzz 1. Hunk #3 FAILED at 74. Hunk #4 FAILED at 96. Hunk #5 FAILED at 138. 3 out of 5 hunks FAILED -- saving rejects to file src/Plugin/Block/PromoBarBlock.php.rej patching file templates/commerce-promo-bar.html.twig Hunk #1 FAILED at 34. 1 out of 1 hunk FAILED -- saving rejects to file templates/commerce-promo-bar.html.twig.rej โ commerce_promo_bar git:(1.0.x) โ .. โ contrib git:(master) โ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig commerce_promo_bar FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/commerce_promo_bar/README.md -------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------- 36 | WARNING | Line exceeds 80 characters; contains 84 characters 37 | WARNING | Line exceeds 80 characters; contains 81 characters -------------------------------------------------------------------------------------------------------- FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/commerce_promo_bar/commerce_promo_bar.module ------------------------------------------------------------------------------------------------------------------------ FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES ------------------------------------------------------------------------------------------------------------------------ 39 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters 45 | ERROR | [x] Data types in @var tags need to be fully namespaced 69 | WARNING | [x] A comma should follow the last multiline array item. Found: ] ------------------------------------------------------------------------------------------------------------------------ PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------ FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/commerce_promo_bar/templates/commerce-promo-bar.html.twig ------------------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------------------------- 38 | ERROR | [x] Expected 1 newline at end of file; 2 found ------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ------------------------------------------------------------------------------------------------------------------------------------- Time: 638ms; Memory: 14MB
Kindly check
Thanks,
Jake- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
avpaderno โ changed the visibility of the branch 3358410-fix-the-issues to hidden.
- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Let's create a merge request, now that patches are no longer tested.
- Merge request !8Created a new merge request to get the list of all the PHP_CodeSniffer errors/warnings to fix โ (Open) created by apaderno
- Status changed to Closed: outdated
3 months ago 7:06am 21 August 2024 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Actually, no PHP_CodeSniffer errors/warnings are reported before doing any change.