Add EngineVersionInformation insight
This commit is contained in:
27
src/Analysis/ProjectZomboid/EngineVersionInformation.php
Normal file
27
src/Analysis/ProjectZomboid/EngineVersionInformation.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace IndifferentKetchup\Codex\Analysis\ProjectZomboid;
|
||||
|
||||
use IndifferentKetchup\Codex\Analysis\Information;
|
||||
use IndifferentKetchup\Codex\Analysis\PatternInsightInterface;
|
||||
use IndifferentKetchup\Codex\Pattern\ProjectZomboid\DebugServerPattern;
|
||||
|
||||
class EngineVersionInformation extends Information implements PatternInsightInterface
|
||||
{
|
||||
public static function getPatterns(): array
|
||||
{
|
||||
return [DebugServerPattern::VERSION];
|
||||
}
|
||||
|
||||
public function setMatches(array $matches, mixed $patternKey): void
|
||||
{
|
||||
$this->setLabel('Engine version');
|
||||
$this->setValue(sprintf(
|
||||
'%s (build %s, %s %s)',
|
||||
$matches['version'],
|
||||
$matches['hash'],
|
||||
$matches['date'],
|
||||
$matches['time']
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user