Line length sniff which ignores long lines in case they contain strings intended for translation.
Definition at line 13 of file LineLengthSniff.php.
◆ checkLineLength() [1/2]
checkLineLength |
( |
|
$phpcsFile, |
|
|
|
$stackPtr, |
|
|
|
$lineContent |
|
) |
| |
|
protected |
{}
Definition at line 25 of file LineLengthSniff.php.
27 $previousLineRegexp =
'~__\($|\bPhrase\($~';
28 $currentLineRegexp =
'~__\(.+\)|\bPhrase\(.+\)~';
29 $currentLineMatch = preg_match($currentLineRegexp, $lineContent) !== 0;
30 $previousLineMatch = preg_match($previousLineRegexp, $this->previousLineContent) !== 0;
31 $this->previousLineContent = $lineContent;
32 if (! $currentLineMatch && !$previousLineMatch) {
33 parent::checkLineLength($phpcsFile, $stackPtr, $lineContent);
◆ checkLineLength() [2/2]
checkLineLength |
( |
|
$phpcsFile, |
|
|
|
$stackPtr, |
|
|
|
$lineContent |
|
) |
| |
|
protected |
{}
Definition at line 25 of file LineLengthSniff.php.
27 $previousLineRegexp =
'~__\($|\bPhrase\($~';
28 $currentLineRegexp =
'~__\(.+\)|\bPhrase\(.+\)~';
29 $currentLineMatch = preg_match($currentLineRegexp, $lineContent) !== 0;
30 $previousLineMatch = preg_match($previousLineRegexp, $this->previousLineContent) !== 0;
31 $this->previousLineContent = $lineContent;
32 if (! $currentLineMatch && !$previousLineMatch) {
33 parent::checkLineLength($phpcsFile, $stackPtr, $lineContent);
◆ $previousLineContent
$previousLineContent = '' |
|
protected |
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/static/framework/Magento/Sniffs/Files/LineLengthSniff.php