Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore comment hint (useful for enumtype declaration) #6444

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
63429c5
restore comment hint (useful for enumtype declaration)
meiyasan Jun 17, 2024
9c2df18
attempt to fix ci issues
meiyasan Jun 18, 2024
a0273af
fixed native type hint and use preg_match statement in AbstractSchema…
meiyasan Jun 18, 2024
63679e4
reordered use statements + remove useless annotations
meiyasan Jun 18, 2024
25aea71
Merge branch 'doctrine:4.0.x' into 4.0.x
meiyasan Aug 10, 2024
caeb629
fix typo
Lynnaut Aug 31, 2024
d7dc08f
Merge pull request #6514 from Lynnaut/patch-1
greg0ire Sep 1, 2024
ab82363
PDO: Raise a proper exception if user or password is false (#6513)
derrabus Sep 2, 2024
7a82524
Merge branch '3.9.x' into 4.1.x
derrabus Sep 3, 2024
b6eb756
Bump GitHub actions (#6527)
derrabus Sep 30, 2024
8188dd6
ci: Run tests with PHP 8.4 (#6528)
nickvergessen Oct 2, 2024
58c85f0
Mark sidebar as orphan
greg0ire Oct 7, 2024
5188848
Avoid custom directives
greg0ire Oct 7, 2024
6fb2864
Add cli-tools tools document to the TOC
greg0ire Oct 7, 2024
3d9c46c
Setup documentation workflow
greg0ire Oct 7, 2024
5a6ff6f
Fix broken link
greg0ire Oct 7, 2024
aee8c08
Merge pull request #6531 from greg0ire/no-custom-directives
greg0ire Oct 7, 2024
e7202eb
Merge remote-tracking branch 'origin/3.9.x' into 4.1.x
greg0ire Oct 9, 2024
1331d5a
Bump doctrine/.github from 5.1.0 to 5.2.0 (#6534)
dependabot[bot] Oct 9, 2024
1c4fb00
Merge branch '3.9.x' into 4.1.x
derrabus Oct 9, 2024
3098c6b
PHPStan 1.12.6 (#6535)
derrabus Oct 9, 2024
7d93335
CI: remove duplicate key (#6537)
derrabus Oct 9, 2024
dd356be
Merge branch '3.9.x' into 4.1.x
derrabus Oct 9, 2024
db72b7b
Merge branch 'doctrine:4.1.x' into 4.0.x
meiyasan Oct 10, 2024
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ updates:
interval: "weekly"
labels:
- "CI"
target-branch: "3.8.x"
target-branch: "3.9.x"
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.2.0"
27 changes: 27 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
dependencies:
- "highest"
extension:
Expand Down Expand Up @@ -107,6 +108,9 @@ jobs:
- "18"
- "21"
- "23"
include:
- php-version: "8.4"
oracle-version: "23"

services:
oracle:
Expand Down Expand Up @@ -164,6 +168,9 @@ jobs:
- "18"
- "21"
- "23"
include:
- php-version: "8.4"
oracle-version: "23"

services:
oracle:
Expand Down Expand Up @@ -227,6 +234,12 @@ jobs:
postgres-version: "16"
extension: "pgsql"
- php-version: "8.3"
postgres-version: "16"
extension: "pgsql"
- php-version: "8.4"
postgres-version: "16"
extension: "pgsql"
- php-version: "8.4"
postgres-version: "16"
extension: "pdo_pgsql"

Expand Down Expand Up @@ -299,6 +312,12 @@ jobs:
- php-version: "8.3"
mariadb-version: "11.4"
extension: "pdo_mysql"
- php-version: "8.4"
mariadb-version: "11.4"
extension: "mysqli"
- php-version: "8.4"
mariadb-version: "11.4"
extension: "pdo_mysql"

services:
mariadb:
Expand Down Expand Up @@ -381,6 +400,12 @@ jobs:
extension: "pdo_mysql"
custom-entrypoint: >-
--entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON"
- php-version: "8.4"
mysql-version: "9.0"
extension: "mysqli"
- php-version: "8.4"
mysql-version: "9.0"
extension: "pdo_mysql"

services:
mysql:
Expand Down Expand Up @@ -438,6 +463,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
extension:
- "sqlsrv"
- "pdo_sqlsrv"
Expand Down Expand Up @@ -505,6 +531,7 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"

services:
ibm_db2:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Documentation"

on:
pull_request:
branches:
- "*.x"
paths:
- ".github/workflows/documentation.yml"
- "docs/**"
push:
branches:
- "*.x"
paths:
- ".github/workflows/documentation.yml"
- "docs/**"

jobs:
documentation:
name: "Documentation"
uses: "doctrine/.github/.github/workflows/[email protected]"
2 changes: 1 addition & 1 deletion .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: "actions/checkout@v4"

- name: "Release"
uses: "laminas/automatic-releases@1.24.0"
uses: "laminas/automatic-releases@1.25.0"
with:
command-name: "laminas:automatic-releases:release"
env:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"doctrine/coding-standard": "12.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2023.2",
"phpstan/phpstan": "1.12.0",
"phpstan/phpstan": "1.12.6",
"phpstan/phpstan-phpunit": "1.4.0",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "10.5.30",
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ Connect to your Postgres server and run the ``SHOW server_version`` query::
(1 row)

In the example above, ``15.2 (Debian 15.2-1.pgdg110+1)`` is the correct value for
``server Version``.
``serverVersion``.

Other Platforms
^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ We do not currently have specific instructions on how to run a Database
server, but we do recommend Docker as a convenient way to do so.
We do not recommend running against a particular version of the chosen
RDBMS either, as long as you pick one of the
:doc:`officially supported versions <reference/platforms>`.
:doc:`officially supported versions <platforms>`.

Recommendations on Writing Tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
77 changes: 36 additions & 41 deletions docs/en/sidebar.rst
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
.. toc::

.. tocheader:: Reference

.. toctree::
:depth: 3

/reference/introduction
/reference/architecture
/reference/configuration
/reference/data-retrieval-and-manipulation
/reference/query-builder
/reference/transactions
/reference/platforms
/reference/types
/reference/schema-manager
/reference/schema-representation
/reference/security
/reference/supporting-other-databases
/reference/portability
/reference/caching
/reference/known-vendor-issues
/reference/testing

.. toc::

.. tocheader:: Explanation

.. toctree::
:depth: 3

/explanation/implicit-indexes

.. toc::

.. tocheader:: How To

.. toctree::
:depth: 3

/how-to/postgresql-identity-migration
:orphan:

.. toctree::
:caption: Reference
:depth: 3

/reference/introduction
/reference/architecture
/reference/configuration
/reference/data-retrieval-and-manipulation
/reference/query-builder
/reference/transactions
/reference/platforms
/reference/types
/reference/schema-manager
/reference/schema-representation
/reference/security
/reference/supporting-other-databases
/reference/portability
/reference/caching
/reference/known-vendor-issues
/reference/cli-tools
/reference/testing


.. toctree::
:caption: Explanation
:depth: 3

/explanation/implicit-indexes

.. toctree::
:caption: How To
:depth: 3

/how-to/postgresql-identity-migration
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ parameters:
-
message: '~^Parameter #1 \$driverOptions of method Doctrine\\DBAL\\Tests\\Functional\\Driver\\Mysqli\\ConnectionTest\:\:getConnection\(\) expects array<string, mixed>, .* given\.$~'
path: tests/Functional/Driver/Mysqli/ConnectionTest.php
-
message: '~^Parameter #1 \$params of method Doctrine\\DBAL\\Driver\:\:connect\(\) expects array~'
path: tests/Driver/PDO/*/DriverTest.php

# DriverManagerTest::testDatabaseUrl() should be refactored as it's too dynamic.
-
Expand Down
1 change: 1 addition & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
<InvalidArgument>
<errorLevel type="suppress">
<!-- We're testing with invalid input here. -->
<file name="tests/Driver/PDO/*/DriverTest.php"/>
<file name="tests/Functional/Driver/Mysqli/ConnectionTest.php"/>
<file name="tests/Platforms/AbstractPlatformTestCase.php"/>
</errorLevel>
Expand Down
23 changes: 23 additions & 0 deletions src/Driver/PDO/Exception/InvalidConfiguration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Driver\PDO\Exception;

use Doctrine\DBAL\Driver\AbstractException;

use function get_debug_type;
use function sprintf;

/** @psalm-immutable */
final class InvalidConfiguration extends AbstractException
{
public static function notAStringOrNull(string $key, mixed $value): self
{
return new self(sprintf(
'The %s configuration parameter is expected to be either a string or null, got %s.',
$key,
get_debug_type($value),
));
}
}
9 changes: 9 additions & 0 deletions src/Driver/PDO/MySQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
use Doctrine\DBAL\Driver\PDO\Connection;
use Doctrine\DBAL\Driver\PDO\Exception;
use Doctrine\DBAL\Driver\PDO\Exception\InvalidConfiguration;
use PDO;
use PDOException;
use SensitiveParameter;

use function is_string;

final class Driver extends AbstractMySQLDriver
{
/**
Expand All @@ -26,6 +29,12 @@ public function connect(
$driverOptions[PDO::ATTR_PERSISTENT] = true;
}

foreach (['user', 'password'] as $key) {
if (isset($params[$key]) && ! is_string($params[$key])) {
throw InvalidConfiguration::notAStringOrNull($key, $params[$key]);
}
}

$safeParams = $params;
unset($safeParams['password']);

Expand Down
9 changes: 9 additions & 0 deletions src/Driver/PDO/OCI/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
use Doctrine\DBAL\Driver\AbstractOracleDriver;
use Doctrine\DBAL\Driver\PDO\Connection;
use Doctrine\DBAL\Driver\PDO\Exception;
use Doctrine\DBAL\Driver\PDO\Exception\InvalidConfiguration;
use PDO;
use PDOException;
use SensitiveParameter;

use function is_string;

final class Driver extends AbstractOracleDriver
{
/**
Expand All @@ -26,6 +29,12 @@ public function connect(
$driverOptions[PDO::ATTR_PERSISTENT] = true;
}

foreach (['user', 'password'] as $key) {
if (isset($params[$key]) && ! is_string($params[$key])) {
throw InvalidConfiguration::notAStringOrNull($key, $params[$key]);
}
}

$safeParams = $params;
unset($safeParams['password']);

Expand Down
9 changes: 9 additions & 0 deletions src/Driver/PDO/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
use Doctrine\DBAL\Driver\PDO\Connection;
use Doctrine\DBAL\Driver\PDO\Exception;
use Doctrine\DBAL\Driver\PDO\Exception\InvalidConfiguration;
use PDO;
use PDOException;
use SensitiveParameter;

use function is_string;

final class Driver extends AbstractPostgreSQLDriver
{
/**
Expand All @@ -26,6 +29,12 @@
$driverOptions[PDO::ATTR_PERSISTENT] = true;
}

foreach (['user', 'password'] as $key) {
if (isset($params[$key]) && ! is_string($params[$key])) {
throw InvalidConfiguration::notAStringOrNull($key, $params[$key]);

Check warning on line 34 in src/Driver/PDO/PgSQL/Driver.php

View check run for this annotation

Codecov / codecov/patch

src/Driver/PDO/PgSQL/Driver.php#L32-L34

Added lines #L32 - L34 were not covered by tests
}
}

$safeParams = $params;
unset($safeParams['password']);

Expand Down
8 changes: 8 additions & 0 deletions src/Driver/PDO/SQLSrv/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
use Doctrine\DBAL\Driver\Exception;
use Doctrine\DBAL\Driver\PDO\Connection as PDOConnection;
use Doctrine\DBAL\Driver\PDO\Exception as PDOException;
use Doctrine\DBAL\Driver\PDO\Exception\InvalidConfiguration;
use PDO;
use SensitiveParameter;

use function is_int;
use function is_string;
use function sprintf;

final class Driver extends AbstractSQLServerDriver
Expand Down Expand Up @@ -40,6 +42,12 @@ public function connect(
$driverOptions[PDO::ATTR_PERSISTENT] = true;
}

foreach (['user', 'password'] as $key) {
if (isset($params[$key]) && ! is_string($params[$key])) {
throw InvalidConfiguration::notAStringOrNull($key, $params[$key]);
}
}

$safeParams = $params;
unset($safeParams['password']);

Expand Down
Loading
Loading