You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the above code you can parse and get public suffix informations about any valid domain name.
74
+
Using the above code you can parse any valid domain name.
85
75
86
-
### Manipulating the domain name
87
-
88
-
The `Pdp\Domain` returned by the `Pdp\Rules::resolve` method is an immutable value object representing a valid domain name. This object let's you access all the domain name properties as well as the public suffix informations attached to it using the following methods.
76
+
The returned `Pdp\Domain` object is an immutable value object representing a valid domain name. This object let's you access the domain properties.
89
77
90
78
~~~php
91
79
public function Domain::__toString(): string
92
80
public function Domain::getContent(): ?string
93
-
public function Domain::getPublicSuffix(): ?string
94
-
public function Domain::getRegistrableDomain(): ?string
95
-
public function Domain::getSubDomain(); ?string
96
81
public function Domain::getLabel(int $key): ?string
97
82
public function Domain::keys(?string $label): int[]
83
+
public function Domain::toAscii(): self
84
+
public function Domain::toUnicode(): self
98
85
public function Domain::isResolvable(): bool;
86
+
~~~
87
+
88
+
as well as its public suffix informations attached to it by the `Pdp\Rules::resolve` method.
89
+
90
+
~~~php
91
+
public function Domain::getPublicSuffix(): ?string
92
+
public function Domain::getRegistrableDomain(): ?string
93
+
public function Domain::getSubDomain(); ?string
99
94
public function Domain::isKnown(): bool;
100
95
public function Domain::isICANN(): bool;
101
96
public function Domain::isPrivate(): bool;
102
97
~~~
103
98
104
-
*The getter methods returns normalized and lowercased domain labels or `null` if no value was found for a particular domain part.*
99
+
*The getter methods return normalized and lowercased domain labels or `null` if no value was found for a particular domain part.*
105
100
106
-
The `Pdp\Domain` object also implements PHP's `Countable` and `IteratorAggregate`interfaces to ease counting and iterating over the domain labels as well as PHP's `JsonSerializable` interfaces to output a JSON array with all the useful informations regarding the domain name.
101
+
The `Pdp\Domain` object also implements PHP's `Countable`, `IteratorAggregate` and `JsonSerializable` interfaces to ease retrieving the object properties.
107
102
108
-
Once you have a `Pdp\Domain` object can also modify its content using the following methods:
103
+
Once you have a `Pdp\Domain` object you can also modify its content using the following methods:
109
104
110
105
~~~php
111
-
public function Domain::toAscii(): self
112
-
public function Domain::toUnicode(): self
113
-
public function Domain::withPublicSuffix($publicSuffix): self
114
-
public function Domain::withSubDomain($subDomain): self
115
106
public function Domain::withLabel(int $key, $label): self
116
107
public function Domain::withoutLabel(int $key, int ...$keys): self
117
108
public function Domain::resolve($publicSuffix): self
109
+
public function Domain::withPublicSuffix($publicSuffix): self
110
+
public function Domain::withSubDomain($subDomain): self
118
111
~~~
119
112
120
113
Because the `Pdp\Domain` object is immutable:
@@ -123,37 +116,40 @@ Because the `Pdp\Domain` object is immutable:
123
116
- If a modification is not possible a `Pdp\Exception` exception is thrown.
124
117
125
118
~~~php
126
-
$manager = new Manager(new Cache(), new CurlHttpClient());
0 commit comments