Skip to content
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

PHPCS Issues with Factory Hooks & Hooks #3322

Closed
mikemadison13 opened this issue Jan 3, 2019 · 2 comments
Closed

PHPCS Issues with Factory Hooks & Hooks #3322

mikemadison13 opened this issue Jan 3, 2019 · 2 comments
Assignees
Labels
Bug Something isn't working

Comments

@mikemadison13
Copy link
Contributor

My system information:

  • BLT version: 9.2.3

When I run this command:

blt recipes:acsf:init:drush

factory hooks are updated.
When i go to commit these, I get:

�[1mFILE: /factory-hooks/post-install/post-install.php�[0m
----------------------------------------------------------------------
�[1mFOUND 1 ERROR AFFECTING 1 LINE�[0m
----------------------------------------------------------------------
 15 | �[31mERROR�[0m | [x] Additional blank lines found at end of doc comment
----------------------------------------------------------------------
�[1mPHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY�[0m
----------------------------------------------------------------------


�[1mFILE: /factory-hooks/post-settings-php/memcache.php�[0m
----------------------------------------------------------------------
�[1mFOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES�[0m
----------------------------------------------------------------------
 12 | �[33mWARNING�[0m | Variable $site_settings is undefined.
 13 | �[33mWARNING�[0m | Variable $settings is undefined.
----------------------------------------------------------------------


�[1mFILE: /factory-hooks/post-sites-php/includes.php�[0m
----------------------------------------------------------------------
�[1mFOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES�[0m
----------------------------------------------------------------------
 18 | �[31mERROR�[0m   | Missing parameter type
 55 | �[33mWARNING�[0m | Variable $data is undefined.
----------------------------------------------------------------------


�[1mFILE: /hooks/common/pre-web-activate/000-acquia-deployment.php�[0m
----------------------------------------------------------------------
�[1mFOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE�[0m
----------------------------------------------------------------------
 330 | �[33mWARNING�[0m | Potential security problem: SSL peer verification
     |         | must not be disabled
----------------------------------------------------------------------

And I expected this to happen:
PHPCS to come back clean.

Note that rerunning blt blt:init:git-hooks DID make my phpcs ignore the issues, but they are still present and they should be fixed.

@mikemadison13
Copy link
Contributor Author

I've addressed several of the issues here in #3370 however there are still variable issues that will cause warnings.

@mikemadison13
Copy link
Contributor Author

The remaining issues here are all three related to variable scoping. The variables aren't properly defined inside the hooks, and phpcs is throwing errors as a result:

FILE: /factory-hooks/post-settings-php/memcache.php
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------
 12 | WARNING | Variable $site_settings is undefined.
 13 | WARNING | Variable $settings is undefined.
---------------------------------------------------------------------------------


FILE: /factory-hooks/post-sites-php/includes.php
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------
 55 | WARNING | Variable $data is undefined.
------------------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants