provider === '') { throw new InvalidArgumentException('System-store provider cannot be empty'); } if ($this->service === '') { throw new InvalidArgumentException('System-store service cannot be empty'); } if ($this->namespace === '') { throw new InvalidArgumentException('System-store namespace cannot be empty'); } } public static function fromArray(array $data): self { $provider = $data['provider'] ?? null; $service = $data['service'] ?? null; $namespace = $data['namespace'] ?? null; if (!is_string($provider) || (!is_string($service) && !is_int($service)) || !is_string($namespace)) { throw new InvalidArgumentException('Invalid system-store reference'); } return new self($provider, $service, $namespace); } public function toArray(): array { return [ 'provider' => $this->provider, 'service' => $this->service, 'namespace' => $this->namespace, ]; } }