mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-30 05:03:23 +00:00
[Web] Update composer libraries
This commit is contained in:
1297 files changed
+71585
-24460
No files matched your search
@@ -6,6 +6,8 @@ use BadMethodCallException;
|
||||
use Closure;
|
||||
use ReflectionClass;
|
||||
use ReflectionMethod;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
trait Macroable
|
||||
{
|
||||
@@ -21,6 +23,9 @@ trait Macroable
|
||||
*
|
||||
* @param string $name
|
||||
* @param object|callable $macro
|
||||
*
|
||||
* @param-closure-this static $macro
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function macro($name, $macro)
|
||||
@@ -117,7 +122,11 @@ trait Macroable
|
||||
$macro = static::$macros[$method];
|
||||
|
||||
if ($macro instanceof Closure) {
|
||||
$macro = $macro->bindTo($this, static::class);
|
||||
try {
|
||||
$macro = $macro->bindTo($this, static::class) ?? throw new RuntimeException;
|
||||
} catch (Throwable) {
|
||||
$macro = $macro->bindTo(null, static::class);
|
||||
}
|
||||
}
|
||||
|
||||
return $macro(...$parameters);
|
||||
|
||||
Reference in new issue
Block a user