Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Gelf/Transport/HttpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
*/
class HttpTransport extends AbstractTransport
{
private const DEFAULT_HOST = "127.0.0.1";
private const DEFAULT_PORT = 12202;
private const DEFAULT_PATH = "/gelf";
private const AUTO_SSL_PORT = 443;
public const DEFAULT_HOST = "127.0.0.1";
public const DEFAULT_PORT = 12202;
public const DEFAULT_PATH = "/gelf";
public const AUTO_SSL_PORT = 443;

private StreamSocketClient $socketClient;

Expand Down Expand Up @@ -70,12 +70,12 @@ public function __construct(
public static function fromUrl(string $url, ?SslOptions $sslOptions = null): self
{
$parsed = parse_url($url);

// check it's a valid URL
if (false === $parsed || !isset($parsed['host']) || !isset($parsed['scheme'])) {
throw new \InvalidArgumentException("$url is not a valid URL");
}

// check it's http or https
$scheme = strtolower($parsed['scheme']);
if (!in_array($scheme, ['http', 'https'])) {
Expand All @@ -90,7 +90,7 @@ public static function fromUrl(string $url, ?SslOptions $sslOptions = null): sel
$sslOptions = $sslOptions ?: new SslOptions();
$defaults['port'] = 443;
}

// merge defaults and real data and build transport
$parsed = array_merge($defaults, $parsed);
$transport = new self($parsed['host'], $parsed['port'], $parsed['path'], $sslOptions);
Expand Down