Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 0 additions & 6 deletions .ci/pgsql_fixtures.sh

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
postgres:
image: postgres
env:
POSTGRES_USER: 'gha'
POSTGRES_PASSWORD: 'password'
POSTGRES_DB: 'phpdb_test'
options: >-
Expand All @@ -42,4 +41,4 @@ jobs:
--health-timeout 5s
--health-retries 3
ports:
- 5432
- 5432
29 changes: 0 additions & 29 deletions .laminas-ci/phpunit.xml

This file was deleted.

17 changes: 0 additions & 17 deletions .laminas-ci/pre-install.sh

This file was deleted.

22 changes: 0 additions & 22 deletions .laminas-ci/pre-run.sh

This file was deleted.

8 changes: 4 additions & 4 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ services:
volumes:
- ./:/var/www/html
depends_on:
- postgresql
- postgres

postgresql:
postgres:
build:
context: ./
dockerfile: docker/databases/postgresql/Dockerfile
dockerfile: docker/databases/postgres/Dockerfile
args:
- VERSION=${VERSION:-17.4}
- ALPINE_VERSION=${ALPINE_VERSION:-3.21}
Expand All @@ -30,4 +30,4 @@ services:
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
start_period: 80s
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"extra": {
"laminas": {
"config-provider": "PhpDb\\Adapter\\Pgsql\\ConfigProvider"
"config-provider": "PhpDb\\Pgsql\\ConfigProvider"
}
},
"require": {
Expand All @@ -48,14 +48,14 @@
},
"autoload": {
"psr-4": {
"PhpDb\\Adapter\\Pgsql\\": "src/"
"PhpDb\\Pgsql\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"PhpDbTest\\Adapter\\Pgsql\\": "test/unit/",
"PhpDbTest\\Pgsql\\": "test/unit/",
"PhpDbTestAsset\\Pgsql\\": "test/asset/",
"PhpDbIntegrationTest\\Adapter\\Pgsql\\": "test/integration/"
"PhpDbIntegrationTest\\Pgsql\\": "test/integration/"
}
},
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
parameters:
ignoreErrors:
-
message: '#^PHPDoc tag @throws with type PhpDb\\Adapter\\Exception\\InvalidConnectionParametersException\|PhpDb\\Adapter\\Pgsql\\Exception\\ContainerException is not subtype of Throwable$#'
identifier: throws.notThrowable
count: 1
path: src/Container/ConnectionInterfaceFactory.php

-
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, array\<int\|string, string\>\> given\.$#'
identifier: argument.type
Expand Down
16 changes: 10 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
failOnNotice="true"
failOnDeprecation="true"
failOnWarning="true">

<extensions>
<bootstrap class="PhpDbIntegrationTest\Pgsql\Extension\ListenerExtension" />
</extensions>
<testsuites>
<testsuite name="unit test">
<directory>./test/unit</directory>
Expand All @@ -29,10 +33,10 @@
</include>
</source>
<php>
<env name="TESTS_PHPDB_ADAPTER_PGSQL" value="true"/>
<env name="TESTS_PHPDB_ADAPTER_PGSQL_HOSTNAME" value="postgresql"/>
<env name="TESTS_PHPDB_ADAPTER_PGSQL_USERNAME" value="postgres"/>
<env name="TESTS_PHPDB_ADAPTER_PGSQL_PASSWORD" value="postgres"/>
<env name="TESTS_PHPDB_ADAPTER_PGSQL_DATABASE" value="phpdb_test"/>
<env name="TESTS_PHPDB_PGSQL" value="true"/>
<env name="TESTS_PHPDB_PGSQL_HOSTNAME" value="postgres"/>
<env name="TESTS_PHPDB_PGSQL_USERNAME" value="postgres"/>
<env name="TESTS_PHPDB_PGSQL_PASSWORD" value="password"/>
<env name="TESTS_PHPDB_PGSQL_DATABASE" value="phpdb_test"/>
</php>
</phpunit>
</phpunit>
2 changes: 1 addition & 1 deletion src/AdapterPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql;
namespace PhpDb\Pgsql;

use Override;
use PDO;
Expand Down
6 changes: 3 additions & 3 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql;
namespace PhpDb\Pgsql;

use PhpDb\Adapter\AdapterInterface;
use PhpDb\Adapter\Driver\ConnectionInterface;
use PhpDb\Adapter\Driver\DriverInterface;
use PhpDb\Adapter\Driver\Pdo\Statement as PdoStatement;
use PhpDb\Adapter\Driver\PdoConnectionInterface;
use PhpDb\Adapter\Driver\PdoDriverInterface;
use PhpDb\Adapter\Pgsql\Pdo\Connection as PdoConnection;
use PhpDb\Adapter\Pgsql\Pdo\Driver as PdoDriver;
use PhpDb\Adapter\Platform\PlatformInterface;
use PhpDb\ConfigProvider as PhpDbConfigProvider;
use PhpDb\Metadata\MetadataInterface;
use PhpDb\Pgsql\Pdo\Connection as PdoConnection;
use PhpDb\Pgsql\Pdo\Driver as PdoDriver;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql;
namespace PhpDb\Pgsql;

use Override;
use PgSql\Connection as PgSqlConnection;
Expand Down
4 changes: 2 additions & 2 deletions src/Container/ConnectionInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

use PhpDb\Adapter\Driver\ConnectionInterface;
use PhpDb\Adapter\Exception\InvalidConnectionParametersException;
use PhpDb\Adapter\Pgsql\Connection;
use PhpDb\Adapter\Pgsql\Exception\ContainerException;
use PhpDb\Pgsql\Connection;
use Psr\Container\ContainerInterface;

use function is_array;
Expand Down
4 changes: 2 additions & 2 deletions src/Container/DriverInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

use Laminas\ServiceManager\ServiceManager;
use PhpDb\Adapter\Driver\DriverInterface;
use PhpDb\Adapter\Pgsql;
use PhpDb\Exception\ContainerException;
use PhpDb\Pgsql;
use Psr\Container\ContainerInterface;

final class DriverInterfaceFactory
Expand Down
2 changes: 1 addition & 1 deletion src/Container/MetadataInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

final class MetadataInterfaceFactory
{
Expand Down
9 changes: 5 additions & 4 deletions src/Container/PdoConnectionInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

use PhpDb\Adapter\AdapterInterface;
use PhpDb\Adapter\Driver\PdoConnectionInterface;
use PhpDb\Adapter\Exception\InvalidConnectionParametersException;
use PhpDb\Adapter\Pgsql\Exception\ContainerException;
use PhpDb\Adapter\Pgsql\Pdo;
use PhpDb\Exception\ContainerException;
use PhpDb\Pgsql\Pdo;
use Psr\Container\ContainerInterface;

use function is_array;
Expand All @@ -29,8 +29,9 @@ public function __invoke(
): PdoConnectionInterface&Pdo\Connection {
if (! $container->has('config')) {
// todo: Once latest PR is merged for 0.5.0 update to use PhpDB\Exception\ContainerException
throw ContainerException::forServiceFailure(
throw ContainerException::forService(
Pdo\Connection::class,
self::class,
'Container is missing a config service'
);
}
Expand Down
9 changes: 5 additions & 4 deletions src/Container/PdoDriverInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

use Laminas\ServiceManager\ServiceManager;
use PhpDb\Adapter\AdapterInterface;
use PhpDb\Adapter\Driver\Pdo\Result;
use PhpDb\Adapter\Driver\Pdo\Statement;
use PhpDb\Adapter\Driver\PdoDriverInterface;
use PhpDb\Adapter\Pgsql\Exception\ContainerException;
use PhpDb\Adapter\Pgsql\Pdo;
use PhpDb\Exception\ContainerException;
use PhpDb\Pgsql\Pdo;
use Psr\Container\ContainerInterface;

/**
Expand All @@ -25,8 +25,9 @@ public function __invoke(
): PdoDriverInterface&Pdo\Driver {
if (! $container->has('config')) {
// todo: Once latest PR is merged for 0.5.0 update to use PhpDB\Exception\ContainerException
throw ContainerException::forServiceFailure(
throw ContainerException::forService(
Pdo\Driver::class,
self::class,
'Container is missing a config service'
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Container/PdoStatementFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

use PhpDb\Adapter\Driver\Pdo\Statement as PdoStatement;
use PhpDb\Adapter\Driver\StatementInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Container/PlatformInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

use PhpDb\Adapter\Pgsql;
use PhpDb\Adapter\Platform\PlatformInterface;
use PhpDb\Exception\ContainerException;
use PhpDb\Pgsql;
use Psr\Container\ContainerInterface;

final class PlatformInterfaceFactory
Expand Down
4 changes: 2 additions & 2 deletions src/Container/StatementInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Container;
namespace PhpDb\Pgsql\Container;

use PhpDb\Adapter\Driver\StatementInterface;
use PhpDb\Adapter\Pgsql;
use PhpDb\Pgsql;
use Psr\Container\ContainerInterface;

final class StatementInterfaceFactory
Expand Down
2 changes: 1 addition & 1 deletion src/DatabasePlatformNameTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql;
namespace PhpDb\Pgsql;

use PhpDb\Adapter\Driver\DriverInterface;
use PhpDb\Adapter\Exception\InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion src/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql;
namespace PhpDb\Pgsql;

use Override;
use PgSql\Result as PgSqlResult;
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Metadata;
namespace PhpDb\Pgsql\Metadata;

use DateTime;
use Override;
Expand Down
2 changes: 1 addition & 1 deletion src/Pdo/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PhpDb\Adapter\Pgsql\Pdo;
namespace PhpDb\Pgsql\Pdo;

use Override;
use PDO;
Expand Down
Loading