depth > 0; } public function enter(): void { ++$this->depth; } public function leave(): void { $this->depth = max( 0, $this->depth - 1 ); } /** * Run a callback with our filters off. * * @template T * @param callable(): T $callback * @return T */ public function run( callable $callback ): mixed { $this->enter(); try { return $callback(); } finally { $this->leave(); } } /** Tests: back to normal mode. */ public function reset(): void { $this->depth = 0; } }