@@ -871,7 +871,7 @@ protected function _assertNotRegexp($regex, $content, $message)
871
871
872
872
public function testMageMethodsObsolete ()
873
873
{
874
- $ ignored = $ this ->getBlacklistFiles ();
874
+ $ ignored = $ this ->getBlacklistFiles (true );
875
875
$ files = Files::init ()->getPhpFiles (
876
876
Files::INCLUDE_APP_CODE
877
877
| Files::INCLUDE_TESTS
@@ -901,14 +901,14 @@ function ($file) {
901
901
}
902
902
903
903
/**
904
+ * @param string $appPath
904
905
* @param string $pattern
905
906
* @return array
906
907
* @throws \Exception
907
908
*/
908
- private function processPattern ($ pattern )
909
+ private function processPattern ($ appPath , $ pattern )
909
910
{
910
911
$ files = [];
911
- $ appPath = Files::init ()->getPathToSource ();
912
912
$ relativePathStart = strlen ($ appPath );
913
913
914
914
$ fileSet = glob ($ appPath . DIRECTORY_SEPARATOR . $ pattern , GLOB_NOSORT );
@@ -922,14 +922,21 @@ private function processPattern($pattern)
922
922
/**
923
923
* Reads list of blacklisted files
924
924
*
925
+ * @param bool $absolutePath
925
926
* @return array
927
+ * @throws \Exception
926
928
*/
927
- private function getBlacklistFiles ()
929
+ private function getBlacklistFiles ($ absolutePath = false )
928
930
{
929
931
$ blackList = include __DIR__ . '/_files/blacklist/obsolete_mage.php ' ;
930
932
$ ignored = [];
933
+ $ appPath = Files::init ()->getPathToSource ();
931
934
foreach ($ blackList as $ file ) {
932
- $ ignored = array_merge ($ ignored , $ this ->processPattern ($ file ));
935
+ if ($ absolutePath ) {
936
+ $ ignored = array_merge ($ ignored , glob ($ appPath . DIRECTORY_SEPARATOR . $ file , GLOB_NOSORT ));
937
+ } else {
938
+ $ ignored = array_merge ($ ignored , $ this ->processPattern ($ appPath , $ file ));
939
+ }
933
940
}
934
941
return $ ignored ;
935
942
}
0 commit comments