Skip to content

Commit 42ff0fd

Browse files
authored
Generate the property type for generated objects (#1467)
1 parent eaf29e8 commit 42ff0fd

12 files changed

+84
-0
lines changed

src/Exception/StatementTimeoutException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ final class StatementTimeoutException extends ClientException
1212
{
1313
/**
1414
* The database connection ID that executed the SQL statement.
15+
*
16+
* @var int|null
1517
*/
1618
private $dbConnectionId;
1719

src/Result/BatchExecuteStatementResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class BatchExecuteStatementResponse extends Result
1515
{
1616
/**
1717
* The execution results of each batch entry.
18+
*
19+
* @var UpdateResult[]
1820
*/
1921
private $updateResults;
2022

src/Result/BeginTransactionResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class BeginTransactionResponse extends Result
1212
{
1313
/**
1414
* The transaction ID of the transaction started by the call.
15+
*
16+
* @var string|null
1517
*/
1618
private $transactionId;
1719

src/Result/CommitTransactionResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class CommitTransactionResponse extends Result
1212
{
1313
/**
1414
* The status of the commit operation.
15+
*
16+
* @var string|null
1517
*/
1618
private $transactionStatus;
1719

src/Result/ExecuteStatementResponse.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@ class ExecuteStatementResponse extends Result
1515
{
1616
/**
1717
* The records returned by the SQL statement. This field is blank if the `formatRecordsAs` parameter is set to `JSON`.
18+
*
19+
* @var Field[][]
1820
*/
1921
private $records;
2022

2123
/**
2224
* Metadata for the columns included in the results. This field is blank if the `formatRecordsAs` parameter is set to
2325
* `JSON`.
26+
*
27+
* @var ColumnMetadata[]
2428
*/
2529
private $columnMetadata;
2630

2731
/**
2832
* The number of records updated by the request.
33+
*
34+
* @var int|null
2935
*/
3036
private $numberOfRecordsUpdated;
3137

@@ -36,6 +42,8 @@ class ExecuteStatementResponse extends Result
3642
* href="https://www.postgresql.org/docs/10/dml-returning.html">Returning Data From Modified Rows</a>
3743
* in the PostgreSQL documentation.</p> </note>
3844
* ```.
45+
*
46+
* @var Field[]
3947
*/
4048
private $generatedFields;
4149

@@ -45,6 +53,8 @@ class ExecuteStatementResponse extends Result
4553
*
4654
* The size limit for this field is currently 10 MB. If the JSON-formatted string representing the result set requires
4755
* more than 10 MB, the call returns an error.
56+
*
57+
* @var string|null
4858
*/
4959
private $formattedRecords;
5060

src/Result/RollbackTransactionResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class RollbackTransactionResponse extends Result
1212
{
1313
/**
1414
* The status of the rollback operation.
15+
*
16+
* @var string|null
1517
*/
1618
private $transactionStatus;
1719

src/ValueObject/ArrayValue.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,36 @@ final class ArrayValue
99
{
1010
/**
1111
* An array of Boolean values.
12+
*
13+
* @var bool[]|null
1214
*/
1315
private $booleanValues;
1416

1517
/**
1618
* An array of integers.
19+
*
20+
* @var int[]|null
1721
*/
1822
private $longValues;
1923

2024
/**
2125
* An array of floating-point numbers.
26+
*
27+
* @var float[]|null
2228
*/
2329
private $doubleValues;
2430

2531
/**
2632
* An array of strings.
33+
*
34+
* @var string[]|null
2735
*/
2836
private $stringValues;
2937

3038
/**
3139
* An array of arrays.
40+
*
41+
* @var ArrayValue[]|null
3242
*/
3343
private $arrayValues;
3444

src/ValueObject/ColumnMetadata.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,71 +9,99 @@ final class ColumnMetadata
99
{
1010
/**
1111
* The name of the column.
12+
*
13+
* @var string|null
1214
*/
1315
private $name;
1416

1517
/**
1618
* The type of the column.
19+
*
20+
* @var int|null
1721
*/
1822
private $type;
1923

2024
/**
2125
* The database-specific data type of the column.
26+
*
27+
* @var string|null
2228
*/
2329
private $typeName;
2430

2531
/**
2632
* The label for the column.
33+
*
34+
* @var string|null
2735
*/
2836
private $label;
2937

3038
/**
3139
* The name of the schema that owns the table that includes the column.
40+
*
41+
* @var string|null
3242
*/
3343
private $schemaName;
3444

3545
/**
3646
* The name of the table that includes the column.
47+
*
48+
* @var string|null
3749
*/
3850
private $tableName;
3951

4052
/**
4153
* A value that indicates whether the column increments automatically.
54+
*
55+
* @var bool|null
4256
*/
4357
private $isAutoIncrement;
4458

4559
/**
4660
* A value that indicates whether an integer column is signed.
61+
*
62+
* @var bool|null
4763
*/
4864
private $isSigned;
4965

5066
/**
5167
* A value that indicates whether the column contains currency values.
68+
*
69+
* @var bool|null
5270
*/
5371
private $isCurrency;
5472

5573
/**
5674
* A value that indicates whether the column is case-sensitive.
75+
*
76+
* @var bool|null
5777
*/
5878
private $isCaseSensitive;
5979

6080
/**
6181
* A value that indicates whether the column is nullable.
82+
*
83+
* @var int|null
6284
*/
6385
private $nullable;
6486

6587
/**
6688
* The precision value of a decimal number column.
89+
*
90+
* @var int|null
6791
*/
6892
private $precision;
6993

7094
/**
7195
* The scale value of a decimal number column.
96+
*
97+
* @var int|null
7298
*/
7399
private $scale;
74100

75101
/**
76102
* The type of the column.
103+
*
104+
* @var int|null
77105
*/
78106
private $arrayBaseColumnType;
79107

src/ValueObject/Field.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,50 @@ final class Field
99
{
1010
/**
1111
* A NULL value.
12+
*
13+
* @var bool|null
1214
*/
1315
private $isNull;
1416

1517
/**
1618
* A value of Boolean data type.
19+
*
20+
* @var bool|null
1721
*/
1822
private $booleanValue;
1923

2024
/**
2125
* A value of long data type.
26+
*
27+
* @var int|null
2228
*/
2329
private $longValue;
2430

2531
/**
2632
* A value of double data type.
33+
*
34+
* @var float|null
2735
*/
2836
private $doubleValue;
2937

3038
/**
3139
* A value of string data type.
40+
*
41+
* @var string|null
3242
*/
3343
private $stringValue;
3444

3545
/**
3646
* A value of BLOB data type.
47+
*
48+
* @var string|null
3749
*/
3850
private $blobValue;
3951

4052
/**
4153
* An array of values.
54+
*
55+
* @var ArrayValue|null
4256
*/
4357
private $arrayValue;
4458

src/ValueObject/ResultSetOptions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ final class ResultSetOptions
1818
*
1919
* > Conversion to Double or Long can result in roundoff errors due to precision loss. We recommend converting to
2020
* > String, especially when working with currency values.
21+
*
22+
* @var DecimalReturnType::*|null
2123
*/
2224
private $decimalReturnType;
2325

2426
/**
2527
* A value that indicates how a field of `LONG` type is represented. Allowed values are `LONG` and `STRING`. The default
2628
* is `LONG`. Specify `STRING` if the length or precision of numeric values might cause truncation or rounding errors.
29+
*
30+
* @var LongReturnType::*|null
2731
*/
2832
private $longReturnType;
2933

0 commit comments

Comments
 (0)