Skip to content

Commit d54b3d0

Browse files
authored
Merge pull request #5842 from derrabus/bugfix/restore-offset-constant
Restore `Connection::ARRAY_PARAM_OFFSET`
2 parents 7e0d352 + 8a36759 commit d54b3d0

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/ArrayParameterType.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,17 @@ final class ArrayParameterType
77
/**
88
* Represents an array of ints to be expanded by Doctrine SQL parsing.
99
*/
10-
public const INTEGER = ParameterType::INTEGER + self::ARRAY_PARAM_OFFSET;
10+
public const INTEGER = ParameterType::INTEGER + Connection::ARRAY_PARAM_OFFSET;
1111

1212
/**
1313
* Represents an array of strings to be expanded by Doctrine SQL parsing.
1414
*/
15-
public const STRING = ParameterType::STRING + self::ARRAY_PARAM_OFFSET;
15+
public const STRING = ParameterType::STRING + Connection::ARRAY_PARAM_OFFSET;
1616

1717
/**
1818
* Represents an array of ascii strings to be expanded by Doctrine SQL parsing.
1919
*/
20-
public const ASCII = ParameterType::ASCII + self::ARRAY_PARAM_OFFSET;
21-
22-
/**
23-
* Offset by which PARAM_* constants are detected as arrays of the param type.
24-
*/
25-
private const ARRAY_PARAM_OFFSET = 100;
20+
public const ASCII = ParameterType::ASCII + Connection::ARRAY_PARAM_OFFSET;
2621

2722
/**
2823
* @internal
@@ -33,7 +28,7 @@ final class ArrayParameterType
3328
*/
3429
public static function toElementParameterType(int $type): int
3530
{
36-
return $type - self::ARRAY_PARAM_OFFSET;
31+
return $type - Connection::ARRAY_PARAM_OFFSET;
3732
}
3833

3934
private function __construct()

src/Connection.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ class Connection
6969
*/
7070
public const PARAM_ASCII_STR_ARRAY = ArrayParameterType::ASCII;
7171

72+
/**
73+
* Offset by which PARAM_* constants are detected as arrays of the param type.
74+
*
75+
* @internal Should be used only within the wrapper layer.
76+
*/
77+
public const ARRAY_PARAM_OFFSET = 100;
78+
7279
/**
7380
* The wrapped driver connection.
7481
*

0 commit comments

Comments
 (0)