Skip to content

Commit 4461b27

Browse files
committed
Adding DomainHostInteraface::isSubdomainOf and DomainHostInteraface::hasSubdomain methods
1 parent 5f17077 commit 4461b27

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ All Notable changes to `League\Uri\Interfaces` will be documented in this file
1010
- `QueryExtractMode` and `QueryComposeMode` Enum to improve query parsing and building.
1111
- Added support for `BackedEnum`
1212
- `FragmentDirective::toFragmentValue`
13+
- `DomainHostInteraface::isSubdomainOf`
14+
- `DomainHostInteraface::hasSubdomain`
1315

1416
### Fixed
1517

Contracts/DomainHostInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace League\Uri\Contracts;
1515

16+
use BackedEnum;
1617
use Countable;
1718
use Iterator;
1819
use IteratorAggregate;
@@ -21,6 +22,9 @@
2122

2223
/**
2324
* @extends IteratorAggregate<string>
25+
*
26+
* @method bool isSubdomainOf(BackedEnum|Stringable|string|null $parentHost) Tells whether the current domain instance is a subdomain of the parent host.
27+
* @method bool hasSubdomain(BackedEnum|Stringable|string|null $childHost) Tells whether the submitted host is a subdomain of the current instance.
2428
*/
2529
interface DomainHostInterface extends Countable, HostInterface, IteratorAggregate
2630
{

0 commit comments

Comments
 (0)