Skip to content

Commit e69aab1

Browse files
committed
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.
1 parent c3040d3 commit e69aab1

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

lib/internal/Magento/Framework/Translate/Adapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Magento translate adapter
119
*/
@@ -31,6 +29,7 @@ public function translate($messageId, $locale = null)
3129
}
3230
}
3331

32+
// @codingStandardsIgnoreStart
3433
/**
3534
* Translate message string.
3635
*
@@ -47,4 +46,5 @@ public function __()
4746
}
4847
return $string;
4948
}
49+
// @codingStandardsIgnoreEnd
5050
}

lib/internal/Magento/Framework/Translate/AdapterInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Framework\Translate;
108

119
/**
@@ -24,11 +22,13 @@ interface AdapterInterface
2422
*/
2523
public function translate($messageId, $locale = null);
2624

25+
// @codingStandardsIgnoreStart
2726
/**
2827
* Translate string
2928
*
3029
* @return string
3130
* @SuppressWarnings(PHPMD.ShortMethodName)
3231
*/
3332
public function __();
33+
// @codingStandardsIgnoreEnd
3434
}

lib/internal/Magento/Framework/Translate/Inline.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* See COPYING.txt for license details.
77
*/
88

9-
// @codingStandardsIgnoreFile
10-
119
namespace Magento\Framework\Translate;
1210

1311
class Inline implements \Magento\Framework\Translate\InlineInterface
@@ -242,7 +240,11 @@ protected function stripInlineTranslations(&$body)
242240
}
243241
} else {
244242
if (is_string($body)) {
245-
$body = preg_replace('#' . \Magento\Framework\Translate\Inline\ParserInterface::REGEXP_TOKEN . '#', '$1', $body);
243+
$body = preg_replace(
244+
'#' . \Magento\Framework\Translate\Inline\ParserInterface::REGEXP_TOKEN . '#',
245+
'$1',
246+
$body
247+
);
246248
}
247249
}
248250
return $this;

0 commit comments

Comments
 (0)