Add integration tests for string related expressions #1997
Annotations
10 warnings
src/adapter/etl-adapter-avro/src/Flow/ETL/Adapter/Avro/FlixTech/ValueConverter.php#L38
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
foreach ($data as $entry => $value) {
$avroType = $this->type($entry);
if ($avroType !== null && \is_array($avroType[\AvroSchema::TYPE_ATTR])) {
- if ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::LONG_TYPE && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
+ if ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] !== \AvroSchema::LONG_TYPE && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
$convertedData[$entry] = \DateTimeImmutable::createFromFormat('U.u', \implode('.', \str_split((string) $value, 10)));
} elseif ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::ARRAY_SCHEMA && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType[\AvroSchema::TYPE_ATTR]) && $avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
$convertedData[$entry] = \array_map(static fn(int $timestamp): \DateTimeImmutable => \DateTimeImmutable::createFromFormat('U.u', \implode('.', \str_split((string) $timestamp, 10))), $value);
|
src/adapter/etl-adapter-avro/src/Flow/ETL/Adapter/Avro/FlixTech/ValueConverter.php#L38
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
foreach ($data as $entry => $value) {
$avroType = $this->type($entry);
if ($avroType !== null && \is_array($avroType[\AvroSchema::TYPE_ATTR])) {
- if ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::LONG_TYPE && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
+ if (($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::LONG_TYPE || \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType)) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
$convertedData[$entry] = \DateTimeImmutable::createFromFormat('U.u', \implode('.', \str_split((string) $value, 10)));
} elseif ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::ARRAY_SCHEMA && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType[\AvroSchema::TYPE_ATTR]) && $avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
$convertedData[$entry] = \array_map(static fn(int $timestamp): \DateTimeImmutable => \DateTimeImmutable::createFromFormat('U.u', \implode('.', \str_split((string) $timestamp, 10))), $value);
|
src/adapter/etl-adapter-avro/src/Flow/ETL/Adapter/Avro/FlixTech/ValueConverter.php#L40
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
foreach ($data as $entry => $value) {
$avroType = $this->type($entry);
if ($avroType !== null && \is_array($avroType[\AvroSchema::TYPE_ATTR])) {
- if ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::LONG_TYPE && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
+ if ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::LONG_TYPE && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] !== 'timestamp-micros') {
$convertedData[$entry] = \DateTimeImmutable::createFromFormat('U.u', \implode('.', \str_split((string) $value, 10)));
} elseif ($avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::TYPE_ATTR] === \AvroSchema::ARRAY_SCHEMA && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType[\AvroSchema::TYPE_ATTR]) && $avroType[\AvroSchema::TYPE_ATTR][\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
$convertedData[$entry] = \array_map(static fn(int $timestamp): \DateTimeImmutable => \DateTimeImmutable::createFromFormat('U.u', \implode('.', \str_split((string) $timestamp, 10))), $value);
|
src/adapter/etl-adapter-avro/src/Flow/ETL/Adapter/Avro/FlixTech/ValueConverter.php#L58
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
$convertedData[$entry] = $value;
}
} else {
- if ($avroType[\AvroSchema::TYPE_ATTR] === \AvroSchema::LONG_TYPE && \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
+ if (($avroType[\AvroSchema::TYPE_ATTR] === \AvroSchema::LONG_TYPE || \array_key_exists(\AvroSchema::LOGICAL_TYPE_ATTR, $avroType)) && $avroType[\AvroSchema::LOGICAL_TYPE_ATTR] === 'timestamp-micros') {
$convertedData[$entry] = \DateTimeImmutable::createFromFormat('U.u', \implode('.', \str_split((string) $value, 10)));
} else {
$convertedData[$entry] = $value;
|
src/adapter/etl-adapter-avro/src/Flow/ETL/Adapter/Avro/FlixTech/ValueConverter.php#L72
Escaped Mutant for Mutator "ArrayOneItem":
--- Original
+++ New
@@ @@
}
}
}
- return $convertedData;
+ return count($convertedData) > 1 ? array_slice($convertedData, 0, 1, true) : $convertedData;
}
private function type(string $entry) : ?array
{
|
src/adapter/etl-adapter-chartjs/src/Flow/ETL/Adapter/ChartJS/Chart/BarChart.php#L51
Escaped Mutant for Mutator "CastString":
--- Original
+++ New
@@ @@
{
foreach ($rows as $row) {
/** @phpstan-ignore-next-line */
- $this->data['labels'][] = (string) $row->valueOf($this->label);
+ $this->data['labels'][] = $row->valueOf($this->label);
foreach ($this->datasets as $dataset) {
if (!\array_key_exists($dataset->name(), $this->data['datasets'])) {
$this->data['datasets'][$dataset->name()] = ['label' => $dataset->name(), 'data' => [$row->valueOf($dataset)]];
|
src/adapter/etl-adapter-doctrine/src/Flow/ETL/Adapter/Doctrine/Pages.php#L15
Escaped Mutant for Mutator "RoundingFamily":
--- Original
+++ New
@@ @@
}
public function pages() : int
{
- return (int) \ceil($this->total / $this->pageSize);
+ return (int) round($this->total / $this->pageSize);
}
}
|
src/adapter/etl-adapter-google-sheet/src/Flow/ETL/Adapter/GoogleSheet/Columns.php#L20
Escaped Mutant for Mutator "PregMatchRemoveFlags":
--- Original
+++ New
@@ @@
if ('' === $sheetName) {
throw new InvalidArgumentException('Sheet name can\'t be empty');
}
- if (!\preg_match('/^[A-Z]+$/u', $startColumn)) {
+ if (!\preg_match('/^[A-Z]+$/', $startColumn)) {
throw new InvalidArgumentException(\sprintf('The column `%s` needs to contain only letters.', $startColumn));
}
if (!\preg_match('/^[A-Z]+$/u', $endColumn)) {
|
src/adapter/etl-adapter-google-sheet/src/Flow/ETL/Adapter/GoogleSheet/Columns.php#L24
Escaped Mutant for Mutator "PregMatchRemoveFlags":
--- Original
+++ New
@@ @@
if (!\preg_match('/^[A-Z]+$/u', $startColumn)) {
throw new InvalidArgumentException(\sprintf('The column `%s` needs to contain only letters.', $startColumn));
}
- if (!\preg_match('/^[A-Z]+$/u', $endColumn)) {
+ if (!\preg_match('/^[A-Z]+$/', $endColumn)) {
throw new InvalidArgumentException(\sprintf('The column `%s` needs to contain only letters.', $endColumn));
}
if ($endColumn < $startColumn) {
|
src/adapter/etl-adapter-google-sheet/src/Flow/ETL/Adapter/GoogleSheet/GoogleSheetExtractor.php#L32
Escaped Mutant for Mutator "LessThanOrEqualTo":
--- Original
+++ New
@@ @@
*/
public function __construct(private readonly Sheets $service, private readonly string $spreadsheetId, private readonly Columns $columnRange, private readonly bool $withHeader, private readonly int $rowsInBatch, private readonly string $rowEntryName = 'row', private readonly array $options = [])
{
- if ($this->rowsInBatch <= 0) {
+ if ($this->rowsInBatch < 0) {
throw new InvalidArgumentException('Rows in batch must be greater than 0');
}
}
|
The logs for this run have expired and are no longer available.
Loading