mirror of
https://github.com/itflow-org/itflow
synced 2026-08-17 13:05:12 +00:00
Allow PHP-8.2 and up Compatibility instead of just PHP-8.4
This commit is contained in:
@@ -6,6 +6,8 @@ use BadMethodCallException;
|
||||
use Closure;
|
||||
use ReflectionClass;
|
||||
use ReflectionMethod;
|
||||
use RuntimeException;
|
||||
use Throwable;
|
||||
|
||||
trait Macroable
|
||||
{
|
||||
@@ -120,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