New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding standards cleanup #7

Merged
merged 2 commits into from Aug 23, 2018

Conversation

Projects
None yet
4 participants
@borisson
Copy link
Contributor

borisson commented Aug 22, 2018

Cleans up coding standards with PHPCS to make sure that this module passes the drupal coding standards.

There are some open things that need to be fixed still, but it's gotten a little bit better.

These were the original fails: phpcs-fails.txt

Currently we have the following left:

$  ./vendor/bin/phpcs --standard=vendor/drupal/coder/coder_sniffer/Drupal/ modules/globalignore/civicrm-drupal-8/

FILE: ...b/modules/globalignore/civicrm-drupal-8/src/CivicrmPageState.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
  81 | ERROR | Public method name "CivicrmPageState::addCSS" is not
     |       | in lowerCamel format
  91 | ERROR | Public method name "CivicrmPageState::getCSS" is not
     |       | in lowerCamel format
 101 | ERROR | Type hint "array" missing for $script
 101 | ERROR | Public method name "CivicrmPageState::addJS" is not in
     |       | lowerCamel format
 111 | ERROR | Public method name "CivicrmPageState::getJS" is not in
     |       | lowerCamel format
----------------------------------------------------------------------


FILE: ...b/modules/globalignore/civicrm-drupal-8/src/Form/UserProfile.php
----------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------
 27 | ERROR | Doc comment is empty
 29 | ERROR | Missing @var tag in member variable comment
 32 | ERROR | Doc comment is empty
 34 | ERROR | Missing @var tag in member variable comment
 37 | ERROR | Doc comment is empty
 39 | ERROR | Missing @var tag in member variable comment
----------------------------------------------------------------------

Time: 1.44 secs; Memory: 12Mb

We should probably fix those in followups, as this is already a rather big PR.

joris-vercammen-cali and others added some commits Aug 22, 2018

@kewljuice

This comment has been minimized.

Copy link
Contributor

kewljuice commented Aug 23, 2018

I've tested this patch, It seems a file is missing "civicrm_views.module" in the "civicrm-drupal/modules/civicrm_views/" folder, containing a <?php opening tag.

@borisson

This comment has been minimized.

Copy link
Contributor

borisson commented Aug 23, 2018

This was on purpose. The .module files are not longer required in Drupal 8.

@kewljuice

This comment has been minimized.

Copy link
Contributor

kewljuice commented Aug 23, 2018

Ok, because I had the module already enabled, I needed to flush Drupal caches (drush cr) after patching it, now the Warning is gone. It looks like everything works fine!

@colemanw colemanw merged commit 27839e1 into civicrm:master Aug 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment