Skip to content

Commit ff463f6

Browse files
committed
Fine tuning Rector configuration
1 parent 9a3f67a commit ff463f6

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

rector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99

1010
return static function (RectorConfig $rectorConfig): void {
1111
$rectorConfig->paths([
12-
__DIR__ . '/examples',
13-
__DIR__ . '/src',
14-
// __DIR__ . '/tests',
12+
__DIR__ . "/examples",
13+
__DIR__ . "/src",
14+
__DIR__ . "/tests",
1515
]);
1616

1717
// register a single rule
1818
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
1919

2020
// define sets of rules
2121
$rectorConfig->sets([
22-
LevelSetList::UP_TO_PHP_81,
22+
LevelSetList::UP_TO_PHP_82,
2323
SetList::DEAD_CODE,
2424
SetList::CODE_QUALITY,
2525
SetList::EARLY_RETURN,

src/Stat.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function mean(array $data): int|float|null
4141
if (self::count($data) === 0) {
4242
throw new InvalidDataInputException("The data must not be empty.");
4343
}
44-
if (array_filter($data, "is_string") !== []) {
44+
if (array_filter($data, is_string(...)) !== []) {
4545
throw new InvalidDataInputException(
4646
"The data array contains a string.",
4747
);
@@ -77,7 +77,7 @@ public static function fmean(
7777

7878
// Unweighted mean
7979
if ($weights === null) {
80-
$sum = array_sum(array_map("floatval", $data));
80+
$sum = array_sum(array_map(floatval(...), $data));
8181
$count = count($data);
8282
if ($precision) {
8383
return round($sum / $count, $precision);
@@ -336,7 +336,7 @@ public static function pstdev(array $data, ?int $round = null): float
336336
public static function pvariance(array $data, ?int $round = null): float
337337
{
338338
$num_of_elements = self::count($data);
339-
if ($num_of_elements == 0) {
339+
if ($num_of_elements === 0) {
340340
throw new InvalidDataInputException("The data must not be empty.");
341341
}
342342
$sumSquareDifferences = 0.0;

0 commit comments

Comments
 (0)