Skip to content

Commit e0bec66

Browse files
committed
chore(rector): automated refactoring
1 parent e036a60 commit e0bec66

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
__DIR__ . '/src',
4848
__DIR__ . '/tools',
4949
])
50+
->withSkipPath(__DIR__ . '/vendor')
5051
->withPhpVersion(PhpVersion::PHP_82)
5152
->withCache(
5253
sys_get_temp_dir() . '/rector',

tests/src/Engine/V1/EngineTestCase.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
namespace GlpiPlugin\Carbon\Tests\Engine\V1;
3434

35+
use Generator;
3536
use GlpiPlugin\Carbon\Tests\DbTestCase;
3637

3738
abstract class EngineTestCase extends DbTestCase
@@ -42,17 +43,17 @@ abstract class EngineTestCase extends DbTestCase
4243
protected static string $type_class = '';
4344
protected static string $model_class = '';
4445

45-
abstract public function getEnergyPerDayProvider(): \Generator;
46+
abstract public function getEnergyPerDayProvider(): Generator;
4647

47-
abstract public function getCarbonEmissionPerDateProvider(): \Generator;
48+
abstract public function getCarbonEmissionPerDateProvider(): Generator;
4849

4950
/**
5051
* The delta for comparison of computed emission with expected value,
5152
* as == for float must not be used because of float representation.
5253
*/
5354
public const EPSILON = 0.001;
5455

55-
public function getPowerProvider(): \Generator
56+
public function getPowerProvider(): Generator
5657
{
5758
$item = $this->createItem(static::$itemtype_class);
5859
$engine = new static::$engine_class($item);

tests/src/GlobalFixture.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static function loadDataset()
129129
// ini_set('auto_detect_line_endings', true);
130130
$file = dirname(__DIR__) . '/fixtures/carbon_intensity.csv';
131131
if (($handle = fopen($file, 'r')) === false) {
132-
fwrite(STDOUT, sprintf('Failed to open carbon intensity dataset CSV file' . PHP_EOL));
132+
fwrite(STDOUT, 'Failed to open carbon intensity dataset CSV file' . PHP_EOL);
133133
exit(1);
134134
}
135135
while (($row = fgetcsv($handle, 256, ',', '"', '\\')) !== false) {
@@ -147,7 +147,7 @@ public static function loadDataset()
147147
];
148148
$count = (new DbUtils())->countElementsInTable($intensity_table, $condition);
149149
if ($count !== 3648) {
150-
fwrite(STDOUT, sprintf('Failed to load carbon intensity dataset' . PHP_EOL));
150+
fwrite(STDOUT, 'Failed to load carbon intensity dataset' . PHP_EOL);
151151
exit(1);
152152
}
153153

0 commit comments

Comments
 (0)