Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/MartinGeorgiev/Doctrine/DBAL/Types/BaseIntegerArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ public function transformArrayItemForPHP($item): ?int
return null;
}

$isInvalidPHPInt = !(bool) \preg_match('/^-?\d+$/', (string) $item)
|| (string) $item < $this->getMinValue()
|| (string) $item > $this->getMaxValue();
$stringValue = (string) $item;
$isInvalidPHPInt = !(bool) \preg_match('/^-?\d+$/', $stringValue)
|| $stringValue < $this->getMinValue()
|| $stringValue > $this->getMaxValue();
if ($isInvalidPHPInt) {
throw new ConversionException(\sprintf('Given value of %s content cannot be transformed to valid PHP integer.', \var_export($item, true)));
}
Expand Down
159 changes: 106 additions & 53 deletions src/MartinGeorgiev/Utils/DataStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,78 +13,131 @@
*/
class DataStructure
{
private const POSTGRESQL_EMPTY_ARRAY = '{}';

private const POSTGRESQL_NULL_VALUE = 'null';

/**
* This method supports only single-dimensioned text arrays and
* relays on the default escaping strategy in PostgreSQL (double quotes).
*/
public static function transformPostgresTextArrayToPHPArray(string $postgresArray): array
{
$transform = static function (string $textArrayToTransform): array {
$indicatesMultipleDimensions = \mb_strpos($textArrayToTransform, '},{') !== false
|| \mb_strpos($textArrayToTransform, '{{') === 0;
if ($indicatesMultipleDimensions) {
throw new \InvalidArgumentException('Only single-dimensioned arrays are supported');
}

$phpArray = \str_getcsv(\trim($textArrayToTransform, '{}'), escape: '\\');
foreach ($phpArray as $i => $text) {
if ($text === null) {
unset($phpArray[$i]);
$trimmed = \trim($postgresArray);

break;
}
if ($trimmed === '' || \strtolower($trimmed) === self::POSTGRESQL_NULL_VALUE) {
return [];
}

$isInteger = \is_numeric($text) && ''.(int) $text === $text;
if ($isInteger) {
$phpArray[$i] = (int) $text;
if (\str_contains($trimmed, '},{') || \str_starts_with($trimmed, '{{')) {
throw new \InvalidArgumentException('Only single-dimensioned arrays are supported');
}

continue;
}
if ($trimmed === self::POSTGRESQL_EMPTY_ARRAY) {
return [];
}

$isFloat = \is_numeric($text) && ''.(float) $text === $text;
if ($isFloat) {
$phpArray[$i] = (float) $text;
$jsonArray = '['.\trim($trimmed, '{}').']';

continue;
}
$decoded = \json_decode($jsonArray, true, 512, JSON_BIGINT_AS_STRING);
if ($decoded === null && \json_last_error() !== JSON_ERROR_NONE) {
throw new \InvalidArgumentException('Invalid array format: '.\json_last_error_msg());
}

$phpArray[$i] = \stripslashes(\str_replace('\"', '"', $text));
}

return $phpArray;
};

return $transform($postgresArray);
return \array_map(
static fn ($value): mixed => \is_string($value) ? self::unescapeString($value) : $value,
$decoded

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Parameter #2 $array of function array_map expects array, mixed given.

Check failure on line 49 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Parameter #2 $array of function array_map expects array, mixed given.
);
}

/**
* This method supports only single-dimensioned PHP arrays.
* This method relays on the default escaping strategy in PostgreSQL (double quotes).
*
* @see https://stackoverflow.com/a/5632171/3425372 Kudos to jmz for the inspiration
*/
public static function transformPHPArrayToPostgresTextArray(array $phpArray): string
{
$transform = static function (array $phpArrayToTransform): string {
$result = [];
foreach ($phpArrayToTransform as $text) {
if (\is_array($text)) {
throw new \InvalidArgumentException('Only single-dimensioned arrays are supported');
}

if (\is_numeric($text) || \ctype_digit($text)) {
$escapedText = $text;
} else {
\assert(\is_string($text));
$escapedText = \sprintf('"%s"', \addcslashes($text, '"\\'));
}

$result[] = $escapedText;
}

return '{'.\implode(',', $result).'}';
};

return $transform($phpArray);
if ($phpArray === []) {
return self::POSTGRESQL_EMPTY_ARRAY;
}

if (\array_filter($phpArray, 'is_array')) {
throw new \InvalidArgumentException('Only single-dimensioned arrays are supported');
}

$processed = \array_map(static fn ($value): string => self::formatValue($value), $phpArray);

return '{'.\implode(',', $processed).'}';
}

/**
* Formats a single value for PostgreSQL array.
*/
private static function formatValue(mixed $value): string
{
// Handle null
if ($value === null) {
return 'NULL';
}

// Handle actual numbers
if (\is_int($value) || \is_float($value)) {
return (string) $value;
}

// Convert to string if not already
$stringValue = (string) $value;

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Cannot cast mixed to string.

Check failure on line 88 in src/MartinGeorgiev/Utils/DataStructure.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Cannot cast mixed to string.

// Handle empty string
if ($stringValue === '') {
return '""';
}

if (self::isNumericSimple($stringValue)) {
return '"'.$stringValue.'"';
}

// Double the backslashes and escape quotes
$escaped = \str_replace(
['\\', '"'],
['\\\\', '\"'],
$stringValue
);

return '"'.$escaped.'"';
}

private static function isNumericSimple(string $value): bool
{
// Fast path for obvious numeric strings
if ($value === '' || $value[0] === '"') {
return false;
}

// Handle scientific notation
$lower = \strtolower($value);
if (\str_contains($lower, 'e')) {
$value = \str_replace('e', '', $lower);
}

// Use built-in numeric check
return \is_numeric($value);
}

private static function unescapeString(string $value): string
{
// First handle escaped quotes
$value = \str_replace('\"', '___QUOTE___', $value);

// Handle double backslashes
$value = \str_replace('\\\\', '___DBLBACK___', $value);

// Handle remaining single backslashes
$value = \str_replace('\\', '\\', $value);

// Restore double backslashes
$value = \str_replace('___DBLBACK___', '\\\\', $value);

// Finally restore quotes
return \str_replace('___QUOTE___', '"', $value);
}
}
4 changes: 3 additions & 1 deletion tests/MartinGeorgiev/Doctrine/DBAL/Types/TextArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public static function provideValidTransformations(): array
'phpValue' => [
1,
'2',
3.4,
'5.6',
'text',
'some text here',
'and some here',
Expand All @@ -84,7 +86,7 @@ public static function provideValidTransformations(): array
'and "double-quotes"',
],
'postgresValue' => <<<'END'
{1,2,"text","some text here","and some here","''\"quotes\"'' ain't no \"\"\"worry\"\"\", '''right''' Alexander O'Vechkin?","back-slashing\\double-slashing\\\\hooking though","and \"double-quotes\""}
{1,"2",3.4,"5.6","text","some text here","and some here","''\"quotes\"'' ain't no \"\"\"worry\"\"\", '''right''' Alexander O'Vechkin?","back-slashing\\double-slashing\\\\hooking though","and \"double-quotes\""}
END,
],
];
Expand Down
60 changes: 55 additions & 5 deletions tests/MartinGeorgiev/Utils/DataStructureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,44 @@
*/
public static function provideValidTransformations(): array
{
return [

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM latest + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM latest + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 3.0 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 3.0 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM latest + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.1 + Doctrine ORM 2.14 + Doctrine Lexer 1.2

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 + Doctrine ORM 2.18 + Doctrine Lexer 3.0

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.18 + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.4 + Doctrine ORM 2.14 + Doctrine Lexer 2.1

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.

Check failure on line 46 in tests/MartinGeorgiev/Utils/DataStructureTest.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 + Doctrine ORM latest + Doctrine Lexer latest

Method Tests\MartinGeorgiev\Utils\DataStructureTest::provideValidTransformations() should return list<array{phpValue: array, postgresValue: string}> but returns array{simple integer strings as strings are preserved as strings: array{phpValue: array{'1', '2', '3', '4'}, postgresValue: '{"1","2","3","4"}'}, simple integer strings: array{phpValue: array{1, 2, 3, 4}, postgresValue: '{1,2,3,4}'}, decimal numbers represented as strings are preserved as strings: array{phpValue: array{'1.23', '2.34', '3.45', '4.56'}, postgresValue: '{"1.23","2.34","3…'}, decimal numbers: array{phpValue: array{1.23, 2.34, 3.45, 4.56}, postgresValue: '{1.23,2.34,3.45,4…'}, mixed content with special characters: array{phpValue: array{'dfasdf', 'qw,,e{q"we', '\'qrer\'', 604, '"aaa","b""bb","ccc"'}, postgresValue: '{"dfasdf","qw,,e{q\\…'}, empty strings: array{phpValue: array{'', ''}, postgresValue: '{"",""}'}, empty array: array{phpValue: array{}, postgresValue: '{}'}, scientific notation as strings: array{phpValue: array{'1.23e4', '2.34e5', '3.45e6'}, postgresValue: '{"1.23e4","2.34e5",…'}, ...}.
[
'simple integer strings as strings are preserved as strings' => [
'phpValue' => [
0 => '1',
1 => '2',
2 => '3',
3 => '4',
],
'postgresValue' => '{"1","2","3","4"}',
],
'simple integer strings' => [
'phpValue' => [
0 => 1,
1 => 2,
2 => 3,
3 => 4,
],
'postgresValue' => '{1,2,3,4}',
],
[
'decimal numbers represented as strings are preserved as strings' => [
'phpValue' => [
0 => '1.23',
1 => '2.34',
2 => '3.45',
3 => '4.56',
],
'postgresValue' => '{"1.23","2.34","3.45","4.56"}',
],
'decimal numbers' => [
'phpValue' => [
0 => 1.23,
1 => 2.34,
2 => 3.45,
3 => 4.56,
],
'postgresValue' => '{1.23,2.34,3.45,4.56}',
],
[
'mixed content with special characters' => [
'phpValue' => [
0 => 'dfasdf',
1 => 'qw,,e{q"we',
Expand All @@ -72,17 +90,49 @@
],
'postgresValue' => '{"dfasdf","qw,,e{q\"we","\'qrer\'",604,"\"aaa\",\"b\"\"bb\",\"ccc\""}',
],
[
'empty strings' => [
'phpValue' => [
0 => '',
1 => '',
],
'postgresValue' => '{"",""}',
],
[
'empty array' => [
'phpValue' => [],
'postgresValue' => '{}',
],
'scientific notation as strings' => [
'phpValue' => ['1.23e4', '2.34e5', '3.45e6'],
'postgresValue' => '{"1.23e4","2.34e5","3.45e6"}',
],
'scientific notation with negative exponents' => [
'phpValue' => ['1.23e-4', '2.34e-5', '3.45e-6'],
'postgresValue' => '{"1.23e-4","2.34e-5","3.45e-6"}',
],
'whole floats that look like integers' => [
'phpValue' => ['1.0', '2.00', '3.000', '4.0000'],
'postgresValue' => '{"1.0","2.00","3.000","4.0000"}',
],
'large integers beyond PHP_INT_MAX' => [
'phpValue' => [
'9223372036854775808', // PHP_INT_MAX + 1
'9999999999999999999',
'-9223372036854775809', // PHP_INT_MIN - 1
],
'postgresValue' => '{"9223372036854775808","9999999999999999999","-9223372036854775809"}',
],
'mixed numeric formats' => [
'phpValue' => [
'1.23', // regular float string
1.23, // regular float
'1.230', // float with trailing zeros
'1.23e4', // scientific notation
'1.0', // whole float as string
1.0, // whole float
'9999999999999999999', // large integer
],
'postgresValue' => '{"1.23",1.23,"1.230","1.23e4","1.0",1,"9999999999999999999"}',
],
];
}

Expand Down
Loading