Check if macro is valid (#1655)

* Check if macro is valid

* composer fix-style

---------

Co-authored-by: laravel-ide-helper <[email protected]>
This commit is contained in:
Barry vd. Heuvel
2025-01-08 11:00:53 +01:00
committed by GitHub
co-authored by laravel-ide-helper
parent 55268cd47a
commit bb1caed698
+7 -1
View File
@@ -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,