mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
Check if macro is valid
This commit is contained in:
+7
-1
@@ -403,9 +403,15 @@ class Alias
|
||||
$macros = isset($properties['macros']) ? $properties['macros'] : [];
|
||||
foreach ($macros as $macro_name => $macro_func) {
|
||||
if (!in_array($macro_name, $this->usedMethods)) {
|
||||
try {
|
||||
$method = $this->getMacroFunction($macro_func);
|
||||
} catch (\Throwable $e) {
|
||||
// Invalid method, skip
|
||||
continue;
|
||||
}
|
||||
// Add macros
|
||||
$this->methods[] = new Macro(
|
||||
$this->getMacroFunction($macro_func),
|
||||
$method,
|
||||
$this->alias,
|
||||
$reflection,
|
||||
$macro_name,
|
||||
|
||||
Reference in New Issue
Block a user