You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Magento2/Tests/Files/LineLengthUnitTest.inc
+15
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
<?php
2
2
3
+
useMagento\Framework\Phrase;
4
+
3
5
// allowed
4
6
$shortString = 'This is a short line';
5
7
@@ -10,6 +12,19 @@ $tooLongString = 'This is a pretty long line. The code sniffer will report an er
10
12
$longStringBrokenUp = 'This is a pretty long line. The code sniffer would report an error if this was written as a ' .
11
13
'single line. You have to insert a line break to avoid this error.';
12
14
15
+
// allowed: long lines for translations
16
+
$phraseObjects = [
17
+
Phrase('This is a short line'),
18
+
Phrase('Lines which include translations are excluded from this check. You can exceed the maximum character count without receiving a warning or an error.'),
19
+
'This is no translation string, so let us make sure this throws an error even when we use the word Phrase inside the string',
20
+
__(
21
+
'Also if we use this syntax and we put the actual translation string into a new line, there should be no error if this is used in a translation.'
22
+
),
23
+
Phrase(
24
+
'The same goes for the Phrase class when we put the actual translation string into a new line, also here we should not receive an error.'
25
+
)
26
+
];
27
+
13
28
// allowed by Magento Standard (Generic ruleset would trigger warning / error)
0 commit comments