Page MenuHomePhabricator
Paste P13047

smashpig phpcs v31
ActivePublic

Authored by jgleeson on Oct 21 2020, 4:28 PM.
Tags
None
Referenced Files
F32410340: smashpig phpcs v31
Oct 21 2020, 4:28 PM
Subscribers
None
vagrant@mwv:/vagrant/srv/SmashPig$ ./vendor/bin/phpcs -n
FILE: /vagrant/srv/SmashPig/PaymentData/ReferenceData/NationalCurrencies.php
----------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------
12 | ERROR | Visibility must be declared on method "getNationalCurrency"
23 | ERROR | Visibility must be declared on method "getNationalCurrencies"
----------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/Ingenico/Api.php
--------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------
32 | ERROR | Expected parameter type before parameter name "$baseUrl"
33 | ERROR | Expected parameter type before parameter name "$merchantId"
--------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/Ingenico/PaymentProvider.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
134 | ERROR | Expected parameter type before parameter name "$paymentResponse"
--------------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/Ingenico/Audit/IngenicoAudit.php
-----------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-----------------------------------------------------------------------------
145 | ERROR | Expected parameter type before parameter name "$type"
146 | ERROR | Expected parameter type before parameter name "$gateway"
200 | ERROR | Visibility must be declared on method "addPaymentMethod"
-----------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/IPaymentProvider.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
7 | ERROR | Expected parameter type before parameter name "$params"
13 | ERROR | Expected parameter type before parameter name "$params"
----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/Adyen/CreatePaymentStatus.php
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
12 | ERROR | Expected parameter type before parameter name "$adyenStatus"
---------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/Adyen/ApprovePaymentStatus.php
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
12 | ERROR | Expected parameter type before parameter name "$adyenStatus"
---------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/Adyen/CancelPaymentStatus.php
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
12 | ERROR | Expected parameter type before parameter name "$adyenStatus"
---------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/Adyen/CreateDirectDebitPaymentStatus.php
-------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------
12 | ERROR | Expected parameter type before parameter name "$adyenStatus"
-------------------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
51 | ERROR | Visibility must be declared on method "getDestinationQueue"
---------------------------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/PayPal/Message.php
-----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------
51 | ERROR | Visibility must be declared on method "normalizeMessage"
-----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
36 | ERROR | Scope modifier not specified for member variable "$message_data"
------------------------------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Core/Cache/HashCacheItem.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------
15 | ERROR | Expected parameter type before parameter name "$key"
16 | ERROR | Expected parameter type before parameter name "$value"
17 | ERROR | Expected parameter type before parameter name "$hit"
----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Core/Configuration.php
-----------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------
97 | ERROR | Expected parameter type before parameter name "$node"
98 | ERROR | Expected parameter type before parameter name "$object"
271 | ERROR | Only one object structure is allowed in a file
277 | ERROR | Only one object structure is allowed in a file
-----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Core/DataFiles/HeadedCsvReader.php
-----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------
37 | ERROR | Expected parameter type before parameter name "$colName"
38 | ERROR | Expected parameter type before parameter name "$row"
-----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Core/Mapper/Mapper.php
-----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------
255 | ERROR | Expected parameter type before parameter name "$output"
256 | ERROR | Expected parameter type before parameter name "$format"
-----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Maintenance/MaintenanceBase.php
-------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------
104 | ERROR | Global variable "$maintClass" is lacking an allowed prefix ('wg'). Should be "$wgMaintClass".
416 | ERROR | Expected parameter type before parameter name "$prompt"
465 | ERROR | Expected parameter type before parameter name "$force"
565 | ERROR | Expected parameter type before parameter name "$fd"
-------------------------------------------------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Tests/TestingGlobalConfiguration.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
15 | ERROR | @implements is not a valid function annotation
----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Tests/TestingProviderConfiguration.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
14 | ERROR | @implements is not a valid function annotation
----------------------------------------------------------------------
FILE: /vagrant/srv/SmashPig/Tests/BaseSmashPigUnitTestCase.php
------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------
47 | ERROR | Expected parameter type before parameter name "$provider"
------------------------------------------------------------------------
Time: 5.69 secs; Memory: 16MB

Event Timeline

I've fixed most of these here except the last two.

This error is due to us having multiple class declarations in a single file. Configuration.php currently contains declarations for Configuration, ConfigurationException and ConfigurationKeyException

vagrant@mwv:/vagrant/srv/SmashPig$ ./vendor/bin/phpcs -n

FILE: /vagrant/srv/SmashPig/Core/Configuration.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 271 | ERROR | Only one object structure is allowed in a file
 277 | ERROR | Only one object structure is allowed in a file
----------------------------------------------------------------------

This error is expecting us to use the mediawiki global prefix in Smashpig which I feel like we don't want to do so this might be a candidate to be ignored

FILE: /vagrant/srv/SmashPig/Maintenance/MaintenanceBase.php
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
 104 | ERROR | Global variable "$maintClass" is lacking an allowed prefix ('wg').
     |       | Should be "$wgMaintClass".
------------------------------------------------------------------------------------