Connection configuration using DSN
3 unresolved threads
3 unresolved threads
Merge request reports
Activity
assigned to @Niklan
- src/Connection/ConnectionConfig.php 0 → 100644
143 if ($this->host !== NULL || $this->port !== NULL) { 144 $errors[] = 'Host and port must be null for Unix connections'; 145 } 146 147 $this->throwIfErrors($errors); 148 } 149 150 /** 151 * Throws aggregated validation errors as a single exception. 152 * 153 * @param list<string> $errors 154 * List of validation error messages. 155 * 156 * @throws \InvalidArgumentException 157 */ 158 private function throwIfErrors(array $errors): void { - src/Connection/ConnectionConfig.php 0 → 100644
4 5 namespace Drupal\cache_pilot\Connection; 6 7 /** 8 * Immutable configuration container for Fast-CGI connections. 9 */ 10 final readonly class ConnectionConfig { 11 12 /** 13 * Constructs a new ConnectionConfig instance. 14 * 15 * @param string $type 16 * The connection type. Supported values: 17 * - 'tcp': TCP/IP connection (requires $host and $port) 18 * - 'unix': Unix Domain Socket connection (requires $socketPath) 19 * @param string|null $socketPath changed this line in version 3 of the diff
- src/Connection/ConnectionConfig.php 0 → 100644
82 $this->validateType(); 83 84 match ($this->type) { 85 'tcp' => $this->validateTcpParams(), 86 'unix' => $this->validateUnixParams(), 87 default => throw new \InvalidArgumentException('Invalid connection type'), 88 }; 89 } 90 91 /** 92 * Validates the connection type parameter. 93 * 94 * @throws \InvalidArgumentException 95 * When an unsupported connection type is provided. 96 */ 97 private function validateType(): void { changed this line in version 3 of the diff
Please register or sign in to reply