253 || ! str_contains($host, '.')) throw new InvalidArgumentException('Geçerli bir alan adı girin.'); foreach (explode('.', $host) as $label) { if ($label === '' || strlen($label) > 63 || ! preg_match('/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/', $label)) { throw new InvalidArgumentException('Geçerli bir alan adı girin.'); } } $port = $parts['port'] ?? null; if ($port !== null && ($port < 1 || $port > 65535)) throw new InvalidArgumentException('Geçerli bir port girin.'); $includePort = $port !== null && !(($scheme === 'http' && $port === 80) || ($scheme === 'https' && $port === 443)); return new NormalizedProjectUrl($host, $scheme.'://'.$host.($includePort ? ':'.$port : '')); } }