fix: phpstan level=6

This commit is contained in:
origami11@yandex.ru 2025-10-06 12:49:36 +03:00
parent acbf2c847d
commit 48269bd424
41 changed files with 324 additions and 347 deletions

View file

@ -3,26 +3,23 @@
namespace ctiso;
class Url {
public $parts = [];
/** @var Url */
public $parent;
/** @var array<string, string> */
public array $parts = [];
public ?Url $parent;
function __construct() {
}
function setParent($parent) {
function setParent($parent): void {
$this->parent = $parent;
}
function setQuery($parts) {
function setQuery($parts): void {
$this->parts = $parts;
}
function addQueryParam($key, $value) {
function addQueryParam(string $key, string $value): void {
$this->parts[$key] = $value;
}
function toString() {
function toString(): string {
return '?' . http_build_query(array_merge($this->parts, $this->parent ? $this->parent->parts : []));
}
}