@@ -38,8 +38,7 @@ protected function handleMenuEntry(MenuNode $currentMenu, MenuEntryNode $node, C
38
38
$ menuEntries = [];
39
39
foreach ($ documentEntries as $ documentEntry ) {
40
40
if (
41
- !self ::isEqualAbsolutePath ($ documentEntry ->getFile (), $ node , $ currentPath , $ globExclude )
42
- && !self ::isEqualRelativePath ($ documentEntry ->getFile (), $ node , $ currentPath , $ globExclude )
41
+ !self ::matches ($ documentEntry ->getFile (), $ node , $ currentPath , $ globExclude )
43
42
) {
44
43
continue ;
45
44
}
@@ -92,27 +91,15 @@ public function getPriority(): int
92
91
return 4500 ;
93
92
}
94
93
95
- /** @param String[] $globExclude */
96
- private static function isEqualAbsolutePath (string $ actualFile , GlobMenuEntryNode $ parsedMenuEntryNode , string $ currentFile , array $ globExclude ): bool
94
+ private static function matches (string $ actualFile , GlobMenuEntryNode $ parsedMenuEntryNode , string $ currentFile , array $ globExclude ): bool
97
95
{
98
96
$ expectedFile = $ parsedMenuEntryNode ->getUrl ();
99
- if (!self ::isAbsoluteFile ($ expectedFile )) {
100
- return false ;
101
- }
102
-
103
- if ($ expectedFile === '/ ' . $ actualFile ) {
104
- return true ;
105
- }
106
-
107
- return self ::isGlob ($ actualFile , $ currentFile , $ expectedFile , '/ ' , $ globExclude );
108
- }
109
-
110
- /** @param String[] $globExclude */
111
- private static function isEqualRelativePath (string $ actualFile , GlobMenuEntryNode $ menuEntryNode , string $ currentFile , array $ globExclude ): bool
112
- {
113
- $ expectedFile = $ menuEntryNode ->getUrl ();
114
97
if (self ::isAbsoluteFile ($ expectedFile )) {
115
- return false ;
98
+ if ($ expectedFile === '/ ' . $ actualFile ) {
99
+ return true ;
100
+ }
101
+
102
+ return self ::isGlob ($ actualFile , $ currentFile , $ expectedFile , '/ ' , $ globExclude );
116
103
}
117
104
118
105
$ current = explode ('/ ' , $ currentFile );
0 commit comments