From 382e94f9cdf9019afec2d464f47e7a1858c24445 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Tue, 18 Apr 2023 20:16:15 +0200 Subject: [PATCH] fix: scoping for instanced flags --- src/FunctionFlags.php | 48 +++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/src/FunctionFlags.php b/src/FunctionFlags.php index 54c17b1..d2fa267 100644 --- a/src/FunctionFlags.php +++ b/src/FunctionFlags.php @@ -1,10 +1,11 @@ flags = array_merge($this->flags, $flags); + $this->flags = array_merge($this->flags, $this::static_define($flags)); } // Check if flag is set within instance scope private function inst_isset(int $flag): bool|null { + if (!in_array($flag, $this->flags)) { + return false; + } + // Filter flags that belong to this scope - return in_array($this::static_isset($flag), $this->flags); + return $this::static_isset($flag); } }