From 0dcab3b6c363c9bc96bf17680ad12f816546e3da Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Sun, 26 Feb 2017 22:46:05 +0200 Subject: [PATCH] [PSR-2 Compliance] Fix #8612: Hundreds of PHPCS-based static tests violations in mainline - apply manual fixes to make PHPCS happy, changes for "Constants are not allowed as the first argument of translation function, use string literal instead" - third-party constants are simply ignored, not sure if this is correct or not --- .../Ui/Component/Report/Listing/Column/PaymentType.php | 2 ++ .../Braintree/Ui/Component/Report/Listing/Column/Status.php | 2 ++ .../Ui/Component/Report/Listing/Column/TransactionType.php | 2 ++ app/code/Magento/Webapi/Controller/Rest/RequestValidator.php | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php index fe62fe2340757..9e2867f43b9f2 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php @@ -43,6 +43,7 @@ public function toOptionArray() */ private function getAvailablePaymentTypes() { + // @codingStandardsIgnoreStart return [ PaymentInstrumentType::PAYPAL_ACCOUNT => __(PaymentInstrumentType::PAYPAL_ACCOUNT), PaymentInstrumentType::COINBASE_ACCOUNT => __(PaymentInstrumentType::COINBASE_ACCOUNT), @@ -51,5 +52,6 @@ private function getAvailablePaymentTypes() PaymentInstrumentType::APPLE_PAY_CARD => __(PaymentInstrumentType::APPLE_PAY_CARD), PaymentInstrumentType::ANDROID_PAY_CARD => __(PaymentInstrumentType::ANDROID_PAY_CARD) ]; + // @codingStandardsIgnoreEnd } } diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php index b58bda418874f..20a427ff86058 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php @@ -43,6 +43,7 @@ public function toOptionArray() */ private function getAvailableStatuses() { + // @codingStandardsIgnoreStart return [ Transaction::AUTHORIZATION_EXPIRED => __(Transaction::AUTHORIZATION_EXPIRED), Transaction::AUTHORIZING => __(Transaction::AUTHORIZING), @@ -59,5 +60,6 @@ private function getAvailableStatuses() Transaction::SETTLEMENT_PENDING => __(Transaction::SETTLEMENT_PENDING), Transaction::SETTLEMENT_CONFIRMED => __(Transaction::SETTLEMENT_CONFIRMED) ]; + // @codingStandardsIgnoreEnd } } diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php index 46c497c8eca4a..64432c079491f 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php @@ -43,9 +43,11 @@ public function toOptionArray() */ private function getAvailableTransactionTypes() { + // @codingStandardsIgnoreStart return [ Transaction::SALE => __(Transaction::SALE), Transaction::CREDIT => __(Transaction::CREDIT) ]; + // @codingStandardsIgnoreEnd } } diff --git a/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php b/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php index 6435d5801277e..47b728370b034 100644 --- a/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php +++ b/app/code/Magento/Webapi/Controller/Rest/RequestValidator.php @@ -86,7 +86,7 @@ private function checkPermissions() if (!$this->authorization->isAllowed($route->getAclResources())) { $params = ['resources' => implode(', ', $route->getAclResources())]; throw new AuthorizationException( - __(AuthorizationException::NOT_AUTHORIZED, $params) + __('Consumer is not authorized to access %resources', $params) ); } }