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
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"scripts": {
"check": [
"@cs-check",
"@static-analysis",
"@sa",
"@test",
"@test-integration"
],
Expand All @@ -71,8 +71,9 @@
"test": "phpunit --colors=always --testsuite \"unit test\"",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
"test-integration": "phpunit --colors=always --testsuite \"integration test\"",
"static-analysis": "vendor/bin/phpstan analyse --memory-limit=256M",
"sa-generate-baseline": "vendor/bin/phpstan analyse --memory-limit=256M --generate-baseline",
"sa": "vendor/bin/phpstan analyse --memory-limit=256M",
"sa-gen-baseline": "vendor/bin/phpstan analyse --memory-limit=256M --generate-baseline",
"sa-verbose": "vendor/bin/phpstan analyse --memory-limit=256M -vv",
"upload-coverage": "coveralls -v"
}
}
225 changes: 167 additions & 58 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,172 +4,281 @@ parameters:
message: '#^Method PhpDb\\Adapter\\Profiler\\ProfilerInterface\:\:profilerFinish\(\) invoked with 1 parameter, 0 required\.$#'
identifier: arguments.count
count: 1
path: src/Driver/Mysqli/Connection.php
path: src/Connection.php

-
message: '#^Property PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection\:\:\$driver \(PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
message: '#^Property PhpDb\\Mysql\\Connection\:\:\$driver \(PhpDb\\Mysql\\Driver\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
identifier: assign.propertyType
count: 1
path: src/Driver/Mysqli/Connection.php
path: src/Connection.php

-
message: '#^Property PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection\:\:\$resource \(mysqli\) does not accept null\.$#'
message: '#^Property PhpDb\\Mysql\\Connection\:\:\$resource \(mysqli\) does not accept null\.$#'
identifier: assign.propertyType
count: 1
path: src/Driver/Mysqli/Connection.php
path: src/Connection.php

-
message: '#^Strict comparison using \!\=\= between null and null will always evaluate to false\.$#'
identifier: notIdentical.alwaysFalse
count: 1
path: src/Driver/Mysqli/Connection.php
path: src/Connection.php

-
message: '#^Variable \$names in PHPDoc tag @var does not match assigned variable \$findParameterValue\.$#'
identifier: varTag.differentVariable
count: 1
path: src/Driver/Mysqli/Connection.php
path: src/Connection.php

-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
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
count: 1
path: src/Driver/Mysqli/Mysqli.php
path: src/Driver.php

-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
message: '#^Instanceof between PhpDb\\Mysql\\Connection and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
count: 1
path: src/Driver/Mysqli/Mysqli.php
path: src/Driver.php

-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
message: '#^Instanceof between PhpDb\\Mysql\\Statement and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
count: 1
path: src/Driver/Mysqli/Mysqli.php
path: src/Driver.php

-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
message: '#^Instanceof between PhpDb\\Mysql\\Statement and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
count: 1
path: src/Driver/Mysqli/Mysqli.php
path: src/Driver.php

-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\:\:getResultPrototype\(\) should return PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Result but returns PhpDb\\Adapter\\Driver\\ResultInterface\.$#'
message: '#^Method PhpDb\\Mysql\\Driver\:\:getResultPrototype\(\) should return PhpDb\\Mysql\\Result but returns PhpDb\\Adapter\\Driver\\ResultInterface\.$#'
identifier: return.type
count: 1
path: src/Driver/Mysqli/Mysqli.php
path: src/Driver.php

-
message: '#^Parameter \#1 \$resource \(mysqli\|mysqli_stmt\|PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\mysqli_result\) of method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
message: '#^Parameter \#1 \$resource \(mysqli\|mysqli_stmt\|PhpDb\\Mysql\\mysqli_result\) of method PhpDb\\Mysql\\Driver\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
identifier: method.childParameterType
count: 1
path: src/Driver/Mysqli/Mysqli.php
path: src/Driver.php

-
message: '#^Parameter \$resource of method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\:\:createResult\(\) has invalid type PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\mysqli_result\.$#'
message: '#^Parameter \$resource of method PhpDb\\Mysql\\Driver\:\:createResult\(\) has invalid type PhpDb\\Mysql\\mysqli_result\.$#'
identifier: class.notFound
count: 1
path: src/Driver/Mysqli/Mysqli.php
path: src/Driver.php

-
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, array\<int, string\>\> given\.$#'
identifier: argument.type
count: 2
path: src/Metadata/Source.php

-
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, list\<string\>\> given\.$#'
identifier: argument.type
count: 4
path: src/Metadata/Source.php

-
message: '#^Variable \$isFK might not be defined\.$#'
identifier: variable.undefined
count: 1
path: src/Metadata/Source.php

-
message: '#^Variable \$name might not be defined\.$#'
identifier: variable.undefined
count: 2
path: src/Metadata/Source.php

-
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: src/Pdo/Connection.php

-
message: '#^Parameter \#1 \$resource \(PDOStatement\) of method PhpDb\\Mysql\\Pdo\\Driver\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
identifier: method.childParameterType
count: 3
path: src/Pdo/Driver.php

-
message: '#^Instanceof between mysqli_stmt and mysqli_stmt will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
count: 2
path: src/Driver/Mysqli/Result.php
path: src/Result.php

-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Result\:\:initialize\(\) has PhpDb\\Adapter\\Exception\\InvalidArgumentException in PHPDoc @throws tag but it''s not thrown\.$#'
message: '#^Method PhpDb\\Mysql\\Result\:\:initialize\(\) has PhpDb\\Adapter\\Exception\\InvalidArgumentException in PHPDoc @throws tag but it''s not thrown\.$#'
identifier: throws.unusedType
count: 1
path: src/Driver/Mysqli/Result.php
path: src/Result.php

-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Result\:\:isBuffered\(\) never returns null so it can be removed from the return type\.$#'
message: '#^Method PhpDb\\Mysql\\Result\:\:isBuffered\(\) never returns null so it can be removed from the return type\.$#'
identifier: return.unusedType
count: 1
path: src/Driver/Mysqli/Result.php
path: src/Result.php

-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse
count: 1
path: src/Driver/Mysqli/Result.php
path: src/Result.php

-
message: '#^Instanceof between PhpDb\\Adapter\\ParameterContainer and PhpDb\\Adapter\\ParameterContainer will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
count: 1
path: src/Driver/Mysqli/Statement.php
path: src/Statement.php

-
message: '#^Instanceof between mysqli_stmt and mysqli_stmt will always evaluate to true\.$#'
identifier: instanceof.alwaysTrue
count: 1
path: src/Driver/Mysqli/Statement.php
path: src/Statement.php

-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:execute\(\) never returns null so it can be removed from the return type\.$#'
message: '#^Method PhpDb\\Mysql\\Statement\:\:execute\(\) never returns null so it can be removed from the return type\.$#'
identifier: return.unusedType
count: 1
path: src/Driver/Mysqli/Statement.php
path: src/Statement.php

-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:getParameterContainer\(\) never returns null so it can be removed from the return type\.$#'
message: '#^Method PhpDb\\Mysql\\Statement\:\:getParameterContainer\(\) never returns null so it can be removed from the return type\.$#'
identifier: return.unusedType
count: 1
path: src/Driver/Mysqli/Statement.php
path: src/Statement.php

-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:getSql\(\) never returns null so it can be removed from the return type\.$#'
message: '#^Method PhpDb\\Mysql\\Statement\:\:getSql\(\) never returns null so it can be removed from the return type\.$#'
identifier: return.unusedType
count: 1
path: src/Driver/Mysqli/Statement.php
path: src/Statement.php

-
message: '#^Property PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:\$driver \(PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
message: '#^Property PhpDb\\Mysql\\Statement\:\:\$driver \(PhpDb\\Mysql\\Driver\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
identifier: assign.propertyType
count: 1
path: src/Driver/Mysqli/Statement.php
path: src/Statement.php

-
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
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: src/Driver/Pdo/Connection.php
path: test/integration/AdapterPlatformTest.php

-
message: '#^Parameter \#1 \$resource \(PDOStatement\) of method PhpDb\\Adapter\\Mysql\\Driver\\Pdo\\Pdo\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
identifier: method.childParameterType
count: 3
path: src/Driver/Pdo/Pdo.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 \$array of function implode expects array\<string\>, array\<int, array\<int, string\>\> given\.$#'
message: '#^Parameter \#2 \$statementPrototype of class PhpDb\\Mysql\\Driver constructor expects PhpDb\\Mysql\\Statement, PhpDb\\Adapter\\Driver\\Pdo\\Statement given\.$#'
identifier: argument.type
count: 2
path: src/Metadata/Source/MysqlMetadata.php
count: 1
path: test/integration/AdapterPlatformTest.php

-
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, list\<string\>\> given\.$#'
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: '#^Callable PhpDb\\Mysql\\Container\\DriverInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
identifier: arguments.count
count: 1
path: test/integration/Container/DriverInterfaceFactoryTest.php

-
message: '#^Parameter \#1 \$container of callable PhpDb\\Mysql\\Container\\DriverInterfaceFactory expects Laminas\\ServiceManager\\ServiceManager, Psr\\Container\\ContainerInterface given\.$#'
identifier: argument.type
count: 4
path: src/Metadata/Source/MysqlMetadata.php
count: 1
path: test/integration/Container/DriverInterfaceFactoryTest.php

-
message: '#^Variable \$isFK might not be defined\.$#'
identifier: variable.undefined
message: '#^Callable PhpDb\\Mysql\\Container\\MetadataInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
identifier: arguments.count
count: 1
path: src/Metadata/Source/MysqlMetadata.php
path: test/integration/Container/MetadataInterfaceFactoryTest.php

-
message: '#^Variable \$name might not be defined\.$#'
identifier: variable.undefined
count: 2
path: src/Metadata/Source/MysqlMetadata.php
message: '#^Callable PhpDb\\Mysql\\Container\\PdoConnectionInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
identifier: arguments.count
count: 1
path: test/integration/Container/PdoConnectionInterfaceFactoryTest.php

-
message: '#^Callable PhpDb\\Mysql\\Container\\PdoDriverInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
identifier: arguments.count
count: 1
path: test/integration/Container/PdoDriverInterfaceFactoryTest.php

-
message: '#^Parameter \#1 \$container of callable PhpDb\\Mysql\\Container\\PdoDriverInterfaceFactory expects Laminas\\ServiceManager\\ServiceManager, Psr\\Container\\ContainerInterface given\.$#'
identifier: argument.type
count: 1
path: test/integration/Container/PdoDriverInterfaceFactoryTest.php

-
message: '#^Callable PhpDb\\Mysql\\Container\\PdoStatementFactory invoked with 1 parameter, 2\-3 required\.$#'
identifier: arguments.count
count: 1
path: test/integration/Container/PdoStatementFactoryTest.php

-
message: '#^Callable PhpDb\\Mysql\\Container\\PlatformInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
identifier: arguments.count
count: 1
path: test/integration/Container/PlatformInterfaceFactoryTest.php

-
message: '#^Callable PhpDb\\Mysql\\Container\\StatementInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
identifier: arguments.count
count: 1
path: test/integration/Container/StatementInterfaceFactoryTest.php

-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 1
path: test/integration/Driver/Pdo/ConnectionTest.php
path: test/integration/Pdo/ConnectionTest.php

2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
failOnWarning="true">

<extensions>
<bootstrap class="PhpDbIntegrationTest\Adapter\Mysql\Extension\ListenerExtension" />
<bootstrap class="PhpDbIntegrationTest\Mysql\Extension\ListenerExtension" />
</extensions>
<testsuites>
<testsuite name="unit test">
Expand Down
Loading