Skip to content

Commit ebbb32b

Browse files
committed
Code alignment
Signed-off-by: Joey Smith <jsmith@webinertia.net>
1 parent 264c453 commit ebbb32b

32 files changed

Lines changed: 74 additions & 68 deletions

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"extra": {
2828
"laminas": {
29-
"config-provider": "PhpDb\\Adapter\\Pgsql\\ConfigProvider"
29+
"config-provider": "PhpDb\\Pgsql\\ConfigProvider"
3030
}
3131
},
3232
"require": {
@@ -48,14 +48,14 @@
4848
},
4949
"autoload": {
5050
"psr-4": {
51-
"PhpDb\\Adapter\\Pgsql\\": "src/"
51+
"PhpDb\\Pgsql\\": "src/"
5252
}
5353
},
5454
"autoload-dev": {
5555
"psr-4": {
56-
"PhpDbTest\\Adapter\\Pgsql\\": "test/unit/",
56+
"PhpDbTest\\Pgsql\\": "test/unit/",
5757
"PhpDbTestAsset\\Pgsql\\": "test/asset/",
58-
"PhpDbIntegrationTest\\Adapter\\Pgsql\\": "test/integration/"
58+
"PhpDbIntegrationTest\\Pgsql\\": "test/integration/"
5959
}
6060
},
6161
"scripts": {

phpunit.xml.dist

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
failOnNotice="true"
1414
failOnDeprecation="true"
1515
failOnWarning="true">
16+
17+
<extensions>
18+
<bootstrap class="PhpDbIntegrationTest\Pgsql\Extension\ListenerExtension" />
19+
</extensions>
1620
<testsuites>
1721
<testsuite name="unit test">
1822
<directory>./test/unit</directory>
@@ -29,10 +33,10 @@
2933
</include>
3034
</source>
3135
<php>
32-
<env name="TESTS_PHPDB_ADAPTER_PGSQL" value="true"/>
33-
<env name="TESTS_PHPDB_ADAPTER_PGSQL_HOSTNAME" value="postgresql"/>
34-
<env name="TESTS_PHPDB_ADAPTER_PGSQL_USERNAME" value="postgres"/>
35-
<env name="TESTS_PHPDB_ADAPTER_PGSQL_PASSWORD" value="postgres"/>
36-
<env name="TESTS_PHPDB_ADAPTER_PGSQL_DATABASE" value="phpdb_test"/>
36+
<env name="TESTS_PHPDB_PGSQL" value="true"/>
37+
<env name="TESTS_PHPDB_PGSQL_HOSTNAME" value="postgresql"/>
38+
<env name="TESTS_PHPDB_PGSQL_USERNAME" value="postgres"/>
39+
<env name="TESTS_PHPDB_PGSQL_PASSWORD" value="postgres"/>
40+
<env name="TESTS_PHPDB_PGSQL_DATABASE" value="phpdb_test"/>
3741
</php>
38-
</phpunit>
42+
</phpunit>

src/AdapterPlatform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql;
5+
namespace PhpDb\Pgsql;
66

77
use Override;
88
use PDO;

src/ConfigProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql;
5+
namespace PhpDb\Pgsql;
66

77
use PhpDb\Adapter\AdapterInterface;
88
use PhpDb\Adapter\Driver\ConnectionInterface;
99
use PhpDb\Adapter\Driver\DriverInterface;
1010
use PhpDb\Adapter\Driver\Pdo\Statement as PdoStatement;
1111
use PhpDb\Adapter\Driver\PdoConnectionInterface;
1212
use PhpDb\Adapter\Driver\PdoDriverInterface;
13-
use PhpDb\Adapter\Pgsql\Pdo\Connection as PdoConnection;
14-
use PhpDb\Adapter\Pgsql\Pdo\Driver as PdoDriver;
13+
use PhpDb\Pgsql\Pdo\Connection as PdoConnection;
14+
use PhpDb\Pgsql\Pdo\Driver as PdoDriver;
1515
use PhpDb\Adapter\Platform\PlatformInterface;
1616
use PhpDb\ConfigProvider as PhpDbConfigProvider;
1717
use PhpDb\Metadata\MetadataInterface;

src/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql;
5+
namespace PhpDb\Pgsql;
66

77
use Override;
88
use PgSql\Connection as PgSqlConnection;

src/Container/ConnectionInterfaceFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql\Container;
5+
namespace PhpDb\Pgsql\Container;
66

77
use PhpDb\Adapter\Driver\ConnectionInterface;
88
use PhpDb\Adapter\Exception\InvalidConnectionParametersException;
9-
use PhpDb\Adapter\Pgsql\Connection;
9+
use PhpDb\Pgsql\Connection;
1010
use PhpDb\Adapter\Pgsql\Exception\ContainerException;
1111
use Psr\Container\ContainerInterface;
1212

src/Container/DriverInterfaceFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql\Container;
5+
namespace PhpDb\Pgsql\Container;
66

77
use Laminas\ServiceManager\ServiceManager;
88
use PhpDb\Adapter\Driver\DriverInterface;
9-
use PhpDb\Adapter\Pgsql;
9+
use PhpDb\Pgsql;
1010
use PhpDb\Exception\ContainerException;
1111
use Psr\Container\ContainerInterface;
1212

src/Container/MetadataInterfaceFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql\Container;
5+
namespace PhpDb\Pgsql\Container;
66

77
final class MetadataInterfaceFactory
88
{

src/Container/PdoConnectionInterfaceFactory.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql\Container;
5+
namespace PhpDb\Pgsql\Container;
66

77
use PhpDb\Adapter\AdapterInterface;
88
use PhpDb\Adapter\Driver\PdoConnectionInterface;
99
use PhpDb\Adapter\Exception\InvalidConnectionParametersException;
10-
use PhpDb\Adapter\Pgsql\Exception\ContainerException;
11-
use PhpDb\Adapter\Pgsql\Pdo;
10+
use PhpDb\Exception\ContainerException;
11+
use PhpDb\Pgsql\Pdo;
1212
use Psr\Container\ContainerInterface;
1313

1414
use function is_array;
@@ -29,8 +29,9 @@ public function __invoke(
2929
): PdoConnectionInterface&Pdo\Connection {
3030
if (! $container->has('config')) {
3131
// todo: Once latest PR is merged for 0.5.0 update to use PhpDB\Exception\ContainerException
32-
throw ContainerException::forServiceFailure(
32+
throw ContainerException::forService(
3333
Pdo\Connection::class,
34+
self::class,
3435
'Container is missing a config service'
3536
);
3637
}

src/Container/PdoDriverInterfaceFactory.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpDb\Adapter\Pgsql\Container;
5+
namespace PhpDb\Pgsql\Container;
66

77
use Laminas\ServiceManager\ServiceManager;
88
use PhpDb\Adapter\AdapterInterface;
99
use PhpDb\Adapter\Driver\Pdo\Result;
1010
use PhpDb\Adapter\Driver\Pdo\Statement;
1111
use PhpDb\Adapter\Driver\PdoDriverInterface;
12-
use PhpDb\Adapter\Pgsql\Exception\ContainerException;
13-
use PhpDb\Adapter\Pgsql\Pdo;
12+
use PhpDb\Exception\ContainerException;
13+
use PhpDb\Pgsql\Pdo;
1414
use Psr\Container\ContainerInterface;
1515

1616
/**
@@ -25,8 +25,9 @@ public function __invoke(
2525
): PdoDriverInterface&Pdo\Driver {
2626
if (! $container->has('config')) {
2727
// todo: Once latest PR is merged for 0.5.0 update to use PhpDB\Exception\ContainerException
28-
throw ContainerException::forServiceFailure(
28+
throw ContainerException::forService(
2929
Pdo\Driver::class,
30+
self::class,
3031
'Container is missing a config service'
3132
);
3233
}

0 commit comments

Comments
 (0)