FILE: C:\xampp\htdocs\contribution\web\modules\contrib\bookable_calendar\src\Controller\BookableCalendarApiController.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------------------
23 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
104 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
115 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
128 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
129 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
199 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
200 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\contribution\web\modules\contrib\bookable_calendar\src\Controller\BookableCalendarController.php
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
20 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\contribution\web\modules\contrib\bookable_calendar\src\Form\BookingContactCreateForm.php
--------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
24 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------

FILE: C:\xampp\htdocs\contribution\web\modules\contrib\bookable_calendar\src\Notification.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------
70 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
71 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
77 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
156 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------

Time: 616ms; Memory: 8MB

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

Rakhi Soni created an issue. See original summary.

rakhi soni’s picture

Assigned: rakhi soni » Unassigned
Status: Active » Needs review
StatusFileSize
new11.4 KB

I have created a patch to fix the issue of '\Drupal calls should be avoided in classes, use dependency injection instead',, please review.

jayesh.d’s picture

Assigned: Unassigned » jayesh.d

Hi Rakhi,
I will be reviewing your patch.
Thanks!!

jayesh.d’s picture

Status: Needs review » Needs work

Hi Rakhi,
I have reviewed your patch. It applied cleanly.

SR COMPUTER@DESKTOP-CHNCDT9 MINGW64 /c/xampp/htdocs/Project/siteforcontributing/web/modules/contrib/bookable_calendar (2.1.x)
$ git apply -v Drupal_calls_should_be_avoided-3291677-2.patch
Drupal_calls_should_be_avoided-3291677-2.patch:26: trailing whitespace.
   *
Drupal_calls_should_be_avoided-3291677-2.patch:208: trailing whitespace.

Drupal_calls_should_be_avoided-3291677-2.patch:222: trailing whitespace.
   *
Drupal_calls_should_be_avoided-3291677-2.patch:225: trailing whitespace.
   *
Drupal_calls_should_be_avoided-3291677-2.patch:228: trailing whitespace.
   *
Checking patch src/Controller/BookableCalendarApiController.php...
Checking patch src/Controller/BookableCalendarController.php...
Checking patch src/Form/BookingContactCreateForm.php...
Checking patch src/Notification.php...
Applied patch src/Controller/BookableCalendarApiController.php cleanly.
Applied patch src/Controller/BookableCalendarController.php cleanly.
Applied patch src/Form/BookingContactCreateForm.php cleanly.
Applied patch src/Notification.php cleanly.
warning: squelched 4 whitespace errors
warning: 9 lines add whitespace errors.

Your patch has successfully removed the ?Drupal class should be avoided in class issue. But there are lot of coding standard isses which need to be addressed.

SR COMPUTER@DESKTOP-CHNCDT9 MINGW64 /c/xampp/htdocs/Project/siteforcontributing/web/modules/contrib (master)
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig bookable_calendar

FILE: ...ntributing\web\modules\contrib\bookable_calendar\bookable_calendar.install
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 123 | WARNING | Avoid backslash escaping in translatable strings when
     |         | possible, use "" quotes instead
--------------------------------------------------------------------------------


FILE: ...ontributing\web\modules\contrib\bookable_calendar\bookable_calendar.module
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 6 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------------
 100 | WARNING | Line exceeds 80 characters; contains 90 characters
 138 | WARNING | Line exceeds 80 characters; contains 97 characters
 162 | WARNING | Line exceeds 80 characters; contains 88 characters
 168 | ERROR   | Comment indentation error, expected only 1 spaces
 185 | ERROR   | Comment indentation error, expected only 1 spaces
 196 | WARNING | Line exceeds 80 characters; contains 107 characters
 270 | WARNING | Only string literals should be passed to t() where possible
 339 | ERROR   | Doc comment is empty
 407 | ERROR   | Doc comment is empty
 436 | ERROR   | Doc comment is empty
 451 | WARNING | Line exceeds 80 characters; contains 94 characters
--------------------------------------------------------------------------------


FILE: ...roject\siteforcontributing\web\modules\contrib\bookable_calendar\README.md
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 35 WARNINGS AFFECTING 35 LINES
--------------------------------------------------------------------------------
   3 | WARNING | Line exceeds 80 characters; contains 98 characters
   4 | WARNING | Line exceeds 80 characters; contains 101 characters
  17 | WARNING | Line exceeds 80 characters; contains 82 characters
  18 | WARNING | Line exceeds 80 characters; contains 104 characters
  24 | WARNING | Line exceeds 80 characters; contains 103 characters
  25 | WARNING | Line exceeds 80 characters; contains 100 characters
  26 | WARNING | Line exceeds 80 characters; contains 100 characters
  30 | WARNING | Line exceeds 80 characters; contains 100 characters
  33 | WARNING | Line exceeds 80 characters; contains 97 characters
  35 | WARNING | Line exceeds 80 characters; contains 106 characters
  36 | WARNING | Line exceeds 80 characters; contains 101 characters
  37 | WARNING | Line exceeds 80 characters; contains 104 characters
  38 | WARNING | Line exceeds 80 characters; contains 119 characters
  39 | WARNING | Line exceeds 80 characters; contains 105 characters
  41 | WARNING | Line exceeds 80 characters; contains 111 characters
  45 | WARNING | Line exceeds 80 characters; contains 101 characters
  46 | WARNING | Line exceeds 80 characters; contains 99 characters
  47 | WARNING | Line exceeds 80 characters; contains 104 characters
  48 | WARNING | Line exceeds 80 characters; contains 101 characters
  49 | WARNING | Line exceeds 80 characters; contains 98 characters
  50 | WARNING | Line exceeds 80 characters; contains 88 characters
  52 | WARNING | Line exceeds 80 characters; contains 89 characters
  53 | WARNING | Line exceeds 80 characters; contains 107 characters
  61 | WARNING | Line exceeds 80 characters; contains 93 characters
  62 | WARNING | Line exceeds 80 characters; contains 88 characters
  74 | WARNING | Line exceeds 80 characters; contains 89 characters
  76 | WARNING | Line exceeds 80 characters; contains 92 characters
  83 | WARNING | Line exceeds 80 characters; contains 87 characters
  84 | WARNING | Line exceeds 80 characters; contains 84 characters
  89 | WARNING | Line exceeds 80 characters; contains 132 characters
  91 | WARNING | Line exceeds 80 characters; contains 89 characters
  92 | WARNING | Line exceeds 80 characters; contains 82 characters
  93 | WARNING | Line exceeds 80 characters; contains 102 characters
  97 | WARNING | Line exceeds 80 characters; contains 87 characters
 133 | WARNING | Line exceeds 80 characters; contains 85 characters
--------------------------------------------------------------------------------


FILE: ...uting\web\modules\contrib\bookable_calendar\src\AvailableSlotsItemList.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 10 | WARNING | Line exceeds 80 characters; contains 109 characters
--------------------------------------------------------------------------------


FILE: ...les\contrib\bookable_calendar\src\BookableCalendarAccessControlHandler.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 25 | ERROR | The array declaration extends to column 121 (the limit is 80).
    |       | The array content should be split up over multiple lines
 28 | ERROR | The array declaration extends to column 123 (the limit is 80).
    |       | The array content should be split up over multiple lines
 41 | ERROR | The array declaration extends to column 119 (the limit is 80).
    |       | The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: ...trib\bookable_calendar\src\BookableCalendarOpeningAccessControlHandler.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------
 11 | WARNING | Line exceeds 80 characters; contains 84 characters
 25 | ERROR   | The array declaration extends to column 137 (the limit is 80).
    |         | The array content should be split up over multiple lines
 28 | ERROR   | The array declaration extends to column 139 (the limit is 80).
    |         | The array content should be split up over multiple lines
 41 | ERROR   | The array declaration extends to column 135 (the limit is 80).
    |         | The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: ...kable_calendar\src\BookableCalendarOpeningInstanceAccessControlHandler.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
--------------------------------------------------------------------------------
 11 | WARNING | Line exceeds 80 characters; contains 84 characters
 25 | ERROR   | The array declaration extends to column 155 (the limit is 80).
    |         | The array content should be split up over multiple lines
 28 | ERROR   | The array declaration extends to column 157 (the limit is 80).
    |         | The array content should be split up over multiple lines
 41 | ERROR   | The array declaration extends to column 153 (the limit is 80).
    |         | The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: ...contrib\bookable_calendar\src\BookableCalendarOpeningInstanceInterface.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 8 | WARNING | Line exceeds 80 characters; contains 83 characters
--------------------------------------------------------------------------------


FILE: ...ntrib\bookable_calendar\src\BookableCalendarOpeningInstanceListBuilder.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 9 | WARNING | Line exceeds 80 characters; contains 85 characters
--------------------------------------------------------------------------------


FILE: ...contrib\bookable_calendar\src\BookableCalendarOpeningInstanceViewsData.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 18 WARNINGS AFFECTING 18 LINES
--------------------------------------------------------------------------------
 35 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 36 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 37 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 38 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 39 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 43 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 44 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 45 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 46 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 47 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 67 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 78 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 80 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 89 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 94 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 95 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 96 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 97 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
--------------------------------------------------------------------------------


FILE: ...modules\contrib\bookable_calendar\src\BookableCalendarOpeningViewsData.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 15 WARNINGS AFFECTING 15 LINES
--------------------------------------------------------------------------------
 35 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 36 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 37 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 38 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 39 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 43 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 44 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 45 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 46 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 47 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 78 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 83 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 84 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 85 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 86 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
--------------------------------------------------------------------------------


FILE: ...\web\modules\contrib\bookable_calendar\src\BookingAccessControlHandler.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 25 | ERROR | The array declaration extends to column 101 (the limit is 80).
    |       | The array content should be split up over multiple lines
 28 | ERROR | The array declaration extends to column 103 (the limit is 80).
    |       | The array content should be split up over multiple lines
 41 | ERROR | The array declaration extends to column 99 (the limit is 80). The
    |       | array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: ...dules\contrib\bookable_calendar\src\BookingContactAccessControlHandler.php
--------------------------------------------------------------------------------
FOUND 16 ERRORS AFFECTING 14 LINES
--------------------------------------------------------------------------------
 30 | ERROR | The array declaration extends to column 120 (the limit is 80).
    |       | The array content should be split up over multiple lines
 37 | ERROR | The array declaration extends to column 122 (the limit is 80).
    |       | The array content should be split up over multiple lines
 54 | ERROR | The array declaration extends to column 115 (the limit is 80).
    |       | The array content should be split up over multiple lines
 59 | ERROR | Doc comment short description must end with a full stop
 59 | ERROR | Doc comment short description must be on a single line, further
    |       | text should be a separate paragraph
 61 | ERROR | Missing parameter comment
 63 | ERROR | Description for the @return value is missing
 65 | ERROR | Type hint "Drupal\bookable_calendar\Entity\BookingContact"
    |       | missing for $entity
 80 | ERROR | Missing parameter comment
 82 | ERROR | Description for the @return value is missing
 84 | ERROR | Type hint "Drupal\bookable_calendar\Entity\BookingContact"
    |       | missing for $entity
 92 | ERROR | Doc comment short description must end with a full stop
 92 | ERROR | Doc comment short description must be on a single line, further
    |       | text should be a separate paragraph
 94 | ERROR | Missing parameter comment
 96 | ERROR | Description for the @return value is missing
 98 | ERROR | Type hint "Drupal\bookable_calendar\Entity\BookingContact"
    |       | missing for $entity
--------------------------------------------------------------------------------


FILE: ...ontributing\web\modules\contrib\bookable_calendar\src\BookingViewsData.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 15 WARNINGS AFFECTING 16 LINES
--------------------------------------------------------------------------------
 35 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 36 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 37 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 38 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 39 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 43 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 44 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 45 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 46 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 47 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 63 | ERROR   | The array declaration extends to column 82 (the limit is 80).
    |         | The array content should be split up over multiple lines
 78 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 83 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 84 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 85 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
 86 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
--------------------------------------------------------------------------------


FILE: ...contrib\bookable_calendar\src\Controller\BookableCalendarApiController.php
--------------------------------------------------------------------------------
FOUND 23 ERRORS AFFECTING 16 LINES
--------------------------------------------------------------------------------
  20 | ERROR | Missing member variable doc comment
  20 | ERROR | Class property $entity_type_manager should use lowerCamel naming
     |       | without underscores
  21 | ERROR | Missing member variable doc comment
  21 | ERROR | Class property $instance_storage should use lowerCamel naming
     |       | without underscores
  22 | ERROR | Missing member variable doc comment
  22 | ERROR | Class property $contact_storage should use lowerCamel naming
     |       | without underscores
  30 | ERROR | Parameter tags must be grouped together in a doc comment
  50 | ERROR | Doc comment is empty
 111 | ERROR | Missing parameter comment
 112 | ERROR | Missing parameter comment
 114 | ERROR | If there is no return value for a function, there must not be a
     |       | @return tag.
 114 | ERROR | Description for the @return value is missing
 186 | ERROR | Doc comment short description must end with a full stop
 188 | ERROR | Missing parameter comment
 190 | ERROR | If there is no return value for a function, there must not be a
     |       | @return tag.
 190 | ERROR | Description for the @return value is missing
 202 | ERROR | Doc comment short description must end with a full stop
 204 | ERROR | Missing parameter comment
 206 | ERROR | If there is no return value for a function, there must not be a
     |       | @return tag.
 206 | ERROR | Description for the @return value is missing
 222 | ERROR | Missing parameter comment
 224 | ERROR | If there is no return value for a function, there must not be a
     |       | @return tag.
 224 | ERROR | Description for the @return value is missing
--------------------------------------------------------------------------------


FILE: ...es\contrib\bookable_calendar\src\Controller\BookableCalendarController.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 12 | ERROR | Missing member variable doc comment
 12 | ERROR | Class property $entity_type_manager should use lowerCamel naming
    |       | without underscores
 13 | ERROR | Missing member variable doc comment
 13 | ERROR | Class property $instance_storage should use lowerCamel naming
    |       | without underscores
 14 | ERROR | Missing member variable doc comment
 14 | ERROR | Class property $contact_storage should use lowerCamel naming
    |       | without underscores
--------------------------------------------------------------------------------


FILE: ...ting\web\modules\contrib\bookable_calendar\src\Entity\BookableCalendar.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 100 | ERROR | Doc comment is empty
--------------------------------------------------------------------------------


FILE: ...b\modules\contrib\bookable_calendar\src\Entity\BookableCalendarOpening.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 269 | WARNING | Line exceeds 80 characters; contains 84 characters
--------------------------------------------------------------------------------


FILE: ...s\contrib\bookable_calendar\src\Entity\BookableCalendarOpeningInstance.php
--------------------------------------------------------------------------------
FOUND 19 ERRORS AND 3 WARNINGS AFFECTING 20 LINES
--------------------------------------------------------------------------------
 159 | WARNING | Avoid backslash escaping in translatable strings when
     |         | possible, use "" quotes instead
 173 | WARNING | Line exceeds 80 characters; contains 88 characters
 177 | WARNING | Possible useless method overriding detected
 181 | ERROR   | Doc comment is empty
 198 | ERROR   | Doc comment is empty
 205 | ERROR   | Doc comment is empty
 212 | ERROR   | Doc comment is empty
 219 | ERROR   | Doc comment is empty
 226 | ERROR   | Doc comment is empty
 233 | ERROR   | Doc comment is empty
 242 | ERROR   | Doc comment short description must end with a full stop
 242 | ERROR   | Doc comment short description must be on a single line,
     |         | further text should be a separate paragraph
 244 | ERROR   | Description for the @return value is missing
 265 | ERROR   | Description for the @return value is missing
 277 | ERROR   | Doc comment short description must be on a single line,
     |         | further text should be a separate paragraph
 279 | ERROR   | Description for the @return value is missing
 292 | ERROR   | Doc comment is empty
 301 | ERROR   | Doc comment short description must end with a full stop
 301 | ERROR   | Doc comment short description must be on a single line,
     |         | further text should be a separate paragraph
 303 | ERROR   | Description for the @return value is missing
 319 | ERROR   | Doc comment is empty
 326 | ERROR   | Doc comment is empty
--------------------------------------------------------------------------------


FILE: ...rcontributing\web\modules\contrib\bookable_calendar\src\Entity\Booking.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
 185 | WARNING | Line exceeds 80 characters; contains 89 characters
 247 | ERROR   | Doc comment is empty
--------------------------------------------------------------------------------


FILE: ...buting\web\modules\contrib\bookable_calendar\src\Entity\BookingContact.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
 249 | ERROR | Doc comment is empty
 261 | ERROR | Doc comment is empty
 278 | ERROR | Description for the @return value is missing
 287 | ERROR | Description for the @return value is missing
 305 | ERROR | Missing parameter comment
 306 | ERROR | Missing parameter comment
 308 | ERROR | Description for the @return value is missing
 321 | ERROR | Doc comment short description must end with a full stop
 321 | ERROR | Doc comment short description must be on a single line, further
     |       | text should be a separate paragraph
--------------------------------------------------------------------------------


FILE: ...eb\modules\contrib\bookable_calendar\src\Form\BookingContactCreateForm.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 22 | ERROR | Parameter $entity_field_manager is not described in comment
 25 | ERROR | Doc comment for parameter $entity_type_manager does not match
    |       | actual variable name $entity_field_manager
--------------------------------------------------------------------------------


FILE: ...ntributing\web\modules\contrib\bookable_calendar\src\Form\SettingsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 78 | WARNING | Possible useless method overriding detected
--------------------------------------------------------------------------------


FILE: ...ontributing\web\modules\contrib\bookable_calendar\src\MaxSlotsItemList.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 10 | WARNING | Line exceeds 80 characters; contains 107 characters
--------------------------------------------------------------------------------


FILE: ...forcontributing\web\modules\contrib\bookable_calendar\src\Notification.php
--------------------------------------------------------------------------------
FOUND 15 ERRORS AND 3 WARNINGS AFFECTING 15 LINES
--------------------------------------------------------------------------------
  17 | WARNING | The class short comment should describe what the class does
     |         | and not simply repeat the class name
  76 | ERROR   | Parameter tags must be grouped together in a doc comment
  79 | ERROR   | Parameter tags must be grouped together in a doc comment
  82 | ERROR   | Parameter tags must be grouped together in a doc comment
  85 | ERROR   | Parameter tags must be grouped together in a doc comment
  88 | ERROR   | Parameter tags must be grouped together in a doc comment
  91 | ERROR   | Parameter tags must be grouped together in a doc comment
 125 | ERROR   | If there is no return value for a function, there must not be
     |         | a @return tag.
 125 | ERROR   | Description for the @return value is missing
 173 | ERROR   | Description for the @return value is missing
 185 | ERROR   | Description for the @return value is missing
 197 | ERROR   | Description for the @return value is missing
 206 | WARNING | Line exceeds 80 characters; contains 104 characters
 208 | ERROR   | If there is no return value for a function, there must not be
     |         | a @return tag.
 208 | ERROR   | Description for the @return value is missing
 234 | WARNING | Line exceeds 80 characters; contains 90 characters
 236 | ERROR   | If there is no return value for a function, there must not be
     |         | a @return tag.
 236 | ERROR   | Description for the @return value is missing
--------------------------------------------------------------------------------


FILE: ...able_calendar\src\Plugin\Validation\Constraint\CalendarOpeningIsActive.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | Missing member variable doc comment
--------------------------------------------------------------------------------


FILE: ..._calendar\src\Plugin\Validation\Constraint\CalendarOpeningMaxPartySize.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | Missing member variable doc comment
--------------------------------------------------------------------------------


FILE: ...ble_calendar\src\Plugin\Validation\Constraint\CalendarOpeningNotInPast.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | Missing member variable doc comment
--------------------------------------------------------------------------------


FILE: ...le_calendar\src\Plugin\Validation\Constraint\CalendarOpeningTooFarAway.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | Missing member variable doc comment
--------------------------------------------------------------------------------


FILE: ...kable_calendar\src\Plugin\Validation\Constraint\CalendarOpeningTooSoon.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | Missing member variable doc comment
--------------------------------------------------------------------------------


FILE: ...kable_calendar\src\Plugin\Validation\Constraint\CalendarOpeningVacancy.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 18 | ERROR | Missing member variable doc comment
--------------------------------------------------------------------------------


FILE: ...endar\src\Plugin\Validation\Constraint\CalendarOpeningVacancyValidator.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 32 | WARNING | Line exceeds 80 characters; contains 83 characters
--------------------------------------------------------------------------------


FILE: ...kable_calendar\src\Plugin\views\argument\MinimumAvailableSlotsArgument.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 10 | ERROR | Doc comment short description must be on a single line, further
    |       | text should be a separate paragraph
--------------------------------------------------------------------------------


FILE: ...odules\contrib\bookable_calendar\src\Plugin\views\field\AvailableSlots.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 10 | WARNING | Line exceeds 80 characters; contains 95 characters
--------------------------------------------------------------------------------


FILE: ...\web\modules\contrib\bookable_calendar\src\Plugin\views\field\MaxSlots.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 10 | WARNING | Line exceeds 80 characters; contains 89 characters
--------------------------------------------------------------------------------

Time: 1.65 secs; Memory: 14MB

Moving status needs to work.

jayesh.d’s picture

Assigned: jayesh.d » Unassigned
Status: Needs work » Needs review
StatusFileSize
new124.45 KB

Hi,
I have removed all the coding issues,Except three.

SR COMPUTER@DESKTOP-CHNCDT9 MINGW64 /c/xampp/htdocs/Project/siteforcontributing/web/modules/contrib (master)
$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig bookable_calendar-3291677

FILE: C:\xampp\htdocs\Project\siteforcontributing\web\modules\contrib\bookable_calendar-3291677\bookable_calendar.module
------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 271 | WARNING | Only string literals should be passed to t() where possible
------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\Project\siteforcontributing\web\modules\contrib\bookable_calendar-3291677\src\Entity\BookableCalendarOpeningInstance.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
 179 | WARNING | Possible useless method overriding detected
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\Project\siteforcontributing\web\modules\contrib\bookable_calendar-3291677\src\Form\SettingsForm.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
 78 | WARNING | Possible useless method overriding detected
-------------------------------------------------------------------------------------------------------------------------

Time: 1.63 secs; Memory: 12MB

Please review the patch. I haven't solved the three warnings intentionally because it can alter the maintainers code and will lead to unwanted functionality.
Thanks!!!

akshaydalvi212’s picture

Assigned: Unassigned » akshaydalvi212

Hello @jayesh.d,

Thanks for the patch, i will review it.

akshaydalvi212’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new72.96 KB

Hello @jayesh.d,

while applying the patch, getting some whitespace errors in the patch as follows:

I will upload the updated patch, which will be applicable without these whitespace errors.
hence switching the status of the issue to Needs work.

Thanks and regards.

akshaydalvi212’s picture

Assigned: akshaydalvi212 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new126.62 KB

Hello,

Providing a new patch, which eliminates all the coding standard errors and warnings as mentioned above except this warning:

FILE: ...p/web/modules/contrib/bookable_calendar/bookable_calendar.module
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
270 | WARNING | Only string literals should be passed to t() where
| | possible
----------------------------------------------------------------------

Time: 810ms; Memory: 16MB

This warning can be solved by the module maintainers.
if we make changes that can affect the functionality of the module.
Kindly review the patch.

Thanks & regards.

jayesh.d’s picture

Hello,
@akshaydalvi212 I explicitly mentioned in my #5 I am not removing those warnings. You might have removed the parent:saveForm() line . Which should not be removed.. These methods were wrtitten intentionally by the maintainer to autoload the form.

jayesh.d’s picture

Hi,
Akshay please provide me interdiff file.. with #5 and #8 patch.
I will review it

akshaydalvi212’s picture

StatusFileSize
new37.52 KB

Hello @jayesh.d,

Sorry for the inconvenience, providing the interdiff file for #5 and #8 patch.
kindly review it.

jayesh.d’s picture

Hi Akshay,
Thanks for providing me interdiff file . I checked everything is fine. But when I tried testing your patch #8. It unexpectedly failed.

SR COMPUTER@DESKTOP-CHNCDT9 MINGW64 /c/xampp/htdocs/Project/siteforcontributing/web/modules/contrib/bookable_calendar-3291677 (2.1.x)
$ git apply -v  coding-standard-fixes-3291677-8.patch
Checking patch README.md...
Checking patch bookable_calendar.install...
Checking patch bookable_calendar.module...
Checking patch css/admin-checkin.css...
Checking patch css/bookable-calendar.css...
Checking patch src/AvailableSlotsItemList.php...
Checking patch src/BookableCalendarAccessControlHandler.php...
Checking patch src/BookableCalendarListBuilder.php...
Checking patch src/BookableCalendarOpeningAccessControlHandler.php...
Checking patch src/BookableCalendarOpeningInstanceAccessControlHandler.php...
Checking patch src/BookableCalendarOpeningInstanceInterface.php...
Checking patch src/BookableCalendarOpeningInstanceListBuilder.php...
Checking patch src/BookableCalendarOpeningInstanceViewsData.php...
Checking patch src/BookableCalendarOpeningListBuilder.php...
Checking patch src/BookableCalendarOpeningViewsData.php...
Checking patch src/BookingAccessControlHandler.php...
Checking patch src/BookingContactAccessControlHandler.php...
Checking patch src/BookingContactListBuilder.php...
Checking patch src/BookingListBuilder.php...
Checking patch src/BookingViewsData.php...
Checking patch src/Controller/BookableCalendarApiController.php...
Checking patch src/Controller/BookableCalendarCheckInController.php...
Checking patch src/Controller/BookableCalendarController.php...
Checking patch src/Controller/BookableCalendarListController.php...
Checking patch src/Entity/BookableCalendar.php...
Checking patch src/Entity/BookableCalendarOpening.php...
Checking patch src/Entity/BookableCalendarOpeningInstance.php...
error: while searching for:
    foreach ($bookings as $booking) {
      $loaded_booking = $booking_storage->load($booking['target_id']);
      $booking_contact_id = $loaded_booking->contact->target_id;
      if (!in_array($booking_contact_id, $booking_parties, true)) {
        array_push($booking_parties, $booking_contact_id);
      }
    }

error: patch failed: src/Entity/BookableCalendarOpeningInstance.php:229
error: src/Entity/BookableCalendarOpeningInstance.php: patch does not apply
Checking patch src/Entity/Booking.php...
Checking patch src/Entity/BookingContact.php...
Checking patch src/Form/BookingContactCreateForm.php...
Checking patch src/Form/BookingContactForm.php...
Checking patch src/Form/SettingsForm.php...
Checking patch src/MaxSlotsItemList.php...
Checking patch src/Notification.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningIsActive.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningIsActiveValidator.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningMaxPartySize.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningMaxPartySizeValidator.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningNotInPast.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningNotInPastValidator.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningTooFarAway.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningTooFarAwayValidator.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningTooSoon.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningTooSoonValidator.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningVacancy.php...
Checking patch src/Plugin/Validation/Constraint/CalendarOpeningVacancyValidator.php...
Checking patch src/Plugin/views/argument/AvailableSlotsArgument.php...
Checking patch src/Plugin/views/argument/MinimumAvailableSlotsArgument.php...
Checking patch src/Plugin/views/field/AvailableSlots.php...
Checking patch src/Plugin/views/field/MaxSlots.php...
Checking patch src/Plugin/views/filter/AvailableSlotsFilter.php...

Please look into this. Thanks!!

akshaydalvi212’s picture

Issue summary: View changes
StatusFileSize
new82.94 KB

Hello @jayesh.d,

Thanks for confirming everything is fine from the review of interdiff file.
at my end the patch get applied perfectly and it is only showing some warnings as follows.

I guess we need more review from other contributors so as to confirm the problem.

Thanks and regards.

jayesh.d’s picture

Yeah, fine we can wait for it.

omkar-pd’s picture

StatusFileSize
new281.94 KB

Patch applied cleanly for me and solved all the coding standard issues except the 3 mentioned in #5. Can be moved to RTBC.

josh.fabean’s picture

Working on getting these merged in as I have time, in the past two weeks I've added more code, so the patches don't apply totally clean.

jsricardo’s picture

Assigned: Unassigned » jsricardo
jsricardo’s picture

Assigned: jsricardo » Unassigned
StatusFileSize
new111.13 KB

Fix dependence injections

alexanderj’s picture

Assigned: Unassigned » alexanderj

i will review it.

alexanderj’s picture

Assigned: alexanderj » Unassigned

@jsricardo I couldn't apply your patch, because apparently it has some lines different from the current version (I believe it can be turned and another version of the project).

When I checked the patch #8, I saw that it applies correctly and follows the way expected, I believe the correct thing would be to remove your patch file and proceed with patch #8 and then change the status to RTBC.

jsricardo’s picture

@alexanderj Sorry, there was an error on my part as I worked on an older version for this issue.
Disregard comment #18

mpaulo’s picture

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

#20 states there is still some work left to do.
I'll try working on or reviewing the last patches.

mpaulo’s picture

Status: Needs work » Needs review
StatusFileSize
new30.67 KB

No \Drupal calls violations appear on 2.1.4. Most of them are "XXX tags need to be fully namespaced", and fixable by PHPCBF.
Because of that, rerolling a previous commit seemed counterproductive.

I think the issue should be closed, or its description updated to address general CS errors

Either way, I'm providing a patch to fix the current CS violations.
The classes which extended Symfony\Component\Validator\Constraint were missing a PHPDoc comment of their properties, so I added the comment 'The message that will be shown when the constraint is violated.' on all of them.

mpaulo’s picture

Assigned: mpaulo » Unassigned
alexanderj’s picture

Assigned: Unassigned » alexanderj

I will review it.

alexanderj’s picture

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

@mpaulo I can't apply your patch, the error below is showing up for me when I try to apply the patch.

git apply --check 3291677-23.patch
error: patch with only garbage at line 357
lucienchalom’s picture

Version: 2.0.x-dev » 2.2.x-dev
Status: Needs work » Needs review
StatusFileSize
new46.32 KB

I could apply and reroll patch #23, but there were a lot of new CS to clean.
attaching a new patch.
Could not create a interdiff because of the reroll on #23.
Also worked on version 2.2x-dev, as the most recent branch.

I only left one "Only string literals should be passed to t() where possible" on bookable_calendar.module I was not able to fix.
I hope the maintainers can look into it.

elber’s picture

Assigned: Unassigned » elber

I will do a review

elber’s picture

Assigned: elber » Unassigned
StatusFileSize
new46.84 KB
new594 bytes

Hi I rewiewed patch #27 for me it's good module keeps working as expected just one thing I added a possible suggestion for the error Only string literals should be passed to t() where possible please revise.

lucienchalom’s picture

Status: Needs review » Reviewed & tested by the community

Your addiction was great! thank you

I Reviewed again and the module works.
all the coding standards are fixed.

Thank you everyone!
RTBC +

josh.fabean’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -

Fixed in Bookable Calendar 3.0.0-rc1. Module classes now receive their runtime
dependencies through constructor or entity-handler injection. The 3.0 CI
configuration runs both Drupal and DrupalPractice PHPCS rules and currently
passes without `DrupalPractice.Objects.GlobalDrupal` warnings in classes.

AI-Generated: Yes (OpenAI Codex helped draft this project-maintenance update, which was verified against the Bookable Calendar 3.0 branch.)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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