Skip to content

Commit

Permalink
IBX-9413: Corrected incorrect type, changed how to retrieve variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszdebinski committed Jan 21, 2025
1 parent 67ece93 commit 8fa46ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/bundle/SystemInfo/EzcSystemInfoWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, string>|null
*/
public ?array $phpVersion;

public ?ezcSystemInfoAccelerator $phpAccelerator;

Expand All @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -60,7 +60,7 @@ public function testCollect(): void

self::assertEquals(
new PhpSystemInfo([
'version' => $this->ezcSystemInfoMock->phpVersion,
'version' => implode('.', $this->ezcSystemInfoMock->phpVersion),

Check failure on line 63 in tests/bundle/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php

View workflow job for this annotation

GitHub Actions / Tests (7.4)

Parameter #2 $pieces of function implode expects array, array<int, string>|null given.
'acceleratorEnabled' => $this->ezcSystemInfoMock->phpAccelerator->isEnabled,
'acceleratorName' => $this->ezcSystemInfoMock->phpAccelerator->name,
'acceleratorURL' => $this->ezcSystemInfoMock->phpAccelerator->url,
Expand Down

0 comments on commit 8fa46ed

Please sign in to comment.