chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace Archive\Archived;
final readonly class TemplateContent
{
public function __construct(
public string $rawTemplate,
public bool $hasUserSpecificContent = false,
public bool $hasSessionData = false,
public bool $hasFormElements = false,
public bool $hasTimeBasedContent = false,
public bool $hasRandomContent = false,
public bool $hasCsrfTokens = false,
public array $dynamicVariables = [],
public array $staticBlocks = [],
) {}
public function hasDynamicContent(): bool
{
return $this->hasUserSpecificContent
|| $this->hasSessionData
|| $this->hasFormElements
|| $this->hasTimeBasedContent
|| $this->hasRandomContent
|| $this->hasCsrfTokens
|| !empty($this->dynamicVariables);
}
public function getDynamicContentTypes(): array
{
$types = [];
if ($this->hasUserSpecificContent) $types[] = 'user_specific';
if ($this->hasSessionData) $types[] = 'session_data';
if ($this->hasFormElements) $types[] = 'form_elements';
if ($this->hasTimeBasedContent) $types[] = 'time_based';
if ($this->hasRandomContent) $types[] = 'random_content';
if ($this->hasCsrfTokens) $types[] = 'csrf_tokens';
return $types;
}
public function getCharacteristics(): array
{
return [
'has_dynamic_content' => $this->hasDynamicContent(),
'dynamic_types' => $this->getDynamicContentTypes(),
'dynamic_variables_count' => count($this->dynamicVariables),
'static_blocks_count' => count($this->staticBlocks),
'template_size' => strlen($this->rawTemplate),
];
}
}