Skip to content

Commit

Permalink
Merge branch '3.7.x' into 4.0.x
Browse files Browse the repository at this point in the history
* 3.7.x: (24 commits)
  PHPStan 1.10.14, PHPUnit 9.6.7
  Doctrine Coding Standard 12
  Apply `SlevomatCodingStandard.Commenting.AnnotationName` CS rule
  Remove redundant initialization of column options
  Use constants for DBAL types in tests
  Use constants for DBAL types
  Convert private property `Statement::$paramTypeMap` to class constant `PARAM_TYPE_MAP`
  Fix anchor text at `types.rst`
  Add support for SQLite shorthand form in foreign key constraints
  Fix normalizer regex at `DsnParser::parse()`
  fix: @links in comment in Column
  Minor improvement on Psalm typing
  Update docs for `array` and `object` types
  Add `DB2111Platform`
  Replace "magic" values with constants at `DB2Platform`
  Ignore `static-analysis/` in git archives
  Use constants for DBAL types at `DB2Platform::initializeDoctrineTypeMappings()`
  Add line
  Rework
  Update psalm structure
  ...
  • Loading branch information
derrabus committed May 8, 2023
2 parents d12da23 + fd47abd commit 95d093a
Show file tree
Hide file tree
Showing 128 changed files with 1,145 additions and 902 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
/psalm-strict.xml export-ignore
/run-all.sh export-ignore
/SECURITY.md export-ignore
/static-analysis export-ignore
/tests export-ignore
/UPGRADE.md export-ignore
6 changes: 6 additions & 0 deletions ci/github/phpunit/ibm_db2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<var name="db_user" value="db2inst1"/>
<var name="db_password" value="Doctrine2018"/>
<var name="db_dbname" value="doctrine"/>

<var name="tmpdb_driver" value="ibm_db2"/>
<var name="tmpdb_host" value="127.0.0.1"/>
<var name="tmpdb_user" value="db2inst1"/>
<var name="tmpdb_password" value="Doctrine2018"/>
<var name="tmpdb_dbname" value="doctrine"/>
</php>

<testsuites>
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"psr/log": "^1|^2|^3"
},
"require-dev": {
"doctrine/coding-standard": "11.1.0",
"doctrine/coding-standard": "12.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2022.3",
"phpstan/phpstan": "1.10.9",
"phpstan/phpstan": "1.10.14",
"phpstan/phpstan-phpunit": "1.3.11",
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "9.6.6",
"phpunit/phpunit": "9.6.7",
"psalm/plugin-phpunit": "0.18.4",
"squizlabs/php_codesniffer": "3.7.2",
"symfony/cache": "^5.4|^6.0",
Expand Down
9 changes: 9 additions & 0 deletions docs/en/reference/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ using deserialization or ``null`` if no data is present.
properly on vendors not supporting column comments and will fall back to
``text`` type instead.

.. warning::

This type is deprecated since 3.4.0, use :ref:`json` instead.

simple_array
^^^^^^^^^^^^

Expand Down Expand Up @@ -403,6 +407,7 @@ using comma delimited ``explode()`` or ``null`` if no data is present.
This basically means that every array item other than ``string``
will lose its type awareness.

.. _json:
json
^^^^

Expand Down Expand Up @@ -478,6 +483,10 @@ using deserialization or ``null`` if no data is present.
to ``serialize()``/``unserialize()`` and ``base64_encode()``/``base64_decode()`` PHP objects and store
them into a ``text`` field manually.

.. warning::

This type is deprecated since 3.4.0, use :ref:`json` instead.

.. _mappingMatrix:

Mapping Matrix
Expand Down
6 changes: 3 additions & 3 deletions src/Cache/ArrayResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ public function fetchOne(): mixed
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchAllNumeric(): array
{
return FetchUtils::fetchAllNumeric($this);
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchAllAssociative(): array
{
return FetchUtils::fetchAllAssociative($this);
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchFirstColumn(): array
{
Expand Down
2 changes: 2 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ public function getDatabasePlatform(): AbstractPlatform

if (isset($this->params['serverVersion'])) {
$versionProvider = new StaticServerVersionProvider($this->params['serverVersion']);
} elseif (isset($this->params['primary']['serverVersion'])) {
$versionProvider = new StaticServerVersionProvider($this->params['primary']['serverVersion']);
}

$this->platform = $this->driver->getDatabasePlatform($versionProvider);
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
abstract class AbstractMySQLDriver implements Driver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*
* @throws InvalidPlatformVersion
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/IBMDB2/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
final class Driver extends AbstractDB2Driver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/Middleware/AbstractConnectionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getServerVersion(): string
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function getNativeConnection()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/Middleware/AbstractDriverMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(private readonly Driver $wrappedDriver)
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
6 changes: 3 additions & 3 deletions src/Driver/Middleware/AbstractResultMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ public function fetchOne(): mixed
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchAllNumeric(): array
{
return $this->wrappedResult->fetchAllNumeric();
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchAllAssociative(): array
{
return $this->wrappedResult->fetchAllAssociative();
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchFirstColumn(): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/Mysqli/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
final class Driver extends AbstractMySQLDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
6 changes: 3 additions & 3 deletions src/Driver/Mysqli/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,23 @@ public function fetchOne(): mixed
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchAllNumeric(): array
{
return FetchUtils::fetchAllNumeric($this);
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchAllAssociative(): array
{
return FetchUtils::fetchAllAssociative($this);
}

/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function fetchFirstColumn(): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/OCI8/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
final class Driver extends AbstractOracleDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/MySQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
final class Driver extends AbstractMySQLDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/OCI/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
final class Driver extends AbstractOracleDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
final class Driver extends AbstractPostgreSQLDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/SQLSrv/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
final class Driver extends AbstractSQLServerDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PDO/SQLite/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
final class Driver extends AbstractSQLiteDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/PgSQL/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function query(string $sql): Result
return new Result($result);
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function quote(string $value): string
{
$quotedValue = pg_escape_literal($this->connection, $value);
Expand All @@ -88,7 +88,7 @@ public function exec(string $sql): int
return $this->query($sql)->rowCount();
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function lastInsertId(): int|string
{
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

final class Driver extends AbstractPostgreSQLDriver
{
/** {@inheritdoc} */
/** {@inheritDoc} */
public function connect(
#[SensitiveParameter]
array $params,
Expand Down
12 changes: 6 additions & 6 deletions src/Driver/PgSQL/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __destruct()
$this->free();
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function fetchNumeric(): array|false
{
if ($this->result === null) {
Expand All @@ -61,7 +61,7 @@ public function fetchNumeric(): array|false
return $this->mapNumericRow($row, $this->fetchNumericColumnTypes());
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function fetchAssociative(): array|false
{
if ($this->result === null) {
Expand All @@ -76,13 +76,13 @@ public function fetchAssociative(): array|false
return $this->mapAssociativeRow($row, $this->fetchAssociativeColumnTypes());
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function fetchOne(): mixed
{
return FetchUtils::fetchOne($this);
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function fetchAllNumeric(): array
{
if ($this->result === null) {
Expand All @@ -97,7 +97,7 @@ public function fetchAllNumeric(): array
);
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function fetchAllAssociative(): array
{
if ($this->result === null) {
Expand All @@ -112,7 +112,7 @@ public function fetchAllAssociative(): array
);
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function fetchFirstColumn(): array
{
if ($this->result === null) {
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/PgSQL/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __destruct()
);
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function bindValue(int|string $param, mixed $value, ParameterType $type = ParameterType::STRING): void
{
if (! isset($this->parameterMap[$param])) {
Expand All @@ -60,7 +60,7 @@ public function bindValue(int|string $param, mixed $value, ParameterType $type =
$this->parameterTypes[$this->parameterMap[$param]] = $type;
}

/** {@inheritdoc} */
/** {@inheritDoc} */
public function execute(): Result
{
ksort($this->parameters);
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/SQLSrv/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
final class Driver extends AbstractSQLServerDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/SQLite3/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class Driver extends AbstractSQLiteDriver
{
/**
* {@inheritdoc}
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
Expand Down
6 changes: 3 additions & 3 deletions src/Driver/SQLite3/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ public function fetchOne(): mixed
return FetchUtils::fetchOne($this);
}

/** @inheritdoc */
/** @inheritDoc */
public function fetchAllNumeric(): array
{
return FetchUtils::fetchAllNumeric($this);
}

/** @inheritdoc */
/** @inheritDoc */
public function fetchAllAssociative(): array
{
return FetchUtils::fetchAllAssociative($this);
}

/** @inheritdoc */
/** @inheritDoc */
public function fetchFirstColumn(): array
{
return FetchUtils::fetchFirstColumn($this);
Expand Down
Loading

0 comments on commit 95d093a

Please sign in to comment.