36 lines
693 B
PHP
36 lines
693 B
PHP
<?php
|
|
namespace Misuzu\URLs;
|
|
|
|
class URLInfo {
|
|
public function __construct(
|
|
private string $name,
|
|
private string $path,
|
|
private array $query,
|
|
private string $fragment
|
|
) {}
|
|
|
|
public function getName(): string {
|
|
return $this->name;
|
|
}
|
|
|
|
public function getPath(): string {
|
|
return $this->path;
|
|
}
|
|
|
|
public function hasQuery(): bool {
|
|
return !empty($this->query);
|
|
}
|
|
|
|
public function getQuery(): array {
|
|
return $this->query;
|
|
}
|
|
|
|
public function hasFragment(): bool {
|
|
return $this->fragment !== '';
|
|
}
|
|
|
|
public function getFragment(): string {
|
|
return $this->fragment;
|
|
}
|
|
}
|