Skip to content

Commit

Permalink
Fixed coding standard violations in the Framework\Translate namespace…
Browse files Browse the repository at this point in the history
…, 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.
  • Loading branch information
dverkade committed Apr 21, 2017
1 parent c3040d3 commit e69aab1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/Translate/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Magento translate adapter
*/
Expand All @@ -31,6 +29,7 @@ public function translate($messageId, $locale = null)
}
}

// @codingStandardsIgnoreStart
/**
* Translate message string.
*
Expand All @@ -47,4 +46,5 @@ public function __()
}
return $string;
}
// @codingStandardsIgnoreEnd
}
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/Translate/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Framework\Translate;

/**
Expand All @@ -24,11 +22,13 @@ interface AdapterInterface
*/
public function translate($messageId, $locale = null);

// @codingStandardsIgnoreStart
/**
* Translate string
*
* @return string
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function __();
// @codingStandardsIgnoreEnd
}
8 changes: 5 additions & 3 deletions lib/internal/Magento/Framework/Translate/Inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Framework\Translate;

class Inline implements \Magento\Framework\Translate\InlineInterface
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e69aab1

Please sign in to comment.