Skip to content

Commit

Permalink
Merge pull request #202 from kitloong/feature/dbal-pdo
Browse files Browse the repository at this point in the history
Use doctrine dbal connection
  • Loading branch information
kitloong authored Feb 8, 2024
2 parents e4805aa + 323cba2 commit dcc02a1
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 384 deletions.
1 change: 0 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<file>tests</file>

<exclude-pattern>tests/resources/database/migrations/*.php</exclude-pattern>
<exclude-pattern>src/DBAL/PDO/*</exclude-pattern>

<rule ref="PSR12">
<exclude name="Generic.Files.LineLength"/>
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ parameters:

excludePaths:
- ./*/*/FileToBeExcluded.php
- ./src/DBAL/PDO/*

checkMissingIterableValueType: true
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</include>
<exclude>
<directory>src/DBAL/Types</directory>
<directory>src/DBAL/PDO</directory>
</exclude>
</source>
</phpunit>
27 changes: 0 additions & 27 deletions src/DBAL/PDO/Concerns/ConnectsToDatabase.php

This file was deleted.

186 changes: 0 additions & 186 deletions src/DBAL/PDO/Connection.php

This file was deleted.

19 changes: 19 additions & 0 deletions src/DBAL/PDO/ConnectsToDatabase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace KitLoong\MigrationsGenerator\DBAL\PDO;

use Doctrine\DBAL\Driver\Connection as DriverConnection;
use Doctrine\DBAL\Driver\PDO\Connection;

trait ConnectsToDatabase
{
/**
* Create a new database connection.
*
* @param mixed[] $params
*/
public function connect(array $params): DriverConnection
{
return new Connection($params['pdo']);
}
}
1 change: 0 additions & 1 deletion src/DBAL/PDO/MySqlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace KitLoong\MigrationsGenerator\DBAL\PDO;

use Doctrine\DBAL\Driver\AbstractMySQLDriver;
use KitLoong\MigrationsGenerator\DBAL\PDO\Concerns\ConnectsToDatabase;

class MySqlDriver extends AbstractMySQLDriver
{
Expand Down
1 change: 0 additions & 1 deletion src/DBAL/PDO/PostgresDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace KitLoong\MigrationsGenerator\DBAL\PDO;

use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
use KitLoong\MigrationsGenerator\DBAL\PDO\Concerns\ConnectsToDatabase;

class PostgresDriver extends AbstractPostgreSQLDriver
{
Expand Down
1 change: 0 additions & 1 deletion src/DBAL/PDO/SQLiteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace KitLoong\MigrationsGenerator\DBAL\PDO;

use Doctrine\DBAL\Driver\AbstractSQLiteDriver;
use KitLoong\MigrationsGenerator\DBAL\PDO\Concerns\ConnectsToDatabase;

class SQLiteDriver extends AbstractSQLiteDriver
{
Expand Down
Loading

0 comments on commit dcc02a1

Please sign in to comment.