@@ -42,7 +42,8 @@ You need:
42
42
43
43
## Usage
44
44
45
- ** If you are upgrading from version 5 please check the [ upgrading guide] ( UPGRADING.md ) for known issues.**
45
+ > [ !WARNING]
46
+ > If you are upgrading from version 5 please check the [ upgrading guide] ( UPGRADING.md ) for known issues.
46
47
47
48
### Resolving Domains
48
49
@@ -116,9 +117,10 @@ These methods resolve the domain against their respective data source using
116
117
the same rules as the ` resolve ` method but will instead throw an exception
117
118
if no valid effective TLD is found or if the submitted domain is invalid.
118
119
119
- ** All these methods expect as their sole argument a ` Pdp\Host ` implementing
120
+ > [ !CAUTION]
121
+ > All these methods expect as their sole argument a ` Pdp\Host ` implementing
120
122
object, but other types (ie: ` string ` , ` null ` and stringable objects) are
121
- supported with predefined conditions as explained in the remaining document.**
123
+ supported with predefined conditions as explained in the remaining document.
122
124
123
125
~~~ php
124
126
<?php
@@ -158,23 +160,18 @@ To instantiate each domain resolver you can use the following named constructor:
158
160
159
161
** If the instantiation does not work an exception will be thrown.**
160
162
161
- ** WARNING:**
162
-
163
- ** You SHOULD never resolve domain name this way in production, without, at
164
- least, a caching mechanism to reduce external resource downloads.**
165
-
166
- ** Using the Public Suffix List to determine what is a valid domain name and what
163
+ > [ !WARNING]
164
+ > You SHOULD never resolve domain name this way in production, without, at
165
+ least, a caching mechanism to reduce external resource downloads.
166
+ > Using the Public Suffix List to determine what is a valid domain name and what
167
167
isn't is dangerous, and MAY lead to errors because of new gTLDs being registered
168
- on a regular basis.**
169
-
170
- ** If you are looking to know the validity of a Top Level Domain, you MUST use
168
+ on a regular basis.
169
+ > If you are looking to know the validity of a Top Level Domain, you MUST use
171
170
the IANA Top Level Domain List as the proper source for this information or
172
- alternatively the DNS.**
173
-
174
- ** If you MUST use this library for any of the above purposes, you SHOULD consider
175
- integrating an updating mechanism into your software.**
176
-
177
- ** For more information go to the [ Managing external data source section] ( #managing-the-package-external-resources ) **
171
+ alternatively the DNS.
172
+ > If you MUST use this library for any of the above purposes, you SHOULD consider
173
+ integrating an updating mechanism into your software.
174
+ > For more information go to the [ Managing external data source section] ( #managing-the-package-external-resources ) **
178
175
179
176
### Resolved domain information.
180
177
@@ -221,10 +218,11 @@ echo $altResult->domain()->toString(); //display 'foo.bar.test.example';
221
218
$altResult->suffix()->isKnown(); //return false;
222
219
~~~
223
220
224
- ** TIP: Always favor submitting a ` Pdp\Suffix ` object rather that any other
221
+ > [ !TIP]
222
+ > Always favor submitting a ` Pdp\Suffix ` object rather that any other
225
223
supported type to avoid unexpected results. By default, if the input is not a
226
224
` Pdp\Suffix ` instance, the resulting public suffix will be labelled as
227
- being unknown. For more information go to the [ Public Suffix section] ( #public-suffix ) **
225
+ being unknown. For more information go to the [ Public Suffix section] ( #public-suffix )
228
226
229
227
### Domain Suffix
230
228
@@ -340,7 +338,8 @@ $newDomain->clear()->labels(); //return []
340
338
echo $domain->slice(2)->toString(); //display 'www'
341
339
~~~
342
340
343
- ** WARNING: Because of its definition, a domain name can be ` null ` or a string.**
341
+ > [ !WARNING]
342
+ > Because of its definition, a domain name can be ` null ` or a string.
344
343
345
344
To distinguish this possibility the object exposes two (2) formatting methods
346
345
` Domain::value ` which can be ` null ` or a ` string ` and ` Domain::toString ` which
@@ -397,8 +396,9 @@ is done via two (2) named constructors:
397
396
At any given moment the ` Pdp\Domain ` instance can tell you whether it is in
398
397
` ASCII ` mode or not.
399
398
400
- ** Once instantiated there's no way to tell which algorithm is used to convert
401
- the object from ascii to unicode and vice-versa**
399
+ > [ !WARNING]
400
+ > Once instantiated there's no way to tell which algorithm is used to convert
401
+ the object from ascii to unicode and vice-versa
402
402
403
403
~~~ php
404
404
use Pdp\Domain;
@@ -420,10 +420,11 @@ echo $asciiDomain->value(); // display 'fass.de'
420
420
$asciiDomain->isAscii(); // returns true
421
421
~~~
422
422
423
- ** TIP: Always favor submitting a ` Pdp\Domain ` object for resolution rather that a
423
+ > [ !TIP]
424
+ > Always favor submitting a ` Pdp\Domain ` object for resolution rather that a
424
425
string or an object that can be cast to a string to avoid unexpected format
425
426
conversion errors/results. By default, and with lack of information conversion
426
- is done using IDNA 2008 rules.**
427
+ is done using IDNA 2008 rules.
427
428
428
429
### Managing the package external resources
429
430
@@ -470,7 +471,8 @@ on packagist.
470
471
471
472
#### Refreshing the resource using the provided factories
472
473
473
- ** THIS IS THE RECOMMENDED WAY OF USING THE LIBRARY**
474
+ > [ !NOTE]
475
+ > THIS IS THE RECOMMENDED WAY OF USING THE LIBRARY
474
476
475
477
For the purpose of this example we will use our PSR powered solution with:
476
478
@@ -527,12 +529,14 @@ $publicSuffixList = $pslStorage->get(PsrStorageFactory::PUBLIC_SUFFIX_LIST_URI);
527
529
$topLevelDomains = $rzdStorage->get(PsrStorageFactory::TOP_LEVEL_DOMAIN_LIST_URI);
528
530
~~~
529
531
530
- ** Be sure to adapt the following code to your own application.
532
+ > [ !NOTE]
533
+ > Be sure to adapt the following code to your own application.
531
534
The following code is an example given without warranty of it working
532
- out of the box.**
535
+ out of the box.
533
536
534
- ** You should use your dependency injection container to avoid repeating this
535
- code in your application.**
537
+ > [ !WARNING]
538
+ > You should use your dependency injection container to avoid repeating this
539
+ code in your application.
536
540
537
541
### Automatic Updates
538
542
0 commit comments