diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..e1c454819
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,15 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; More information at http://editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[Makefile]
+indent_style = tab
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index d912b593b..ecba80f1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
/.phpcs-cache
/.phpunit.result.cache
+/.phpunit.cache
/.phpstan-cache
/phpstan.neon
/phpbench.json
@@ -7,3 +8,4 @@
/coveralls-upload.json
/phpunit.xml
/vendor/
+/.vscode
diff --git a/.laminas-ci/phpunit.xml b/.laminas-ci/phpunit.xml
deleted file mode 100644
index d474c8a41..000000000
--- a/.laminas-ci/phpunit.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-
-
- ./test/unit
- ./test/unit/Adapter/AdapterAbstractServiceFactoryTest.php
- ./test/unit/Adapter/AdapterServiceFactoryTest.php
- ./test/unit/Adapter/AdapterServiceDelegatorTest.php
- ./test/unit/Adapter/Driver/Pdo/PdoTest.php
- ./test/unit/Adapter/Driver/Pdo/ConnectionTest.php
- ./test/unit/Adapter/Driver/Pdo/ConnectionIntegrationTest.php
- ./test/unit/Adapter/Driver/Pdo/StatementTest.php
- ./test/unit/Adapter/Driver/Pdo/StatementIntegrationTest.php
- ./test/unit/Adapter/AdapterTest.php
- ./test/unit/Adapter/AdapterAwareTraitTest.php
- ./test/unit/TableGateway
- ./test/unit/RowGateway
- ./test/unit/ConfigProviderTest.php
-
-
- ./test/integration
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.laminas-ci/pre-run.sh b/.laminas-ci/pre-run.sh
deleted file mode 100755
index 660082ade..000000000
--- a/.laminas-ci/pre-run.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-set -e
-
-TEST_USER=$1
-WORKSPACE=$2
-JOB=$3
-
-COMMAND=$(echo "${JOB}" | jq -r '.command')
-
-if [[ ! ${COMMAND} =~ phpunit ]]; then
- exit 0
-fi
-
-PHP_VERSION=$(echo "${JOB}" | jq -r '.php')
-
-# Install CI version of phpunit config
-cp .laminas-ci/phpunit.xml phpunit.xml
-
-# Install lsof (used in integration tests)
-apt update -qq
-apt install -yqq lsof
diff --git a/composer.json b/composer.json
index 9683ffc24..1587196b7 100644
--- a/composer.json
+++ b/composer.json
@@ -40,7 +40,7 @@
"phpbench/phpbench": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
- "phpunit/phpunit": "^11.5.15",
+ "phpunit/phpunit": "^11.5.42",
"rector/rector": "^2.0"
},
"suggest": {
@@ -63,15 +63,18 @@
"scripts": {
"check": [
"@cs-check",
- "@static-analysis"
+ "@sa",
+ "@test",
+ "@test-integration"
],
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"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"
},
"conflict": {
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 0055b7417..2bc1099cc 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -1,497 +1,23 @@
parameters:
ignoreErrors:
- -
- message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#'
- identifier: function.alreadyNarrowedType
- count: 1
- path: src/Adapter/Adapter.php
-
- -
- message: '#^Method PhpDb\\Adapter\\Adapter\:\:query\(\) should return PhpDb\\Adapter\\Driver\\ResultInterface\|PhpDb\\Adapter\\Driver\\StatementInterface\|PhpDb\\ResultSet\\ResultSet but returns PhpDb\\ResultSet\\ResultSetInterface\.$#'
- identifier: return.type
- count: 1
- path: src/Adapter/Adapter.php
-
- -
- message: '#^Trait PhpDb\\Adapter\\Driver\\Feature\\DriverFeatureProviderTrait is used zero times and is not analysed\.$#'
- identifier: trait.unused
- count: 1
- path: src/Adapter/Driver/Feature/DriverFeatureProviderTrait.php
-
- -
- message: '#^Instanceof between PhpDb\\Adapter\\Driver\\PdoDriverAwareInterface&PhpDb\\Adapter\\Driver\\StatementInterface and PhpDb\\Adapter\\Driver\\PdoDriverAwareInterface will always evaluate to true\.$#'
- identifier: instanceof.alwaysTrue
- count: 1
- path: src/Adapter/Driver/Pdo/AbstractPdo.php
-
- -
- message: '#^Method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\) invoked with 2 parameters, 1 required\.$#'
- identifier: arguments.count
- count: 1
- path: src/Adapter/Driver/Pdo/AbstractPdoConnection.php
-
- -
- message: '#^Method PhpDb\\Adapter\\Profiler\\ProfilerInterface\:\:profilerFinish\(\) invoked with 1 parameter, 0 required\.$#'
- identifier: arguments.count
- count: 1
- path: src/Adapter/Driver/Pdo/AbstractPdoConnection.php
-
- -
- message: '#^PHPDoc type PDO\|null of property PhpDb\\Adapter\\Driver\\Pdo\\AbstractPdoConnection\:\:\$resource is not covariant with PHPDoc type resource\|null of overridden property PhpDb\\Adapter\\Driver\\AbstractConnection\:\:\$resource\.$#'
- identifier: property.phpDocType
- count: 1
- path: src/Adapter/Driver/Pdo/AbstractPdoConnection.php
-
- -
- message: '#^Strict comparison using \!\=\= between null and null will always evaluate to false\.$#'
- identifier: notIdentical.alwaysFalse
- count: 1
- path: src/Adapter/Driver/Pdo/AbstractPdoConnection.php
-
- -
- message: '#^Property PhpDb\\Adapter\\Driver\\Pdo\\Result\:\:\$rowCount \(null\) does not accept int\.$#'
- identifier: assign.propertyType
- count: 1
- path: src/Adapter/Driver/Pdo/Result.php
-
- -
- message: '#^Property PhpDb\\Adapter\\Driver\\Pdo\\Result\:\:\$rowCount \(null\) does not accept int\<0, max\>\.$#'
- identifier: assign.propertyType
- count: 1
- path: src/Adapter/Driver/Pdo/Result.php
-
- -
- message: '#^Method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\) invoked with 2 parameters, 1 required\.$#'
- identifier: arguments.count
- count: 1
- path: src/Adapter/Driver/Pdo/Statement.php
-
- -
- message: '#^Return type \(PDOStatement\|null\) of method PhpDb\\Adapter\\Driver\\Pdo\\Statement\:\:getResource\(\) should be compatible with return type \(resource\) of method PhpDb\\Adapter\\Driver\\StatementInterface\:\:getResource\(\)$#'
- identifier: method.childReturnType
- count: 1
- path: src/Adapter/Driver/Pdo/Statement.php
-
- -
- message: '#^Property PhpDb\\Adapter\\Profiler\\Profiler\:\:\$currentIndex \(null\) does not accept default value of type int\.$#'
- identifier: property.defaultValue
- count: 1
- path: src/Adapter/Profiler/Profiler.php
-
- -
- message: '#^Property PhpDb\\Adapter\\Profiler\\Profiler\:\:\$currentIndex \(null\) does not accept int\.$#'
- identifier: assign.propertyType
- count: 1
- path: src/Adapter/Profiler/Profiler.php
-
- -
- message: '#^PHPDoc tag @var for property PhpDb\\Metadata\\Source\\AbstractSource\:\:\$data with type mixed is not subtype of native type array\.$#'
- identifier: property.phpDocType
- count: 1
- path: src/Metadata/Source/AbstractSource.php
-
- -
- message: '#^Property PhpDb\\ResultSet\\AbstractResultSet\:\:\$dataSource \(Iterator\|IteratorAggregate\|null\) does not accept Traversable\\.$#'
- identifier: assign.propertyType
- count: 1
- path: src/ResultSet/AbstractResultSet.php
-
- -
- message: '#^Call to an undefined method PhpDb\\Adapter\\StatementContainerInterface\:\:execute\(\)\.$#'
- identifier: method.notFound
- count: 4
- path: src/RowGateway/AbstractRowGateway.php
-
- -
- message: '#^Property PhpDb\\RowGateway\\AbstractRowGateway\:\:\$primaryKeyData \(array\) does not accept null\.$#'
- identifier: assign.propertyType
- count: 2
- path: src/RowGateway/AbstractRowGateway.php
-
-
message: '#^Variable \$paramSpecs might not be defined\.$#'
identifier: variable.undefined
count: 1
path: src/Sql/AbstractSql.php
- -
- message: '#^PHPDoc type array of property PhpDb\\Sql\\InsertIgnore\:\:\$specifications is not covariant with PHPDoc type array\ of overridden property PhpDb\\Sql\\Insert\:\:\$specifications\.$#'
- identifier: property.phpDocType
- count: 1
- path: src/Sql/InsertIgnore.php
-
- -
- message: '#^PHPDoc tag @implements has invalid value \(Countable\)\: Unexpected token "\\n ", expected ''\<'' at offset 419 on line 12$#'
- identifier: phpDoc.parseError
- count: 1
- path: src/Sql/Join.php
-
- -
- message: '#^PHPDoc tag @implements has invalid value \(Iterator\)\: Unexpected token "\\n \* ", expected ''\<'' at offset 394 on line 11$#'
- identifier: phpDoc.parseError
- count: 1
- path: src/Sql/Join.php
-
- -
- message: '#^Cannot call method setSubject\(\) on class\-string\|object\.$#'
- identifier: method.nonObject
- count: 1
- path: src/Sql/Platform/Platform.php
-
- -
- message: '#^Call to an undefined method PhpDb\\Adapter\\StatementContainerInterface\:\:execute\(\)\.$#'
- identifier: method.notFound
- count: 4
- path: src/TableGateway/AbstractTableGateway.php
-
- -
- message: '#^Call to an undefined method PhpDb\\TableGateway\\Feature\\FeatureSet\:\:callMagicSet\(\)\.$#'
- identifier: method.notFound
- count: 1
- path: src/TableGateway/AbstractTableGateway.php
-
- -
- message: '#^Call to an undefined method PhpDb\\TableGateway\\Feature\\FeatureSet\:\:canCallMagicSet\(\)\.$#'
- identifier: method.notFound
- count: 1
- path: src/TableGateway/AbstractTableGateway.php
-
- -
- message: '#^Method PhpDb\\TableGateway\\AbstractTableGateway\:\:__set\(\) with return type void returns mixed but should not return anything\.$#'
- identifier: return.void
- count: 1
- path: src/TableGateway/AbstractTableGateway.php
-
- -
- message: '#^Method PhpDb\\TableGateway\\AbstractTableGateway\:\:initialize\(\) should return null but empty return statement found\.$#'
- identifier: return.empty
- count: 1
- path: src/TableGateway/AbstractTableGateway.php
-
- -
- message: '#^Method PhpDb\\TableGateway\\AbstractTableGateway\:\:initialize\(\) should return null but return statement is missing\.$#'
- identifier: return.missing
- count: 1
- path: src/TableGateway/AbstractTableGateway.php
-
- -
- message: '#^Property PhpDb\\TableGateway\\AbstractTableGateway\:\:\$resultSetPrototype \(PhpDb\\ResultSet\\ResultSetInterface\) in isset\(\) is not nullable\.$#'
- identifier: isset.property
- count: 1
- path: src/TableGateway/AbstractTableGateway.php
-
- -
- message: '#^Parameter \#1 \$params \(string\) of method PhpDb\\TableGateway\\Feature\\EventFeature\\TableGatewayEvent\:\:setParams\(\) should be compatible with parameter \$params \(array\|object\) of method Laminas\\EventManager\\EventInterface\