- Move 12 markdown files from root to docs/ subdirectories - Organize documentation by category: • docs/troubleshooting/ (1 file) - Technical troubleshooting guides • docs/deployment/ (4 files) - Deployment and security documentation • docs/guides/ (3 files) - Feature-specific guides • docs/planning/ (4 files) - Planning and improvement proposals Root directory cleanup: - Reduced from 16 to 4 markdown files in root - Only essential project files remain: • CLAUDE.md (AI instructions) • README.md (Main project readme) • CLEANUP_PLAN.md (Current cleanup plan) • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements) This improves: ✅ Documentation discoverability ✅ Logical organization by purpose ✅ Clean root directory ✅ Better maintainability
59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\Http;
|
|
|
|
final readonly class Query
|
|
{
|
|
public function __construct(
|
|
private array $query
|
|
) {
|
|
}
|
|
|
|
public function get(string $key, ?string $default = null): ?string
|
|
{
|
|
return $this->query[$key] ?? $default;
|
|
}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return $this->query;
|
|
}
|
|
|
|
public function has(string $key): bool
|
|
{
|
|
return isset($this->query[$key]);
|
|
}
|
|
|
|
public function getBool(string $key, bool $default = false): bool
|
|
{
|
|
$value = $this->get($key);
|
|
if ($value === null) {
|
|
return $default;
|
|
}
|
|
|
|
return filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
|
}
|
|
|
|
public function getInt(string $key, int $default = 0): int
|
|
{
|
|
$value = $this->get($key);
|
|
if ($value === null) {
|
|
return $default;
|
|
}
|
|
|
|
return (int) $value;
|
|
}
|
|
|
|
public function getFloat(string $key, float $default = 0.0): float
|
|
{
|
|
$value = $this->get($key);
|
|
if ($value === null) {
|
|
return $default;
|
|
}
|
|
|
|
return (float) $value;
|
|
}
|
|
}
|