Skip to content

Allow custom line separator in CSVArray::toCSV() #1

Allow custom line separator in CSVArray::toCSV()

Allow custom line separator in CSVArray::toCSV() #1

Triggered via pull request January 25, 2024 10:14
Status Success
Total duration 1m 0s
Artifacts

validate.yml

on: pull_request
composer-validate
7s
composer-validate
static-code-analysis
13s
static-code-analysis
code-coverage
26s
code-coverage
mutation-tests
30s
mutation-tests
Matrix: tests
Fit to window
Zoom out
Zoom in

Annotations

8 warnings
code-coverage
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: codecov/codecov-action@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
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);