File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -222,9 +222,22 @@ class ErrorHandler
222222 * {closure}()
223223 * blah::foo()
224224 * foo()
225+ *
226+ * It is:
227+ * a closure
228+ * or a method or function
229+ * followed by parenthesis '()'
230+ *
231+ * a function is 'namespace function'
232+ * a method is 'namespace class::function', or 'namespace class->function'
233+ * the whole namespace is optional
234+ * namespace is made up of an '\' and then repeating 'namespace\'
235+ * both the first slash, and the repeating 'namespace\', are optional
236+ *
237+ * 'END' matches it at the end of a string, the other one does not.
225238 */
226- const REGEX_METHOD_OR_FUNCTION_END = '/( \\{closure \\})|(\b[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(::[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)?) \\( \\)$/ ' ;
227- const REGEX_METHOD_OR_FUNCTION = '/( \\{closure \\})|(\ b[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(::[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)?) \\( \\)/ ' ;
239+ const REGEX_METHOD_OR_FUNCTION_END = '/( \\{closure \\})|((( \\\\ )?(\b[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* \\\\ )*)? \b[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(::[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)?) \\( \\)$/ ' ;
240+ const REGEX_METHOD_OR_FUNCTION = '/( \\{closure \\})|((( \\\\ )?(\ b[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\\\\ )*)?\b[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* (::[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)?) \\( \\)/ ' ;
228241
229242 const REGEX_VARIABLE = '/\b[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/ ' ;
230243
You can’t perform that action at this time.
0 commit comments