File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010return 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 ,
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments