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
76 changes: 46 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 0 additions & 72 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,6 @@ parameters:
count: 1
path: src/Connection.php

-
message: '#^PHPDoc tag @var for variable \$connectionInstance contains unknown class PhpDb\\Mysql\\Driver\\ConnectionInterface\.$#'
identifier: class.notFound
count: 1
path: src/Container/DriverInterfaceFactory.php

-
message: '#^PHPDoc tag @var for variable \$resultInstance contains unknown class PhpDb\\Mysql\\Driver\\ResultInterface\.$#'
identifier: class.notFound
count: 1
path: src/Container/DriverInterfaceFactory.php

-
message: '#^PHPDoc tag @var for variable \$statementInstance contains unknown class PhpDb\\Mysql\\Driver\\StatementInterface\.$#'
identifier: class.notFound
count: 1
path: src/Container/DriverInterfaceFactory.php

-
message: '#^Instanceof between PhpDb\\Mysql\\Connection and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
Expand Down Expand Up @@ -186,42 +168,6 @@ parameters:
count: 1
path: src/Statement.php

-
message: '#^Call to an undefined method PhpDb\\Mysql\\Driver\:\:quoteValue\(\)\.$#'
identifier: method.notFound
count: 2
path: test/integration/AdapterPlatformTest.php

-
message: '#^Parameter \#1 \$connection of class PhpDb\\Mysql\\Driver constructor expects PhpDb\\Mysql\\Connection, PDO given\.$#'
identifier: argument.type
count: 1
path: test/integration/AdapterPlatformTest.php

-
message: '#^Parameter \#1 \$connection of class PhpDb\\Mysql\\Driver constructor expects PhpDb\\Mysql\\Connection, mysqli given\.$#'
identifier: argument.type
count: 1
path: test/integration/AdapterPlatformTest.php

-
message: '#^Parameter \#2 \$statementPrototype of class PhpDb\\Mysql\\Driver constructor expects PhpDb\\Mysql\\Statement, PhpDb\\Adapter\\Driver\\Pdo\\Statement given\.$#'
identifier: argument.type
count: 1
path: test/integration/AdapterPlatformTest.php

-
message: '#^Property PhpDbIntegrationTest\\Mysql\\Platform\\AdapterPlatformTest\:\:\$adapters \(array\<string, mysqli\|PDO\>\) does not accept array\<string, mysqli\|PDO\|PhpDb\\Mysql\\Connection\>\.$#'
identifier: assign.propertyType
count: 1
path: test/integration/AdapterPlatformTest.php

-
message: '#^Property PhpDbIntegrationTest\\Mysql\\Platform\\AdapterPlatformTest\:\:\$adapters \(array\<string, mysqli\|PDO\>\) does not accept array\<string, mysqli\|PDO\|PhpDb\\Mysql\\Pdo\\Connection\>\.$#'
identifier: assign.propertyType
count: 1
path: test/integration/AdapterPlatformTest.php

-
message: '#^Parameter \#1 \$container of callable PhpDb\\Mysql\\Container\\DriverInterfaceFactory expects Laminas\\ServiceManager\\ServiceManager, Psr\\Container\\ContainerInterface given\.$#'
identifier: argument.type
Expand All @@ -240,21 +186,3 @@ parameters:
count: 1
path: test/integration/Pdo/ConnectionTest.php

-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: test/integration/Pdo/QueryTest.php

-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: test/integration/Pdo/TableGatewayTest.php

-
message: '#^Unreachable statement \- code above always terminates\.$#'
identifier: deadCode.unreachable
count: 1
path: test/integration/TableGatewayTest.php

2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
<env name="TESTS_PHPDB_ADAPTER_MYSQL_DATABASE" value="phpdb_test"/>
<env name="TESTS_PHPDB_ADAPTER_MYSQL_PORT" value="3306"/>
</php>
</phpunit>
</phpunit>
8 changes: 5 additions & 3 deletions src/Container/DriverInterfaceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
namespace PhpDb\Mysql\Container;

use Laminas\ServiceManager\ServiceManager;
use PhpDb\Adapter\Driver\ConnectionInterface;
use PhpDb\Adapter\Driver\DriverInterface;
use PhpDb\Adapter\Driver\ResultInterface;
use PhpDb\Adapter\Driver\StatementInterface;
use PhpDb\Exception\ContainerException;
use PhpDb\Mysql\Connection;
use PhpDb\Mysql\Driver;
Expand All @@ -29,16 +31,16 @@ public function __invoke(
);
}

/** @var Driver\ConnectionInterface&Connection $connectionInstance */
/** @var ConnectionInterface&Connection $connectionInstance */
$connectionInstance = $container->build(Connection::class, $options);

/** @var Driver\StatementInterface&Statement $statementInstance */
/** @var StatementInterface&Statement $statementInstance */
$statementInstance = $container->build(
Statement::class,
$options['options'] ?? []
);

/** @var Driver\ResultInterface&Result $resultInstance */
/** @var ResultInterface&Result $resultInstance */
$resultInstance = $container->has(ResultInterface::class)
? $container->get(ResultInterface::class)
: new Result();
Expand Down
2 changes: 1 addition & 1 deletion src/Pdo/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function createResult($resource): ResultInterface
/** @var ResultInterface&Result $result */
$result = clone $this->resultPrototype;

$rowCount = 0;
$rowCount = null;

$lastGeneratedValue = $this->getLastGeneratedValue();

Expand Down
Loading