docs: consolidate documentation into organized structure

- 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
This commit is contained in:
2025-10-05 11:05:04 +02:00
parent 887847dde6
commit 5050c7d73a
36686 changed files with 196456 additions and 12398919 deletions

View File

@@ -0,0 +1,108 @@
<?php
declare(strict_types=1);
namespace App\Framework\Performance\Entity;
use App\Framework\Core\ValueObjects\Byte;
use App\Framework\Core\ValueObjects\Duration;
use App\Framework\Database\Migration\MigrationVersion;
use App\Framework\Performance\PerformanceCategory;
use DateTimeImmutable;
final readonly class PerformanceMetric
{
public function __construct(
public ?int $id,
public string $operationId,
public string $operationType,
public PerformanceCategory $category,
public ?MigrationVersion $migrationVersion,
public Duration $executionTime,
public Byte $memoryStart,
public Byte $memoryEnd,
public Byte $memoryPeak,
public Byte $memoryDelta,
public bool $success,
public ?string $errorMessage,
public ?array $metadata,
public DateTimeImmutable $createdAt,
public ?DateTimeImmutable $updatedAt = null
) {
}
public static function fromPerformanceSnapshot(
string $operationId,
string $operationType,
PerformanceCategory $category,
Duration $executionTime,
Byte $memoryStart,
Byte $memoryEnd,
Byte $memoryPeak,
Byte $memoryDelta,
bool $success = true,
?string $errorMessage = null,
?MigrationVersion $migrationVersion = null,
?array $metadata = null
): self {
return new self(
id: null,
operationId: $operationId,
operationType: $operationType,
category: $category,
migrationVersion: $migrationVersion,
executionTime: $executionTime,
memoryStart: $memoryStart,
memoryEnd: $memoryEnd,
memoryPeak: $memoryPeak,
memoryDelta: $memoryDelta,
success: $success,
errorMessage: $errorMessage,
metadata: $metadata,
createdAt: new DateTimeImmutable(),
updatedAt: null
);
}
public function toArray(): array
{
return [
'id' => $this->id,
'operation_id' => $this->operationId,
'operation_type' => $this->operationType,
'category' => $this->category->value,
'migration_version' => $this->migrationVersion?->toString(),
'execution_time_ms' => $this->executionTime->toMilliseconds(),
'memory_start_bytes' => $this->memoryStart->toBytes(),
'memory_end_bytes' => $this->memoryEnd->toBytes(),
'memory_peak_bytes' => $this->memoryPeak->toBytes(),
'memory_delta_bytes' => $this->memoryDelta->toBytes(),
'success' => $this->success,
'error_message' => $this->errorMessage,
'metadata' => $this->metadata ? json_encode($this->metadata) : null,
'created_at' => $this->createdAt->format('Y-m-d H:i:s'),
'updated_at' => $this->updatedAt?->format('Y-m-d H:i:s'),
];
}
public static function fromArray(array $data): self
{
return new self(
id: $data['id'] ?? null,
operationId: $data['operation_id'],
operationType: $data['operation_type'],
category: PerformanceCategory::from($data['category']),
migrationVersion: $data['migration_version'] ? MigrationVersion::fromTimestamp($data['migration_version']) : null,
executionTime: Duration::fromMilliseconds($data['execution_time_ms']),
memoryStart: Byte::fromBytes($data['memory_start_bytes']),
memoryEnd: Byte::fromBytes($data['memory_end_bytes']),
memoryPeak: Byte::fromBytes($data['memory_peak_bytes']),
memoryDelta: Byte::fromBytes($data['memory_delta_bytes']),
success: (bool) $data['success'],
errorMessage: $data['error_message'],
metadata: $data['metadata'] ? json_decode($data['metadata'], true) : null,
createdAt: new DateTimeImmutable($data['created_at']),
updatedAt: $data['updated_at'] ? new DateTimeImmutable($data['updated_at']) : null
);
}
}