magespecialist/m2-MSP_TwoFactorAuth

Getting Lot of Warning Message when run Magento Extension Quality Program Coding Standard

devamitbera opened this issue · 0 comments

Preconditions

  1. Run Magento Extension Quality Program Coding Standard on extension and getting lot of error Message as belows

Use of protected class members is discouraged

As per as magento extension Quality program this warnings should be fix.

Steps to reproduce

  1. Clone Magento Extension Quality Program Coding Standard using composer.
  2. After clone goto directory magento-coding-standard where i have clone the the package
  3. clone m2-MSP_TwoFactorAuth using composer require msp/twofactorauth
  4. Now Extension Quality Program Coding standard program using php vendor/bin/phpcs /var/www/html/vendor/msp/twofactorauth --standard=MEQP2 and that command show lot of warning message :

Use of protected class members is discouraged

Expected result

  1. Logs:
vagrant@dev:/var/www/html/magento-coding-standard$ php vendor/bin/phpcs /var/www/html/vendor/msp/twofactorauth --standard=MEQP2

FILE: /var/www/html/vendor/msp/twofactorauth/Setup/InstallSchema.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 35 | WARNING | The method parameter $context is never used
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Setup/InstallData.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 40 | WARNING | The method parameter $context is never used
----------------------------------------------------------------------


FILE: ...dor/msp/twofactorauth/Model/ResourceModel/Country/Collection.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 35 | WARNING | Use of protected class members is discouraged.
 35 | WARNING | Property name "$_idFieldName" should not be prefixed
    |         | with an underscore to indicate visibility
 37 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...ww/html/vendor/msp/twofactorauth/Model/ResourceModel/Country.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 34 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...dor/msp/twofactorauth/Model/ResourceModel/Trusted/Collection.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 35 | WARNING | Use of protected class members is discouraged.
 35 | WARNING | Property name "$_idFieldName" should not be prefixed
    |         | with an underscore to indicate visibility
 37 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...html/vendor/msp/twofactorauth/Model/ResourceModel/UserConfig.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 56 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...ww/html/vendor/msp/twofactorauth/Model/ResourceModel/Trusted.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 34 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: .../msp/twofactorauth/Model/ResourceModel/UserConfig/Collection.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 35 | WARNING | Use of protected class members is discouraged.
 35 | WARNING | Property name "$_idFieldName" should not be prefixed
    |         | with an underscore to indicate visibility
 37 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Model/Country.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 64 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Model/UserConfig.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 64 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Model/Trusted.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 64 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...endor/msp/twofactorauth/Observer/BackendAuthUserLoginSuccess.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 53 | WARNING | The method parameter $observer is never used
----------------------------------------------------------------------


FILE: ...vendor/msp/twofactorauth/Ui/Component/Form/User/DataProvider.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 70 | WARNING | Only dependency assignment operations are allowed in
    |         | constructor. No other operations are allowed.
----------------------------------------------------------------------


FILE: ...l/vendor/msp/twofactorauth/Controller/Adminhtml/Duo/Authpost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 149 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: .../html/vendor/msp/twofactorauth/Controller/Adminhtml/Duo/Auth.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 93 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: .../vendor/msp/twofactorauth/Controller/Adminhtml/U2f/Configure.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 80 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...l/vendor/msp/twofactorauth/Controller/Adminhtml/U2f/Authpost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 149 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...dor/msp/twofactorauth/Controller/Adminhtml/U2f/Configurepost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 139 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: .../html/vendor/msp/twofactorauth/Controller/Adminhtml/U2f/Auth.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 90 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...l/vendor/msp/twofactorauth/Controller/Adminhtml/Authy/Verify.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 125 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...vendor/msp/twofactorauth/Controller/Adminhtml/Authy/Onetouch.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 108 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: .../msp/twofactorauth/Controller/Adminhtml/Authy/Verifyonetouch.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 159 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...endor/msp/twofactorauth/Controller/Adminhtml/Authy/Configure.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 89 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...vendor/msp/twofactorauth/Controller/Adminhtml/Authy/Authpost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 156 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...ml/vendor/msp/twofactorauth/Controller/Adminhtml/Authy/Token.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 109 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...r/msp/twofactorauth/Controller/Adminhtml/Authy/Configurepost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 152 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...twofactorauth/Controller/Adminhtml/Authy/Configureverifypost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 157 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...tml/vendor/msp/twofactorauth/Controller/Adminhtml/Authy/Auth.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 100 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...ndor/msp/twofactorauth/Controller/Adminhtml/Google/Configure.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 81 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...endor/msp/twofactorauth/Controller/Adminhtml/Google/Authpost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 157 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: .../msp/twofactorauth/Controller/Adminhtml/Google/Configurepost.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 144 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...html/vendor/msp/twofactorauth/Controller/Adminhtml/Google/Qr.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 102 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...ml/vendor/msp/twofactorauth/Controller/Adminhtml/Google/Auth.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 90 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...html/vendor/msp/twofactorauth/Controller/Adminhtml/Tfa/Reset.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 91 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: ...tml/vendor/msp/twofactorauth/Controller/Adminhtml/Tfa/Revoke.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 62 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Block/ChangeProvider.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 49 | WARNING | Only dependency assignment operations are allowed in
    |         | constructor. No other operations are allowed.
----------------------------------------------------------------------


FILE: ...ugin/Observer/Backend/ForceAdminPasswordChangeObserverPlugin.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 54 | WARNING | The method parameter $subject is never used
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Command/TfaReset.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 68 | WARNING | Use of protected class members is discouraged.
 83 | WARNING | Use of protected class members is discouraged.
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Command/TfaProviders.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 47 | WARNING | Use of protected class members is discouraged.
 58 | WARNING | Use of protected class members is discouraged.
 58 | WARNING | The method parameter $input is never used
----------------------------------------------------------------------


FILE: /var/www/html/vendor/msp/twofactorauth/Command/TfaDisable.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 51 | WARNING | Use of protected class members is discouraged.
 62 | WARNING | Use of protected class members is discouraged.
 62 | WARNING | The method parameter $input is never used
 62 | WARNING | The method parameter $output is never used
----------------------------------------------------------------------


FILE: ...factorauth/view/adminhtml/web/js/form/element/reset_providers.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 42 | WARNING | [x] Opening brace must be the last content on the
    |         |     line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...w/html/vendor/msp/twofactorauth/view/adminhtml/web/js/duo/api.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 45 WARNINGS AFFECTING 45 LINES
----------------------------------------------------------------------
  51 | WARNING | [x] Opening brace should be on a new line
  53 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 10
  54 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 10
  58 | WARNING | [x] Opening brace should be on a new line
  63 | WARNING | [x] Opening brace should be on a new line
  73 | WARNING | [x] Opening brace should be on a new line
  81 | WARNING | [x] Opening brace should be on a new line
  89 | WARNING | [x] Opening brace should be on a new line
  93 | WARNING | [x] Opening brace should be on a new line
  97 | WARNING | [x] Opening brace should be on a new line
 101 | WARNING | [x] Opening brace should be on a new line
 111 | WARNING | [x] Opening brace should be on a new line
 125 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 126 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 127 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 149 | WARNING | [x] Opening brace should be on a new line
 154 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 155 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 156 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 157 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 158 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 14
 179 | WARNING | [x] Opening brace should be on a new line
 181 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 10
 182 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 10
 183 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 10
 187 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 10
 203 | WARNING | [x] Expected 5 space(s) before asterisk; 7 found
 204 | WARNING | [x] Expected 5 space(s) before asterisk; 7 found
 205 | WARNING | [x] Expected 5 space(s) before asterisk; 7 found
 206 | WARNING | [x] Expected 5 space(s) before asterisk; 7 found
 207 | WARNING | [x] Expected 5 space(s) before asterisk; 7 found
 208 | WARNING | [x] Expected 5 space(s) before asterisk; 7 found
 232 | WARNING | [x] Opening brace should be on a new line
 291 | WARNING | [x] Opening brace should be on a new line
 316 | WARNING | [x] Opening brace should be on a new line
 344 | WARNING | [x] Opening brace should be on a new line
 350 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 351 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 352 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 353 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 363 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 364 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 365 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 366 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 20 spaces but found 18
 397 | WARNING | [x] Opening brace should be on a new line
----------------------------------------------------------------------
PHPCBF CAN FIX THE 45 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...tml/vendor/msp/twofactorauth/view/adminhtml/web/js/u2fkey/api.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 29 WARNINGS AFFECTING 13 LINES
----------------------------------------------------------------------
 180 | WARNING | [x] Opening parenthesis of a multi-line function
     |         |     call must be the last content on the line
 183 | WARNING | [x] Closing parenthesis of a multi-line function
     |         |     call must be on a line by itself
 313 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 16
 313 | WARNING | [x] Only one argument is allowed per line in a
     |         |     multi-line function call
 313 | WARNING | [x] Only one argument is allowed per line in a
     |         |     multi-line function call
 313 | WARNING | [x] Closing parenthesis of a multi-line function
     |         |     call must be on a line by itself
 421 | WARNING | [ ] Comment refers to a FIXME task "stash away
     |         |     requestId, as the authenticator app does"
 421 | WARNING | [ ] Comment refers to a TODO task "fixme): stash
     |         |     away requestId, as the authenticator app does"
 425 | WARNING | [ ] Comment refers to a FIXME task "stash away the
     |         |     signRequests, to deal with the legacy"
 425 | WARNING | [ ] Comment refers to a TODO task "fixme): stash
     |         |     away the signRequests, to deal with the legacy"
 441 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 12 spaces but found 16
 441 | WARNING | [x] Closing parenthesis of a multi-line function
     |         |     call must be on a line by itself
 528 | WARNING | [ ] Comment refers to a FIXME task "stash away
     |         |     requestId, this is is not necessary for"
 528 | WARNING | [ ] Comment refers to a TODO task "fixme): stash
     |         |     away requestId, this is is not necessary for"
 621 | WARNING | [x] Opening parenthesis of a multi-line function
     |         |     call must be the last content on the line
 622 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 16 spaces but found 20
 622 | WARNING | [x] Closing parenthesis of a multi-line function
     |         |     call must be on a line by itself
 625 | WARNING | [x] Inline control structures are not allowed
 625 | WARNING | [x] Expected 0 spaces before semicolon; newline
     |         |     found
 680 | WARNING | [x] The first parameter of a multi-line function
     |         |     declaration must be on the line after the
     |         |     opening bracket
 680 | WARNING | [x] Multi-line function declarations must define one
     |         |     parameter per line
 681 | WARNING | [x] Multi-line function declaration not indented
     |         |     correctly; expected 4 spaces but found 24
 681 | WARNING | [x] Multi-line function declarations must define one
     |         |     parameter per line
 681 | WARNING | [x] The closing parenthesis of a multi-line function
     |         |     declaration must be on a new line
 689 | WARNING | [x] Multi-line function call not indented correctly;
     |         |     expected 8 spaces but found 12
 689 | WARNING | [x] Only one argument is allowed per line in a
     |         |     multi-line function call
 689 | WARNING | [x] Only one argument is allowed per line in a
     |         |     multi-line function call
 689 | WARNING | [x] Only one argument is allowed per line in a
     |         |     multi-line function call
 689 | WARNING | [x] Closing parenthesis of a multi-line function
     |         |     call must be on a line by itself
----------------------------------------------------------------------
PHPCBF CAN FIX THE 23 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ndor/msp/twofactorauth/view/adminhtml/web/js/u2fkey/configure.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 96 | WARNING | [x] Only one argument is allowed per line in a
    |         |     multi-line function call
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...ml/vendor/msp/twofactorauth/view/adminhtml/web/js/u2fkey/auth.js
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 96 | WARNING | [x] Only one argument is allowed per line in a
    |         |     multi-line function call
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 8.66 secs; Memory: 22Mb

Actual result

  1. As per as magento extension Quality program this warnings should be fix.Mostly Use of protected class members is discouraged waring.
    So, what is solution on this case.