Skip to content

Add StringUtil::joinNonEmpty() #52

Add StringUtil::joinNonEmpty()

Add StringUtil::joinNonEmpty() #52

Triggered via push January 12, 2024 15:01
Status Success
Total duration 42s
Artifacts
Validate composer dependencies
7s
Validate composer dependencies
Normalize composer.json
12s
Normalize composer.json
Fix PHP codestyle with php-cs-fixer
18s
Fix PHP codestyle with php-cs-fixer
Static Code Analysis
19s
Static Code Analysis
Code Coverage
18s
Code Coverage
Mutation Tests
24s
Mutation Tests
Matrix: tests
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Normalize composer.json
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Fix PHP codestyle with php-cs-fixer
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Code Coverage
The following actions uses node12 which is deprecated and will be forced to run on node16: codecov/codecov-action@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Mutation Tests: src/CSVArray.php#L36
Escaped Mutant for Mutator "Continue_": --- Original +++ New @@ @@ $columnHeaders = str_getcsv($firstLine, $delimiter, $enclosure, $escape); foreach ($lines as $index => $line) { if (!StringUtil::hasContent($line)) { - continue; + break; } /** @var array<int, string> $entries */ $entries = str_getcsv($line, $delimiter, $enclosure, $escape);
Mutation Tests: src/QxManager/EmptyRow.php#L11
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ { public function toString() : string { - return implode(QxManagerSampleSheet::DELIMITER, ['No', ...array_fill(0, 16, null)]); + return implode(QxManagerSampleSheet::DELIMITER, ['No', ...array_fill(-1, 16, null)]); } }
Mutation Tests: src/QxManager/EmptyRow.php#L11
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ { public function toString() : string { - return implode(QxManagerSampleSheet::DELIMITER, ['No', ...array_fill(0, 16, null)]); + return implode(QxManagerSampleSheet::DELIMITER, ['No', ...array_fill(1, 16, null)]); } }
Mutation Tests: src/StringUtil.php#L43
Escaped Mutant for Mutator "DecrementInteger": --- Original +++ New @@ @@ return self::shortenMultiPartName($firstname, '-'); } $amountOfDots = strspn($firstname, '.'); - if ($amountOfDots === 2) { + if ($amountOfDots === 1) { /** @var int $dotPosition guaranteed because we know there are two dots */ $dotPosition = strpos($firstname, '.'); $firstPart = Str::substr($firstname, 0, 1) . '.';
Mutation Tests: src/StringUtil.php#L43
Escaped Mutant for Mutator "IncrementInteger": --- Original +++ New @@ @@ return self::shortenMultiPartName($firstname, '-'); } $amountOfDots = strspn($firstname, '.'); - if ($amountOfDots === 2) { + if ($amountOfDots === 3) { /** @var int $dotPosition guaranteed because we know there are two dots */ $dotPosition = strpos($firstname, '.'); $firstPart = Str::substr($firstname, 0, 1) . '.';
Mutation Tests: src/StringUtil.php#L55
Escaped Mutant for Mutator "UnwrapStrToUpper": --- Original +++ New @@ @@ $secondPart = Str::substr($firstname, $startPos, 1) . '.'; return $firstPart . ' ' . $secondPart; } - return strtoupper(Str::substr($firstname, 0, 1)) . '.'; + return Str::substr($firstname, 0, 1) . '.'; } public static function shortenMultiPartName(string $firstname, string $separator) : string {
Mutation Tests: src/StringUtil.php#L58
Escaped Mutant for Mutator "PublicVisibility": --- Original +++ New @@ @@ } return strtoupper(Str::substr($firstname, 0, 1)) . '.'; } - public static function shortenMultiPartName(string $firstname, string $separator) : string + protected static function shortenMultiPartName(string $firstname, string $separator) : string { $firstPart = Str::substr($firstname, 0, 1) . '.'; $afterSeparator = Str::after($firstname, $separator);