Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab9b49b

Browse filesBrowse files
espectriodmitry.pigin
authored and
dmitry.pigin
committed
[Notifier] Added possibility to extract path from provided DSN
1 parent e0f6cdb commit ab9b49b
Copy full SHA for ab9b49b

File tree

1 file changed

+10
-2
lines changed
Filter options
  • src/Symfony/Component/Notifier/Transport

1 file changed

+10
-2
lines changed

‎src/Symfony/Component/Notifier/Transport/Dsn.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Transport/Dsn.php
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ final class Dsn
2626
private $password;
2727
private $port;
2828
private $options;
29+
private $path;
2930

30-
public function __construct(string $scheme, string $host, ?string $user = null, ?string $password = null, ?int $port = null, array $options = [])
31+
public function __construct(string $scheme, string $host, ?string $user = null, ?string $password = null, ?int $port = null, array $options = [], ?string $path = null)
3132
{
3233
$this->scheme = $scheme;
3334
$this->host = $host;
3435
$this->user = $user;
3536
$this->password = $password;
3637
$this->port = $port;
3738
$this->options = $options;
39+
$this->path = $path;
3840
}
3941

4042
public static function fromString(string $dsn): self
@@ -54,9 +56,10 @@ public static function fromString(string $dsn): self
5456
$user = isset($parsedDsn['user']) ? urldecode($parsedDsn['user']) : null;
5557
$password = isset($parsedDsn['pass']) ? urldecode($parsedDsn['pass']) : null;
5658
$port = $parsedDsn['port'] ?? null;
59+
$path = $parsedDsn['path'] ?? null;
5760
parse_str($parsedDsn['query'] ?? '', $query);
5861

59-
return new self($parsedDsn['scheme'], $parsedDsn['host'], $user, $password, $port, $query);
62+
return new self($parsedDsn['scheme'], $parsedDsn['host'], $user, $password, $port, $query, $path);
6063
}
6164

6265
public function getScheme(): string
@@ -88,4 +91,9 @@ public function getOption(string $key, $default = null)
8891
{
8992
return $this->options[$key] ?? $default;
9093
}
94+
95+
public function getPath(): ?string
96+
{
97+
return $this->path;
98+
}
9199
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.