gateway !== null && $this->registeredBy !== $incoming) { Log::warning(sprintf( 'ResourcesRegistry: %s tried to register a Resources gateway, but %s is already registered. Keeping the first registration.', $incoming, $this->registeredBy, )); return; } $this->gateway = $gateway; $this->registeredBy = $incoming; } /** * Returns the registered gateway, or null when no plugin has registered * one. This is the "no Resources provider installed" state — every * consumer must handle it. */ public function resolve(): ?ResourcesGateway { return $this->gateway; } /** * True when a provider is registered. Convenience for template-level * checks that don't want to hold a gateway reference. */ public function hasProvider(): bool { return $this->gateway !== null; } }