Skip to content

Commit

Permalink
fix-cs
Browse files Browse the repository at this point in the history
  • Loading branch information
reithor committed Dec 10, 2024
1 parent 1c739fc commit b41308b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bundle/Core/Command/ReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,12 @@ private function getPhpPath()
private function getNumberOfCPUCores()
{
$cores = 1;
if (isset($_SERVER['PLATFORM_BRANCH']) && is_file( '/run/config.json')) {
if (isset($_SERVER['PLATFORM_BRANCH']) && is_file('/run/config.json')) {
// Ibexa Cloud: read #cpus from config
$config_json_encoded = file_get_contents('/run/config.json');
$config_json = json_decode($config_json_encoded);

Check failure on line 456 in src/bundle/Core/Command/ReindexCommand.php

View workflow job for this annotation

GitHub Actions / Unit tests & SQLite integration tests (7.4)

Parameter #1 $json of function json_decode expects string, string|false given.

Check failure on line 456 in src/bundle/Core/Command/ReindexCommand.php

View workflow job for this annotation

GitHub Actions / Unit tests & SQLite integration tests (8.0)

Parameter #1 $json of function json_decode expects string, string|false given.

Check failure on line 456 in src/bundle/Core/Command/ReindexCommand.php

View workflow job for this annotation

GitHub Actions / Unit tests & SQLite integration tests (8.1)

Parameter #1 $json of function json_decode expects string, string|false given.
$cores = isset($config_json->info->limits->cpu) ? max(1, floor($config_json->info->limits->cpu)) : 1;

return $cores;

Check failure on line 459 in src/bundle/Core/Command/ReindexCommand.php

View workflow job for this annotation

GitHub Actions / Unit tests & SQLite integration tests (7.4)

Method Ibexa\Bundle\Core\Command\ReindexCommand::getNumberOfCPUCores() should return int but returns float|int.

Check failure on line 459 in src/bundle/Core/Command/ReindexCommand.php

View workflow job for this annotation

GitHub Actions / Unit tests & SQLite integration tests (8.0)

Method Ibexa\Bundle\Core\Command\ReindexCommand::getNumberOfCPUCores() should return int but returns float|int.

Check failure on line 459 in src/bundle/Core/Command/ReindexCommand.php

View workflow job for this annotation

GitHub Actions / Unit tests & SQLite integration tests (8.1)

Method Ibexa\Bundle\Core\Command\ReindexCommand::getNumberOfCPUCores() should return int but returns float|int.
} elseif (is_file('/proc/cpuinfo')) {
// Linux (and potentially Windows with linux sub systems)
Expand Down

0 comments on commit b41308b

Please sign in to comment.