@@ -37,6 +37,7 @@ class DeprecatedEntityUsageCheck implements StaticCheckInterface
37
37
{
38
38
const EXTENDS_REGEX_PATTERN = '/extends=[" \']([^ \'"]*)/ ' ;
39
39
const ACTIONGROUP_REGEX_PATTERN = '/ref=[" \']([^ \'"]*)/ ' ;
40
+ const DEPRECATED_REGEX_PATTERN = '/deprecated=[" \']([^ \'"]*)/ ' ;
40
41
41
42
const ERROR_LOG_FILENAME = 'mftf-deprecated-entity-usage-checks ' ;
42
43
const ERROR_LOG_MESSAGE = 'MFTF Deprecated Entity Usage Check ' ;
@@ -225,6 +226,9 @@ private function findReferenceErrorsInActionFiles($files, $checkTestRef = false)
225
226
/** @var SplFileInfo $filePath */
226
227
foreach ($ files as $ filePath ) {
227
228
$ contents = file_get_contents ($ filePath );
229
+ if ($ this ->isDeprecated ($ contents )) {
230
+ continue ;
231
+ }
228
232
preg_match_all (ActionObject::ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN , $ contents , $ braceReferences );
229
233
preg_match_all (self ::ACTIONGROUP_REGEX_PATTERN , $ contents , $ actionGroupReferences );
230
234
preg_match_all (self ::EXTENDS_REGEX_PATTERN , $ contents , $ extendReferences );
@@ -316,6 +320,17 @@ private function findReferenceErrorsInActionFiles($files, $checkTestRef = false)
316
320
return $ testErrors ;
317
321
}
318
322
323
+ /**
324
+ * Checks if entity is deprecated in action files.
325
+ * @param string $contents
326
+ * @return boolean
327
+ */
328
+ private function isDeprecated ($ contents )
329
+ {
330
+ preg_match_all (self ::DEPRECATED_REGEX_PATTERN , $ contents , $ deprecatedEntity );
331
+ return (!empty ($ deprecatedEntity [1 ]));
332
+ }
333
+
319
334
/**
320
335
* Find reference errors in a set of data files
321
336
*
0 commit comments