isAllowed()); self::assertTrue($guard->execute(static fn (): bool => $guard->isAllowed())); self::assertFalse($guard->isAllowed()); } public function testGuardIsResetWhenCallbackThrows(): void { $guard = new InternalAddGuard(); try { $guard->execute(static function (): void { throw new \RuntimeException('Expected test exception'); }); } catch (\RuntimeException) { self::assertFalse($guard->isAllowed()); } } }