diff --git a/src/bundle/SystemInfo/EzcSystemInfoWrapper.php b/src/bundle/SystemInfo/EzcSystemInfoWrapper.php index 66a86d1..2053f5b 100644 --- a/src/bundle/SystemInfo/EzcSystemInfoWrapper.php +++ b/src/bundle/SystemInfo/EzcSystemInfoWrapper.php @@ -28,14 +28,16 @@ class EzcSystemInfoWrapper public ?float $cpuSpeed; - /** @var int */ public ?int $memorySize; public ?string $lineSeparator; public ?string $backupFileName; - public ?string $phpVersion; + /** + * @var array|null + */ + public ?array $phpVersion; public ?ezcSystemInfoAccelerator $phpAccelerator; @@ -50,7 +52,7 @@ public function __construct() return; } - foreach (array_keys(get_object_vars($this)) as $var) { + foreach (array_keys(get_class_vars(self::class)) as $var) { $this->$var = $ezcSystemInfo->$var; } } diff --git a/tests/bundle/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php b/tests/bundle/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php index cbf7d87..fbb1482 100644 --- a/tests/bundle/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php +++ b/tests/bundle/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php @@ -30,7 +30,7 @@ protected function setUp(): void ->getMockBuilder(EzcSystemInfoWrapper::class) ->disableOriginalConstructor() ->getMock(); - $this->ezcSystemInfoMock->phpVersion = PHP_VERSION; + $this->ezcSystemInfoMock->phpVersion = explode('.', PHP_VERSION); $this->ezcSystemInfoMock->phpAccelerator = $this ->getMockBuilder(ezcSystemInfoAccelerator::class) @@ -60,7 +60,7 @@ public function testCollect(): void self::assertEquals( new PhpSystemInfo([ - 'version' => $this->ezcSystemInfoMock->phpVersion, + 'version' => implode('.', $this->ezcSystemInfoMock->phpVersion), 'acceleratorEnabled' => $this->ezcSystemInfoMock->phpAccelerator->isEnabled, 'acceleratorName' => $this->ezcSystemInfoMock->phpAccelerator->name, 'acceleratorURL' => $this->ezcSystemInfoMock->phpAccelerator->url,