chore: complete update
This commit is contained in:
30
.archive/Optimized/TemplateAnalysis.php
Normal file
30
.archive/Optimized/TemplateAnalysis.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Archive\Optimized;
|
||||
|
||||
/**
|
||||
* Template-Analyse-Ergebnisse
|
||||
*/
|
||||
final class TemplateAnalysis
|
||||
{
|
||||
public array $staticBlocks = [];
|
||||
public array $dynamicBlocks = [];
|
||||
public array $dependencies = [];
|
||||
public array $optimizations = [];
|
||||
public CacheStrategy $cacheStrategy = CacheStrategy::DYNAMIC;
|
||||
|
||||
public function getComplexity(): int
|
||||
{
|
||||
return count($this->staticBlocks) + count($this->dynamicBlocks) * 2;
|
||||
}
|
||||
|
||||
public function isCacheable(): bool
|
||||
{
|
||||
return $this->cacheStrategy !== CacheStrategy::DYNAMIC;
|
||||
}
|
||||
|
||||
public function hasFragments(): bool
|
||||
{
|
||||
return count($this->staticBlocks) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user