Skip to content

Commit 146bfb0

Browse files
Resolved test failure
1 parent 7e83297 commit 146bfb0

File tree

4 files changed

+34
-18
lines changed

4 files changed

+34
-18
lines changed

Magento2/Sniffs/Classes/DiscouragedDependenciesSniff.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,16 @@ class DiscouragedDependenciesSniff implements Sniff
3232
protected $warningCode = 'ConstructorProxyInterceptor';
3333

3434
/**
35-
* Aliases of proxies or plugins from use statements
36-
*
3735
* @var string[]
3836
*/
3937
private $aliases = [];
4038

4139
/**
42-
* The current file - used for clearing USE aliases when file changes
43-
*
4440
* @var null|string
4541
*/
4642
private $currentFile = null;
4743

4844
/**
49-
* Terms to search for in variables and namespaces
50-
*
5145
* @var string[]
5246
*/
5347
public $incorrectClassNames = ['proxy','interceptor'];

Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,24 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
8989
}
9090

9191
// Check if class has already have meaningful description after @var tag
92-
$isShortDescriptionAfterVar = $phpcsFile->findNext(T_DOC_COMMENT_STRING, $foundVar + 4, $commentEnd, false,
92+
$isShortDescriptionAfterVar = $phpcsFile->findNext(
93+
T_DOC_COMMENT_STRING,
94+
$foundVar + 4,
95+
$commentEnd,
96+
false,
9397
null,
94-
false);
95-
if ($this->PHPDocFormattingValidator->providesMeaning($isShortDescriptionAfterVar, $commentStart, $tokens) !== true) {
96-
preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\\[\]]+))*)( .*)?`i', $tokens[($foundVar + 2)]['content'], $varParts);
98+
false
99+
);
100+
if ($this->PHPDocFormattingValidator->providesMeaning(
101+
$isShortDescriptionAfterVar,
102+
$commentStart,
103+
$tokens
104+
) !== true) {
105+
preg_match(
106+
'`^((?:\|?(?:array\([^\)]*\)|[\\\\\[\]]+))*)( .*)?`i',
107+
$tokens[($foundVar + 2)]['content'],
108+
$varParts
109+
);
97110
if ($varParts[1]) {
98111
return;
99112
}
@@ -102,11 +115,24 @@ public function processMemberVar(File $phpcsFile, $stackPtr)
102115
return;
103116
}
104117
// Check if class has already have meaningful description before @var tag
105-
$isShortDescriptionPreviousVar = $phpcsFile->findPrevious(T_DOC_COMMENT_STRING, $foundVar, $commentStart, false,
118+
$isShortDescriptionPreviousVar = $phpcsFile->findPrevious(
119+
T_DOC_COMMENT_STRING,
120+
$foundVar,
121+
$commentStart,
122+
false,
106123
null,
107-
false);
108-
if ($this->PHPDocFormattingValidator->providesMeaning($isShortDescriptionPreviousVar, $commentStart, $tokens) !== true) {
109-
preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\\[\]]+))*)( .*)?`i', $tokens[($foundVar + 2)]['content'], $varParts);
124+
false
125+
);
126+
if ($this->PHPDocFormattingValidator->providesMeaning(
127+
$isShortDescriptionPreviousVar,
128+
$commentStart,
129+
$tokens
130+
) !== true) {
131+
preg_match(
132+
'`^((?:\|?(?:array\([^\)]*\)|[\\\\\[\]]+))*)( .*)?`i',
133+
$tokens[($foundVar + 2)]['content'],
134+
$varParts
135+
);
110136
if ($varParts[1]) {
111137
return;
112138
}

Magento2/Sniffs/Methods/DeprecatedModelMethodSniff.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class DeprecatedModelMethodSniff implements Sniff
4040
'delete'
4141
];
4242

43-
protected $severity = 0;
44-
4543
/**
4644
* @inheritdoc
4745
*/

Magento2/Sniffs/Security/XssTemplateSniff.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ class XssTemplateSniff implements Sniff
5050
];
5151

5252
/**
53-
* Allowed method name - {suffix}Html{postfix}()
54-
*
5553
* @var string
5654
*/
5755
protected $methodNameContains = 'html';

0 commit comments

Comments
 (0)