diff options
Diffstat (limited to 'src/URL.php')
-rw-r--r-- | src/URL.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/URL.php b/src/URL.php index 689332f..a6d6379 100644 --- a/src/URL.php +++ b/src/URL.php | |||
@@ -12,6 +12,13 @@ class URL implements Stringable | |||
12 | private array $params; | 12 | private array $params; |
13 | private string $anchor = ''; | 13 | private string $anchor = ''; |
14 | 14 | ||
15 | public function __construct(array $gets = [], string $anchor = ''){ | ||
16 | $this->params = $gets; | ||
17 | if($anchor != ''){ | ||
18 | $this->setAnchor($anchor); | ||
19 | } | ||
20 | } | ||
21 | |||
15 | // setters statiques | 22 | // setters statiques |
16 | static public function setProtocol(string $protocol = 'http'): void | 23 | static public function setProtocol(string $protocol = 'http'): void |
17 | { | 24 | { |
@@ -39,14 +46,7 @@ class URL implements Stringable | |||
39 | { | 46 | { |
40 | self::$path = '/' . ltrim($path, '/'); | 47 | self::$path = '/' . ltrim($path, '/'); |
41 | } | 48 | } |
42 | 49 | ||
43 | public function __construct(array $gets = [], string $anchor = ''){ | ||
44 | $this->params = $gets; | ||
45 | if($anchor != ''){ | ||
46 | $this->setAnchor($anchor); | ||
47 | } | ||
48 | } | ||
49 | |||
50 | //setters normaux | 50 | //setters normaux |
51 | public function addParams(array $gets): void | 51 | public function addParams(array $gets): void |
52 | { | 52 | { |