From e69aab1575680373283c6e0451f168d460be8136 Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Sat, 22 Apr 2017 00:00:03 +0200 Subject: [PATCH] Fixed coding standard violations in the Framework\Translate namespace, so that it will be checked bij PHP CS and no longer be ignored while doing CI checks. Made the following changes: - Removed @codingStandardsIgnoreFile from the head of the file - Fixed indentation - Wrapped __() functions with a codingStandardsIgnoreStart and end comment, because these will fail on the short function name. --- lib/internal/Magento/Framework/Translate/Adapter.php | 4 ++-- .../Magento/Framework/Translate/AdapterInterface.php | 4 ++-- lib/internal/Magento/Framework/Translate/Inline.php | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/internal/Magento/Framework/Translate/Adapter.php b/lib/internal/Magento/Framework/Translate/Adapter.php index df04016a468fa..420b4a36c156b 100644 --- a/lib/internal/Magento/Framework/Translate/Adapter.php +++ b/lib/internal/Magento/Framework/Translate/Adapter.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - /** * Magento translate adapter */ @@ -31,6 +29,7 @@ public function translate($messageId, $locale = null) } } + // @codingStandardsIgnoreStart /** * Translate message string. * @@ -47,4 +46,5 @@ public function __() } return $string; } + // @codingStandardsIgnoreEnd } diff --git a/lib/internal/Magento/Framework/Translate/AdapterInterface.php b/lib/internal/Magento/Framework/Translate/AdapterInterface.php index e09f2e0b91d48..bcd08a0b27c29 100644 --- a/lib/internal/Magento/Framework/Translate/AdapterInterface.php +++ b/lib/internal/Magento/Framework/Translate/AdapterInterface.php @@ -4,8 +4,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Translate; /** @@ -24,6 +22,7 @@ interface AdapterInterface */ public function translate($messageId, $locale = null); + // @codingStandardsIgnoreStart /** * Translate string * @@ -31,4 +30,5 @@ public function translate($messageId, $locale = null); * @SuppressWarnings(PHPMD.ShortMethodName) */ public function __(); + // @codingStandardsIgnoreEnd } diff --git a/lib/internal/Magento/Framework/Translate/Inline.php b/lib/internal/Magento/Framework/Translate/Inline.php index fd268598719a6..c04c240e73927 100644 --- a/lib/internal/Magento/Framework/Translate/Inline.php +++ b/lib/internal/Magento/Framework/Translate/Inline.php @@ -6,8 +6,6 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\Framework\Translate; class Inline implements \Magento\Framework\Translate\InlineInterface @@ -242,7 +240,11 @@ protected function stripInlineTranslations(&$body) } } else { if (is_string($body)) { - $body = preg_replace('#' . \Magento\Framework\Translate\Inline\ParserInterface::REGEXP_TOKEN . '#', '$1', $body); + $body = preg_replace( + '#' . \Magento\Framework\Translate\Inline\ParserInterface::REGEXP_TOKEN . '#', + '$1', + $body + ); } } return $this;