diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 26c58025..38c54075 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -7,5 +7,69 @@ on: tags: jobs: - ci: - uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x + matrix: + name: Generate job matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - name: Gather CI configuration + id: matrix + uses: laminas/laminas-ci-matrix-action@v1 + + qa: + name: QA Checks + needs: [matrix] + runs-on: ${{ matrix.operatingSystem }} + services: + mongo: + image: mongo + mysql: + image: mysql:8 + env: + MYSQL_ROOT_PASSWORD: 'password' + MYSQL_ROOT_HOST: '%' + MYSQL_USER: 'gha' + MYSQL_PASSWORD: 'password' + MYSQL_DATABASE: 'laminas_session' + options: >- + --health-cmd="mysqladmin ping" + --health-interval 10s + --health-timeout 5s + --health-retries 3 + ports: + - 3306 + postgres: + image: postgres + env: + POSTGRES_USER: 'gha' + POSTGRES_PASSWORD: 'password' + POSTGRES_DB: 'laminas_session' + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 3 + ports: + - 5432 + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} + steps: + - name: ${{ matrix.name }} + uses: laminas/laminas-continuous-integration-action@v1 + with: + job: ${{ matrix.job }} + env: + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB: true + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB_CONNECTION_STRING: mongodb://mongo/ + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL: true + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL_HOSTNAME: mysql + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL_USERNAME: gha + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL_PASSWORD: password + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL_DATABASE: laminas_session + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_PGSQL: true + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_PGSQL_HOSTNAME: postgres + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_PGSQL_USERNAME: gha + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_PGSQL_PASSWORD: password + TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_PGSQL_DATABASE: laminas_session diff --git a/.laminas-ci.json b/.laminas-ci.json index 91c32b7f..3c33afda 100644 --- a/.laminas-ci.json +++ b/.laminas-ci.json @@ -2,9 +2,11 @@ "extensions": [ "mongodb", "mysql", - "pgsql" + "pgsql", + "xdebug" ], "ignore_php_platform_requirements": { - "8.3": true - } + "8.3": false + }, + "backwardCompatibilityCheck": true } diff --git a/composer.json b/composer.json index be629aed..968d599f 100644 --- a/composer.json +++ b/composer.json @@ -38,16 +38,17 @@ "laminas/laminas-stdlib": "^3.18" }, "require-dev": { - "laminas/laminas-cache": "^3.12.0", + "ext-xdebug": "*", + "laminas/laminas-cache": "^3.12.1", "laminas/laminas-cache-storage-adapter-memory": "^2.3", "laminas/laminas-coding-standard": "~2.5.0", - "laminas/laminas-db": "^2.18.0", + "laminas/laminas-db": "^2.19.0", "laminas/laminas-http": "^2.19", - "laminas/laminas-validator": "^2.46.0", + "laminas/laminas-validator": "^2.49.0", "mongodb/mongodb": "~1.17.0", - "phpunit/phpunit": "^9.6.15", + "phpunit/phpunit": "^9.6.17", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.18" + "vimeo/psalm": "^5.22.2" }, "suggest": { "laminas/laminas-cache": "Laminas\\Cache component", diff --git a/composer.lock b/composer.lock index 61be8c4d..00dbe509 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "95bbe29e00903423f10604d2ba7d71e2", + "content-hash": "6be5308fe9ba618a4de19f1df12f5266", "packages": [ { "name": "laminas/laminas-eventmanager", @@ -166,16 +166,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.18.0", + "version": "3.19.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf" + "reference": "6a192dd0882b514e45506f533b833b623b78fff3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf", - "reference": "e85b29076c6216e7fc98e72b42dbe1bbc3b95ecf", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/6a192dd0882b514e45506f533b833b623b78fff3", + "reference": "6a192dd0882b514e45506f533b833b623b78fff3", "shasum": "" }, "require": { @@ -186,10 +186,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "^2.5", - "phpbench/phpbench": "^1.2.14", - "phpunit/phpunit": "^10.3.3", + "phpbench/phpbench": "^1.2.15", + "phpunit/phpunit": "^10.5.8", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.15.0" + "vimeo/psalm": "^5.20.0" }, "type": "library", "autoload": { @@ -221,7 +221,7 @@ "type": "community_bridge" } ], - "time": "2023-09-19T10:15:21+00:00" + "time": "2024-01-19T12:39:49+00:00" }, { "name": "psr/container", @@ -1015,16 +1015,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077" + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/85193c0b0cb5c47894b5eaec906e946f054e7077", - "reference": "85193c0b0cb5c47894b5eaec906e946f054e7077", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", "shasum": "" }, "require": { @@ -1064,7 +1064,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.0.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" }, "funding": [ { @@ -1072,7 +1072,7 @@ "type": "github" } ], - "time": "2023-09-17T21:38:23+00:00" + "time": "2024-02-07T09:43:46+00:00" }, { "name": "jean85/pretty-package-versions", @@ -1135,16 +1135,16 @@ }, { "name": "laminas/laminas-cache", - "version": "3.12.0", + "version": "3.12.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-cache.git", - "reference": "66cf9a209163cadc65d93483667b995c5ead1563" + "reference": "bf8bc7f92e15925991c46079c6cd727372af5a46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache/zipball/66cf9a209163cadc65d93483667b995c5ead1563", - "reference": "66cf9a209163cadc65d93483667b995c5ead1563", + "url": "https://api.github.com/repos/laminas/laminas-cache/zipball/bf8bc7f92e15925991c46079c6cd727372af5a46", + "reference": "bf8bc7f92e15925991c46079c6cd727372af5a46", "shasum": "" }, "require": { @@ -1232,7 +1232,7 @@ "type": "community_bridge" } ], - "time": "2023-11-06T18:52:54+00:00" + "time": "2024-01-19T20:42:11+00:00" }, { "name": "laminas/laminas-cache-storage-adapter-memory", @@ -1359,21 +1359,21 @@ }, { "name": "laminas/laminas-db", - "version": "2.18.0", + "version": "2.19.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-db.git", - "reference": "4df7a3f7ffe268e8683306fcec125c269408b295" + "reference": "5d8c89d767d4dac7b710c8c6d967f3780f7a5f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-db/zipball/4df7a3f7ffe268e8683306fcec125c269408b295", - "reference": "4df7a3f7ffe268e8683306fcec125c269408b295", + "url": "https://api.github.com/repos/laminas/laminas-db/zipball/5d8c89d767d4dac7b710c8c6d967f3780f7a5f6a", + "reference": "5d8c89d767d4dac7b710c8c6d967f3780f7a5f6a", "shasum": "" }, "require": { "laminas/laminas-stdlib": "^3.7.1", - "php": "~8.0.0 || ~8.1.0|| ~8.2.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, "conflict": { "zendframework/zend-db": "*" @@ -1426,7 +1426,7 @@ "type": "community_bridge" } ], - "time": "2023-05-05T16:22:28+00:00" + "time": "2024-02-01T18:53:10+00:00" }, { "name": "laminas/laminas-escaper", @@ -1671,16 +1671,16 @@ }, { "name": "laminas/laminas-validator", - "version": "2.46.0", + "version": "2.49.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "98330256f8d8a1357a93f6f7f1a987036aff6329" + "reference": "d58c2e7d3cd420554400dd8cca694fafa3b8e45f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/98330256f8d8a1357a93f6f7f1a987036aff6329", - "reference": "98330256f8d8a1357a93f6f7f1a987036aff6329", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/d58c2e7d3cd420554400dd8cca694fafa3b8e45f", + "reference": "d58c2e7d3cd420554400dd8cca694fafa3b8e45f", "shasum": "" }, "require": { @@ -1694,16 +1694,16 @@ }, "require-dev": { "laminas/laminas-coding-standard": "^2.5", - "laminas/laminas-db": "^2.18", - "laminas/laminas-filter": "^2.33", - "laminas/laminas-i18n": "^2.24.1", - "laminas/laminas-session": "^2.17", + "laminas/laminas-db": "^2.19", + "laminas/laminas-filter": "^2.34", + "laminas/laminas-i18n": "^2.26.0", + "laminas/laminas-session": "^2.18", "laminas/laminas-uri": "^2.11.0", - "phpunit/phpunit": "^10.5.2", + "phpunit/phpunit": "^10.5.10", "psalm/plugin-phpunit": "^0.18.4", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.0.2", - "vimeo/psalm": "^5.17" + "vimeo/psalm": "^5.22.1" }, "suggest": { "laminas/laminas-db": "Laminas\\Db component, required by the (No)RecordExists validator", @@ -1751,7 +1751,7 @@ "type": "community_bridge" } ], - "time": "2024-01-03T12:43:04+00:00" + "time": "2024-02-22T16:46:06+00:00" }, { "name": "mongodb/mongodb", @@ -1891,16 +1891,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v4.2.0", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0", + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0", "shasum": "" }, "require": { @@ -1911,7 +1911,7 @@ "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0 || ~10.0", "squizlabs/php_codesniffer": "~3.5" }, "type": "library", @@ -1936,9 +1936,9 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1" }, - "time": "2023-04-09T17:37:40+00:00" + "time": "2024-01-31T06:18:54+00:00" }, { "name": "nikic/php-parser", @@ -1998,20 +1998,21 @@ }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -2052,9 +2053,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -2318,16 +2325,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.30", + "version": "9.2.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089" + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca2bd87d2f9215904682a9cb9bb37dda98e76089", - "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", "shasum": "" }, "require": { @@ -2384,7 +2391,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.30" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" }, "funding": [ { @@ -2392,7 +2399,7 @@ "type": "github" } ], - "time": "2023-12-22T06:47:57+00:00" + "time": "2024-03-02T06:37:42+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2637,16 +2644,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.15", + "version": "9.6.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", - "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", "shasum": "" }, "require": { @@ -2720,7 +2727,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" }, "funding": [ { @@ -2736,7 +2743,7 @@ "type": "tidelift" } ], - "time": "2023-12-01T16:55:19+00:00" + "time": "2024-02-23T13:14:51+00:00" }, { "name": "psalm/plugin-phpunit", @@ -3051,16 +3058,16 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -3095,7 +3102,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -3103,7 +3110,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -3349,16 +3356,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -3403,7 +3410,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -3411,7 +3418,7 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", @@ -3478,16 +3485,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -3543,7 +3550,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -3551,20 +3558,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -3607,7 +3614,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -3615,7 +3622,7 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", @@ -4076,16 +4083,16 @@ }, { "name": "spatie/array-to-xml", - "version": "3.2.2", + "version": "3.2.3", "source": { "type": "git", "url": "https://github.com/spatie/array-to-xml.git", - "reference": "96be97e664c87613121d073ea39af4c74e57a7f8" + "reference": "c95fd4db94ec199f798d4b5b4a81757bd20d88ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/96be97e664c87613121d073ea39af4c74e57a7f8", - "reference": "96be97e664c87613121d073ea39af4c74e57a7f8", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/c95fd4db94ec199f798d4b5b4a81757bd20d88ab", + "reference": "c95fd4db94ec199f798d4b5b4a81757bd20d88ab", "shasum": "" }, "require": { @@ -4123,7 +4130,7 @@ "xml" ], "support": { - "source": "https://github.com/spatie/array-to-xml/tree/3.2.2" + "source": "https://github.com/spatie/array-to-xml/tree/3.2.3" }, "funding": [ { @@ -4135,20 +4142,20 @@ "type": "github" } ], - "time": "2023-11-14T14:08:51+00:00" + "time": "2024-02-07T10:39:02+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", "shasum": "" }, "require": { @@ -4158,11 +4165,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -4215,20 +4222,20 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-02-16T15:06:51+00:00" }, { "name": "symfony/console", - "version": "v6.4.2", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625" + "reference": "0d9e4eb5ad413075624378f474c4167ea202de78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0254811a143e6bc6c8deea08b589a7e68a37f625", - "reference": "0254811a143e6bc6c8deea08b589a7e68a37f625", + "url": "https://api.github.com/repos/symfony/console/zipball/0d9e4eb5ad413075624378f474c4167ea202de78", + "reference": "0d9e4eb5ad413075624378f474c4167ea202de78", "shasum": "" }, "require": { @@ -4293,7 +4300,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.2" + "source": "https://github.com/symfony/console/tree/v6.4.4" }, "funding": [ { @@ -4309,7 +4316,7 @@ "type": "tidelift" } ], - "time": "2023-12-10T16:15:48+00:00" + "time": "2024-02-22T20:27:10+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4380,16 +4387,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.4.0", + "version": "v6.4.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59" + "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/952a8cb588c3bc6ce76f6023000fb932f16a6e59", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", + "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", "shasum": "" }, "require": { @@ -4423,7 +4430,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.0" + "source": "https://github.com/symfony/filesystem/tree/v6.4.3" }, "funding": [ { @@ -4439,20 +4446,20 @@ "type": "tidelift" } ], - "time": "2023-07-26T17:27:13+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -4466,9 +4473,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4505,7 +4509,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -4521,20 +4525,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -4545,9 +4549,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4586,7 +4587,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -4602,20 +4603,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -4626,9 +4627,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4670,7 +4668,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -4686,20 +4684,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -4713,9 +4711,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4753,7 +4748,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -4769,7 +4764,7 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", @@ -5011,16 +5006,16 @@ }, { "name": "symfony/string", - "version": "v6.4.2", + "version": "v6.4.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc" + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/7cb80bc10bfcdf6b5492741c0b9357dac66940bc", - "reference": "7cb80bc10bfcdf6b5492741c0b9357dac66940bc", + "url": "https://api.github.com/repos/symfony/string/zipball/4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", + "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9", "shasum": "" }, "require": { @@ -5077,7 +5072,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.2" + "source": "https://github.com/symfony/string/tree/v6.4.4" }, "funding": [ { @@ -5093,20 +5088,20 @@ "type": "tidelift" } ], - "time": "2023-12-10T16:15:48+00:00" + "time": "2024-02-01T13:16:41+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -5135,7 +5130,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -5143,20 +5138,20 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "vimeo/psalm", - "version": "5.18.0", + "version": "5.22.2", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19" + "reference": "d768d914152dbbf3486c36398802f74e80cfde48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/b113f3ed0259fd6e212d87c3df80eec95a6abf19", - "reference": "b113f3ed0259fd6e212d87c3df80eec95a6abf19", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d768d914152dbbf3486c36398802f74e80cfde48", + "reference": "d768d914152dbbf3486c36398802f74e80cfde48", "shasum": "" }, "require": { @@ -5179,7 +5174,7 @@ "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.16", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", - "sebastian/diff": "^4.0 || ^5.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", "spatie/array-to-xml": "^2.17.0 || ^3.0", "symfony/console": "^4.1.6 || ^5.0 || ^6.0 || ^7.0", "symfony/filesystem": "^5.4 || ^6.0 || ^7.0" @@ -5253,7 +5248,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2023-12-16T09:37:35+00:00" + "time": "2024-02-22T23:39:07+00:00" }, { "name": "webimpress/coding-standard", @@ -5377,7 +5372,9 @@ "platform": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0" }, - "platform-dev": [], + "platform-dev": { + "ext-xdebug": "*" + }, "platform-overrides": { "php": "8.1.99" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 717b9f66..191d68f0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -28,12 +28,6 @@ - - - diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 94967fc3..eb9d7420 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,37 +1,37 @@ - + - null === $key - null === $key - null === static::$defaultManager + + + - new static::$managerDefaultClass() + - $container - $this - $this - $this + + + + - getIterator - offsetExists - offsetGet - offsetSet - offsetUnset + + + + + - $container + - $value - $value + + @@ -44,11 +44,11 @@ - $storage[$name][$key] - $storage[$name][$key] - $storage[$name][$key] - $storage[$name][$key] - $storage[$name][$key] + + + + + @@ -63,19 +63,19 @@ - $container - $container - $metadata - $metadata + + + + - $old - $storage[$name][$offset] + + - exchangeArray - getArrayCopy + + @@ -85,43 +85,42 @@ getArrayCopy() : $container]]> getArrayCopy() : $container]]> - $old - $old + + getArrayCopy()]]> - getIterator - new ArrayIterator($container) + + - Container - Container - Container + + + - $input - $offset + - $key - $key - $name - $storage + + + + - $storage[$name] + getName()]]]> - $storage[$name] + - $name + - $storage - $storage - $storage + + + @@ -129,21 +128,21 @@ - $manager - AbstractContainer - AbstractContainer + + + - is_array($vars) - is_array($vars) + + - null !== $key - null !== $key - null !== $vars + + + $ts]]> @@ -156,78 +155,78 @@ defaultStorageClass()]]> - $saveHandler + - AbstractValidatorChainEM3 + - ! is_numeric($hashBitsPerCharacter) - ! is_numeric($sidBitsPerCharacter) + + - SessionConfig + - SessionConfig + - $serializeHandler - $validHashFunctions + + - $value + - $knownHandlers + - false|string + - $callback($module) - $callback() + + - false - false + + - (string) $iniGet + - (int) $hashBitsPerCharacter - (int) $sidBitsPerCharacter - (string) $cacheLimiter - (string) $serializeHandler - (string) $serializeHandler + + + + + - $prefix + - ! is_numeric($sidLength) - is_numeric($cacheExpire) - is_numeric($cookieLifetime) - is_numeric($entropyLength) - is_numeric($gcDivisor) - is_numeric($gcMaxlifetime) - is_numeric($gcProbability) - is_numeric($hashBitsPerCharacter) - is_numeric($rememberMeSeconds) - is_numeric($sidBitsPerCharacter) - is_string($cookieDomain) + + + + + + + + + + + cookieDomain]]> cookieHttpOnly]]> cookieLifetime]]> @@ -240,58 +239,58 @@ useCookies]]> - StandardConfig - StandardConfig - StandardConfig - StandardConfig - StandardConfig - StandardConfig - StandardConfig - StandardConfig - StandardConfig - StandardConfig - StandardConfig - bool|string - bool|string - null|string - string|null + + + + + + + + + + + + + + + - HostnameValidator::ALLOW_ALL + - mixed + - array + - $cookieDomain - $cookieDomain - $cookieHttpOnly - $cookieHttpOnly - $cookieLifetime - $cookieLifetime - $cookiePath - $cookiePath - $cookieSameSite - $cookieSameSite - $cookieSecure - $cookieSecure - $name - $name - $rememberMeSeconds - $savePath - $savePath - $useCookies - $useCookies + + + + + + + + + + + + + + + + + + + - $key - $key + + - $key + cookieDomain]]> cookieHttpOnly]]> cookieLifetime]]> @@ -302,30 +301,30 @@ rememberMeSeconds]]> savePath]]> useCookies]]> - $value - $value + + - bool - bool|string - bool|string - int - int - int - int - int - null|string - string - string - string - string - string - string - string - string - string - string - string|null + + + + + + + + + + + + + + + + + + + + cookieDomain]]> @@ -366,49 +365,49 @@ - (bool) $cookieHttpOnly - (bool) $cookieSecure - (bool) $useCookies - (int) $cacheExpire - (int) $cookieLifetime - (int) $gcDivisor - (int) $gcMaxlifetime - (int) $gcProbability - (int) $hashBitsPerCharacter - (int) $rememberMeSeconds - (int) $sidBitsPerCharacter - (int) $sidLength - (string) $cookiePath - (string) $cookieSameSite - (string) $name + + + + + + + + + + + + + + + - ConfigInterface - StorageInterface - \Zend\Session\ManagerInterface - \Zend\Session\SessionManager + + + + - offsetGet + - $storage[$name][$key] + - Container + - bool + - $sessionName - $sessionSavePath + + getCacheStorage()->removeItem($id)]]> @@ -416,7 +415,7 @@ - true + @@ -431,11 +430,11 @@ )]]> - true + - $row - $rows + + {$this->options->getModifiedColumn()}]]> @@ -446,28 +445,28 @@ {$this->options->getModifiedColumn()}]]> - $lifetime - $sessionName - $sessionSavePath + + + - (string) $data + - current - current + + - DbTableGatewayOptions + - (string) $dataColumn - (string) $idColumn - (string) $lifetimeColumn - (string) $modifiedColumn - (string) $nameColumn + + + + + @@ -476,7 +475,7 @@ getDatabase())]]> - bool + options->getSaveOptions()]]> @@ -487,17 +486,17 @@ options->getModifiedField()]]]> - $timestamp - $timestamp + + - string + - getData + - $timestamp + options->getDataField()]->getData()]]> @@ -508,12 +507,12 @@ options->getModifiedField()]]]> - $lifetime - $mongoCollection - $sessionName + + + - (string) $data + @@ -522,65 +521,65 @@ saveOptions === ['w' => 1]]]> - $saveOptions + true]]]> 1]]]> - $options + - setUseExpireAfterSecondsIndex + - MongoDBOptions + - $options + - $collection - $database + + - (bool) $useExpireAfterSecondsIndex - (string) $collection - (string) $dataField - (string) $database - (string) $lifetimeField - (string) $modifiedField - (string) $nameField + + + + + + + - ContainerAbstractServiceFactory + - $config - $sessionManager + + - $config + configKey]]]> - $config - $config + + sessionManager]]> - null|ManagerInterface + sessionManager]]> sessionManager]]> - $container - $container + + sessionManager !== null]]> @@ -589,189 +588,192 @@ - SessionConfigFactory + - $config + - $config + - new $class() + - $services + - SessionManagerFactory + - $manager + - $config - $configService - $options - $saveHandler - $storage - $validators + + + + + + - SessionManager + - $services + - StorageFactory + - $options - $type + + - $config - $options - $type + + + - $services + - $_SESSION !== $storage + name]]> validatorChain]]> - $test + - initializeValidatorChain + - $validator + - $sid - $validator - $validatorValues + + + - new $validator(null) + - $id + - $oldSessionData + + + + - $name - $validatorChain - SessionManager + + + getCookieHttpOnly()]]> getCookieSecure()]]> - (bool) $deleteOldSession + - is_array($oldSessionData) + - $oldSessionData instanceof Traversable + - $_SESSION - $this - $this - $values - $values - new ArrayIterator($_SESSION) + + + + + + - SessionStorage - SessionStorage - array + + + ]]> - getIterator + - $_SESSION + - serialize - unserialize + + - $locks - $locks - $locks + + + - $_SESSION[$key] - $_SESSION[$key] - $_SESSION[$offset] - $_SESSION[$offset] + + + + - $_SESSION[$offset] + - $locks - $locks - $readOnly + + + - bool - float + + getMetadata('_READONLY')]]> getMetadata('_REQUEST_ACCESS_TIME')]]> - $metaData + - $key + - $_SESSION instanceof ArrayObject - $locks + + - is_object($input) + - $flags - $iteratorClass + + - $key - $key - $key + + + @@ -786,19 +788,19 @@ - $locks - $locks - $locks + + + - $value + - $array[$key] + @@ -808,27 +810,26 @@ - $array - $locks - $locks - $readOnly + + + + - bool - float + + getMetadata('_READONLY')]]> getMetadata('_REQUEST_ACCESS_TIME')]]> - $metaData - $offset + - $key + @@ -837,49 +838,49 @@ - ArrayStorage + - $locks + - is_array($options) - is_string($type) + + - new $type($input) - new $type($input, $flags, $iteratorClass) + + - new $type($input) - new $type($input, $flags, $iteratorClass) - new $type($options) + + + - $flags - $input + + - new $type($options) + - AbstractSessionArrayStorage - ArrayStorage - StorageInterface + + + - offsetGet + - $_SESSION[$key] - $_SESSION[$key] + + @@ -889,74 +890,77 @@ - SessionStorage + getArrayCopy()]]> - $_SESSION !== $this - $_SESSION !== $this - $_SESSION instanceof ArrayObject + + + + + + - is_object($input) - is_object($input) + + - ValidatorChainTrait + - CallbackHandler + attachValidator($eventName, $listener, $priority)]]> - CallbackHandler + - $data - $validator - $validators + + + - new $validator($data) + - CallbackHandler + - $data + - $callback + - $data + - CallbackHandler|callable + - $callback + - $data - $data - $validator - $validators + + + + - new $validator($data) + @@ -969,8 +973,8 @@ - $handler - $saveHandler + + @@ -978,71 +982,53 @@ - 24 - 24 + + - $handler - $saveHandler + + - 1 + - static function (?string $module = null) { - static function (?string $module = null) { + + - testCookieSameSiteAltersIniSetting - testCookieSameSiteDefaultsToIniSettings - testCookieSameSiteIsMutable + + + config->toArray(), 1)]]> - null + - assertFalse + - - config->getEntropyFile();]]> - config->getEntropyLength();]]> - config->getHashBitsPerCharacter();]]> - config->getHashFunction();]]> - config->setEntropyFile(__FILE__);]]> - config->setEntropyLength(0);]]> - config->setHashBitsPerCharacter(5);]]> - config->setHashFunction('foobar_bogus');]]> - expectDeprecation();]]> - expectDeprecation();]]> - expectDeprecation();]]> - expectDeprecation();]]> - expectDeprecation();]]> - expectDeprecation();]]> - expectDeprecation();]]> - expectDeprecation();]]> - - expectDeprecation - expectDeprecation - expectDeprecation - expectDeprecation - expectDeprecation - expectDeprecation - expectDeprecation - expectDeprecation - getEntropyFile - getEntropyLength - getHashBitsPerCharacter - getHashFunction - setEntropyFile - setEntropyLength - setHashBitsPerCharacter - setHashFunction + + + + + + + + + + + + + + + + @@ -1053,11 +1039,11 @@ - 24 - 24 + + - testCookieSameSiteIsMutable + config->getUseCookies()]]> @@ -1065,52 +1051,52 @@ - $abstractFactories + - $aliases[SessionManager::class] + - $config[LegacyConfigInterface::class] - $config[LegacyManagerInterface::class] - $config[LegacySessionManager::class] - $config[LegacyStorageInterface::class] - $factories[ConfigInterface::class] - $factories[ManagerInterface::class] - $factories[StorageInterface::class] + + + + + + + config['dependencies']['aliases']]]> - $config[LegacyConfigInterface::class] - $config[LegacyManagerInterface::class] - $config[LegacySessionManager::class] - $config[LegacyStorageInterface::class] + + + + - $abstractFactories - $aliases - $config - $config - $factories + + + + + - (new ConfigProvider())() + - LegacyConfigInterface - LegacyManagerInterface - LegacySessionManager - LegacyStorageInterface + + + + - $metadata - $metadata - $metadata - $metadata - $metadata + + + + + @@ -1136,16 +1122,16 @@ container['foo']['bar']]]> - $hops - $metadata - $metadata - $metadata - $metadata - $metadata - $metadata - $metadata - $metadata - $metadata + + + + + + + + + + manager->started]]> @@ -1160,11 +1146,11 @@ - assertIsArray + - $container - $container + + @@ -1173,124 +1159,120 @@ adapter]]> - $data + - count + adapter]]> - assertTrue - is_string($data) + + - $data + - assertTrue - is_string($data) + + - CacheAdapter + - $options - $options - $options - $options - $options + + + + + - count - count - count - count - count + + + + + - 123 - 123 - 123 - 456 - 456 - 456 + + + + + + - - - - mongoCollection]]> - assertTrue - is_string($data) + + - $container + - getManager + - testServiceNotCreatedWhenInvalidSamesiteConfig + - $config + - getName + - $chain - $chain - $manager + + + - $listener[0] - $validatorData[Validator\HttpUserAgent::class] - $validatorData[Validator\RemoteAddr::class] + + + - $chain - $chain - $listener - $manager - $manager - $manager - $manager - $manager - $manager - $manager - $manager - $manager - $manager - $manager - $validatorData + + + + + + + + + + + + + + + - getConfig - getSaveHandler - getStorage - getStorage - getValidatorChain - getValidatorChain - start - start - start + + + + + + + + + - $manager - $manager + + @@ -1299,21 +1281,21 @@ - $storage - $storage - $test + + + - toArray + - $storage + - $_SESSION - $_SESSION + + @@ -1328,84 +1310,80 @@ storage['baz']['foo']]]> - assertSame + - assertIsArray + error]]> - 1 - $_SESSION + - $header - $header - $header - $header - $header - $header - $header - $header - $value + + + + + + + + + - $_SESSION[$key] - $_SESSION[$key] + + - $header - $header - $header - $header - $header - $header - $metaData - $value - $value + + + + + + + + + key1]]> key2]]> - $_SESSION - $_SESSION + + - - var_export($headers, 1) - - $header - $header + + - assertFalse - assertSame + + - assertIsArray + - $origId + - getArrayCopy + - $_SESSION + @@ -1422,92 +1400,92 @@ - void - void - void - void - void - void - void - void - void - void - void - void + + + + + + + + + + + + - TestContainer + - destroy - read + + - $id - $id + + - TestDbTableGatewaySaveHandler - TestDbTableGatewaySaveHandler - TestDbTableGatewaySaveHandler + + + - void - void - void + + + - ArrayStorage::class + - forgetMe - getId - getName - getValidatorChain - isValid - regenerateId - sessionExists - setValidatorChain + + + + + + + + - TestManager + ]]> - protected $storageDefaultClass = ArrayStorage::class; + - $data + - void - void + + - $data + - bool + - $backup + - $validator::$isValidCallCount + diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php index 4b394552..4fff979f 100644 --- a/src/AbstractContainer.php +++ b/src/AbstractContainer.php @@ -448,17 +448,17 @@ public function &offsetGet($key) /** * Unset a single key in the container * - * @param string $key + * @param string $offset * @return void */ - public function offsetUnset($key) + public function offsetUnset($offset) { - if (! $this->offsetExists($key)) { + if (! $this->offsetExists($offset)) { return; } $storage = $this->getStorage(); $name = $this->getName(); - unset($storage[$name][$key]); + unset($storage[$name][$offset]); } /** @inheritDoc */ diff --git a/src/Config/SessionConfig.php b/src/Config/SessionConfig.php index 04e75362..80e71af9 100644 --- a/src/Config/SessionConfig.php +++ b/src/Config/SessionConfig.php @@ -214,7 +214,7 @@ public function getStorageOption($storageOption) 'use_trans_sid', 'cookie_httponly' => (bool) ini_get('session.' . $storageOption), - 'save_handler' => $this->saveHandler ?: $this->sessionModuleName(), + 'save_handler' => $this->saveHandler ?? $this->sessionModuleName(), default => ini_get('session.' . $storageOption), }; diff --git a/src/SaveHandler/MongoDBOptions.php b/src/SaveHandler/MongoDBOptions.php index e7e91bd4..cc4ad13a 100644 --- a/src/SaveHandler/MongoDBOptions.php +++ b/src/SaveHandler/MongoDBOptions.php @@ -81,7 +81,8 @@ public function __construct($options = null) { parent::__construct($options); - $mongoVersion = phpversion('mongo') ?: '0.0.0'; + $mongoVersion = phpversion('mongo'); + $mongoVersion = $mongoVersion === false ? '0.0.0' : $mongoVersion; if ($this->saveOptions === ['w' => 1] && version_compare($mongoVersion, '1.3.0', '<')) { $this->saveOptions = ['safe' => true]; } diff --git a/src/Service/ContainerAbstractServiceFactory.php b/src/Service/ContainerAbstractServiceFactory.php index a16a84d3..564f5bbb 100644 --- a/src/Service/ContainerAbstractServiceFactory.php +++ b/src/Service/ContainerAbstractServiceFactory.php @@ -65,7 +65,7 @@ class ContainerAbstractServiceFactory implements AbstractFactoryInterface public function canCreate(ContainerInterface $container, $requestedName) { $config = $this->getConfig($container); - if (empty($config)) { + if ($config === []) { return false; } @@ -112,7 +112,7 @@ public function createServiceWithName(ServiceLocatorInterface $container, $name, /** * Retrieve config from service locator, and cache for later * - * @return false|array + * @return array */ protected function getConfig(ContainerInterface $container) { diff --git a/src/Validator/HttpUserAgent.php b/src/Validator/HttpUserAgent.php index 698292af..6bed1102 100644 --- a/src/Validator/HttpUserAgent.php +++ b/src/Validator/HttpUserAgent.php @@ -19,7 +19,7 @@ class HttpUserAgent implements ValidatorInterface */ public function __construct($data = null) { - if (empty($data)) { + if ($data === null || $data === '') { $data = $_SERVER['HTTP_USER_AGENT'] ?? null; } $this->data = $data; diff --git a/src/Validator/Id.php b/src/Validator/Id.php index 71eace4b..a7182125 100644 --- a/src/Validator/Id.php +++ b/src/Validator/Id.php @@ -3,6 +3,7 @@ namespace Laminas\Session\Validator; use function ini_get; +use function is_numeric; use function preg_match; use function session_id; use function strrpos; @@ -30,7 +31,7 @@ class Id implements ValidatorInterface */ public function __construct($id = null) { - if (empty($id)) { + if ($id === null || $id === '') { $id = session_id(); } @@ -50,13 +51,14 @@ public function isValid() $saveHandler = ini_get('session.save_handler'); if ($saveHandler === 'cluster') { // Zend Server SC, validate only after last dash $dashPos = strrpos($id, '-'); - if ($dashPos) { + if ($dashPos !== false) { $id = substr($id, $dashPos + 1); } } // Get the session id bits per character INI setting, using 5 if unavailable - $hashBitsPerChar = ini_get('session.sid_bits_per_character') ?: 5; + $hashBitsPerChar = ini_get('session.sid_bits_per_character'); + $hashBitsPerChar = is_numeric($hashBitsPerChar) ? (int) $hashBitsPerChar : 5; switch ($hashBitsPerChar) { case 4: diff --git a/src/Validator/RemoteAddr.php b/src/Validator/RemoteAddr.php index e63ed938..997829c4 100644 --- a/src/Validator/RemoteAddr.php +++ b/src/Validator/RemoteAddr.php @@ -48,7 +48,7 @@ class RemoteAddr implements SessionValidator */ public function __construct($data = null) { - if (empty($data)) { + if ($data === null || $data === '') { $data = $this->getIpAddress(); } $this->data = $data; diff --git a/test/Config/SessionConfigTest.php b/test/Config/SessionConfigTest.php index df6afe44..e6274d57 100644 --- a/test/Config/SessionConfigTest.php +++ b/test/Config/SessionConfigTest.php @@ -11,9 +11,7 @@ use SessionHandlerInterface; use stdClass; -use function array_merge; use function extension_loaded; -use function hash_algos; use function ini_get; use function session_start; use function var_export; @@ -420,14 +418,14 @@ public function testCookieSecureDefaultsToIniSettings(): void public function testCookieSecureIsMutable(): void { - $value = ! ini_get('session.cookie_secure'); + $value = ! (bool) ini_get('session.cookie_secure'); $this->config->setCookieSecure($value); self::assertEquals($value, $this->config->getCookieSecure()); } public function testCookieSecureAltersIniSetting(): void { - $value = ! ini_get('session.cookie_secure'); + $value = ! (bool) ini_get('session.cookie_secure'); $this->config->setCookieSecure($value); self::assertEquals($value, ini_get('session.cookie_secure')); } @@ -441,14 +439,14 @@ public function testCookieHttpOnlyDefaultsToIniSettings(): void public function testCookieHttpOnlyIsMutable(): void { - $value = ! ini_get('session.cookie_httponly'); + $value = ! (bool) ini_get('session.cookie_httponly'); $this->config->setCookieHttpOnly($value); self::assertEquals($value, $this->config->getCookieHttpOnly()); } public function testCookieHttpOnlyAltersIniSetting(): void { - $value = ! ini_get('session.cookie_httponly'); + $value = ! (bool) ini_get('session.cookie_httponly'); $this->config->setCookieHttpOnly($value); self::assertEquals($value, ini_get('session.cookie_httponly')); } @@ -462,14 +460,14 @@ public function testUseCookiesDefaultsToIniSettings(): void public function testUseCookiesIsMutable(): void { - $value = ! ini_get('session.use_cookies'); + $value = ! (bool) ini_get('session.use_cookies'); $this->config->setUseCookies($value); self::assertEquals($value, $this->config->getUseCookies()); } public function testUseCookiesAltersIniSetting(): void { - $value = ! ini_get('session.use_cookies'); + $value = ! (bool) ini_get('session.use_cookies'); $this->config->setUseCookies($value); self::assertEquals($value, (bool) ini_get('session.use_cookies')); } @@ -483,14 +481,14 @@ public function testUseOnlyCookiesDefaultsToIniSettings(): void public function testUseOnlyCookiesIsMutable(): void { - $value = ! ini_get('session.use_only_cookies'); + $value = ! (bool) ini_get('session.use_only_cookies'); $this->config->setOption('use_only_cookies', $value); self::assertEquals($value, (bool) $this->config->getOption('use_only_cookies')); } public function testUseOnlyCookiesAltersIniSetting(): void { - $value = ! ini_get('session.use_only_cookies'); + $value = ! (bool) ini_get('session.use_only_cookies'); $this->config->setOption('use_only_cookies', $value); self::assertEquals($value, (bool) ini_get('session.use_only_cookies')); } @@ -520,36 +518,6 @@ public function testRefererCheckAltersIniSetting(): void self::assertEquals('BARBAZ', ini_get('session.referer_check')); } - public function testSetEntropyFileError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->getEntropyFile(); - } - - public function testGetEntropyFileError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->setEntropyFile(__FILE__); - } - - // session.entropy_length - - public function testGetEntropyLengthError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->getEntropyLength(); - } - - public function testSetEntropyLengthError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->setEntropyLength(0); - } - // session.cache_limiter /** @psalm-return array */ @@ -636,69 +604,18 @@ public function testUseTransSidDefaultsToIniSettings(): void public function testUseTransSidIsMutable(): void { - $value = ! ini_get('session.use_trans_sid'); + $value = ! (bool) ini_get('session.use_trans_sid'); $this->config->setOption('use_trans_sid', $value); self::assertEquals($value, (bool) $this->config->getOption('use_trans_sid')); } public function testUseTransSidAltersIniSetting(): void { - $value = ! ini_get('session.use_trans_sid'); + $value = ! (bool) ini_get('session.use_trans_sid'); $this->config->setOption('use_trans_sid', $value); self::assertEquals($value, (bool) ini_get('session.use_trans_sid')); } - // session.hash_function - - public function hashFunctions(): array - { - $hashFunctions = array_merge([0, 1], hash_algos()); - $provider = []; - foreach ($hashFunctions as $function) { - $provider[] = [$function]; - } - return $provider; - } - - public function testGetHashFunctionError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->getHashFunction(); - } - - public function testSetHashFunctionError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->setHashFunction('foobar_bogus'); - } - - // session.hash_bits_per_character - - public function hashBitsPerCharacters(): array - { - return [ - [4], - [5], - [6], - ]; - } - - public function testGetHashBitsPerCharacterError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->getHashBitsPerCharacter(); - } - - public function testSetHashBitsPerCharacterError(): void - { - $this->markTestSkipped('This functionality is deprecated as of PHP 7.1 and should not be used anyways'); - $this->expectDeprecation(); - $this->config->setHashBitsPerCharacter(5); - } - // session.sid_length public function testSidLengthDefaultsToIniSettings(): void diff --git a/test/ContainerTest.php b/test/ContainerTest.php index 0fa0fb55..9ea061b2 100644 --- a/test/ContainerTest.php +++ b/test/ContainerTest.php @@ -259,6 +259,7 @@ public function testPassingUnsetKeyInArrayToSetExpirationSecondsDoesNothing(): v public function testGetKeyWithContainerExpirationInPastResetsToNull(): void { + self::assertIsInt($_SERVER['REQUEST_TIME']); $this->container->foo = 'bar'; $storage = $this->manager->getStorage(); $storage->setMetadata('Default', ['EXPIRE' => $_SERVER['REQUEST_TIME'] - 18600]); @@ -267,6 +268,7 @@ public function testGetKeyWithContainerExpirationInPastResetsToNull(): void public function testGetKeyWithExpirationInPastResetsToNull(): void { + self::assertIsInt($_SERVER['REQUEST_TIME']); $this->container->foo = 'bar'; $this->container->bar = 'baz'; $storage = $this->manager->getStorage(); @@ -277,6 +279,7 @@ public function testGetKeyWithExpirationInPastResetsToNull(): void public function testKeyExistsWithContainerExpirationInPastReturnsFalse(): void { + self::assertIsInt($_SERVER['REQUEST_TIME']); $this->container->foo = 'bar'; $storage = $this->manager->getStorage(); $storage->setMetadata('Default', ['EXPIRE' => $_SERVER['REQUEST_TIME'] - 18600]); @@ -285,6 +288,7 @@ public function testKeyExistsWithContainerExpirationInPastReturnsFalse(): void public function testKeyExistsWithExpirationInPastReturnsFalse(): void { + self::assertIsInt($_SERVER['REQUEST_TIME']); $this->container->foo = 'bar'; $this->container->bar = 'baz'; $storage = $this->manager->getStorage(); @@ -295,6 +299,7 @@ public function testKeyExistsWithExpirationInPastReturnsFalse(): void public function testKeyExistsWithContainerExpirationInPastWithSetExpirationSecondsReturnsFalse(): void { + self::assertIsInt($_SERVER['REQUEST_TIME']); $this->container->foo = 'bar'; $storage = $this->manager->getStorage(); $storage->setMetadata('Default', ['EXPIRE' => $_SERVER['REQUEST_TIME'] - 18600]); @@ -304,6 +309,7 @@ public function testKeyExistsWithContainerExpirationInPastWithSetExpirationSecon public function testSettingExpiredKeyOverwritesExpiryMetadataForThatKey(): void { + self::assertIsInt($_SERVER['REQUEST_TIME']); $this->container->foo = 'bar'; $storage = $this->manager->getStorage(); $storage->setMetadata('Default', ['EXPIRE' => $_SERVER['REQUEST_TIME'] - 18600]); @@ -494,6 +500,7 @@ public function testIterationHonorsExpirationHops(): void public function testIterationHonorsExpirationTimestamps(): void { + self::assertIsInt($_SERVER['REQUEST_TIME']); $this->container->foo = 'bar'; $this->container->bar = 'baz'; $storage = $this->manager->getStorage(); diff --git a/test/SaveHandler/DbTableGateway/MysqliAdapterTest.php b/test/SaveHandler/DbTableGateway/MysqliAdapterTest.php index 62102983..0b9daade 100644 --- a/test/SaveHandler/DbTableGateway/MysqliAdapterTest.php +++ b/test/SaveHandler/DbTableGateway/MysqliAdapterTest.php @@ -14,12 +14,10 @@ class MysqliAdapterTest extends AbstractDbTableGatewayTest { - /** - * @return Adapter - */ - protected function getAdapter() + protected function getAdapter(): Adapter { - if (! getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL')) { + $enabled = (bool) getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL'); + if (! $enabled) { self::markTestSkipped( sprintf( '%s tests with MySQL are disabled', diff --git a/test/SaveHandler/DbTableGateway/PdoMysqlAdapterTest.php b/test/SaveHandler/DbTableGateway/PdoMysqlAdapterTest.php index 8fc3769f..6539b181 100644 --- a/test/SaveHandler/DbTableGateway/PdoMysqlAdapterTest.php +++ b/test/SaveHandler/DbTableGateway/PdoMysqlAdapterTest.php @@ -19,7 +19,8 @@ class PdoMysqlAdapterTest extends AbstractDbTableGatewayTest */ protected function getAdapter() { - if (! getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL')) { + $enabled = (bool) getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MYSQL'); + if (! $enabled) { self::markTestSkipped( sprintf( '%s tests with MySQL are disabled', @@ -28,7 +29,7 @@ protected function getAdapter() ); } - if (! extension_loaded('mysqli')) { + if (! extension_loaded('pdo_mysql')) { self::markTestSkipped( sprintf( '%s tests with PDO_Mysql adapter are not enabled due to missing PDO_Mysql extension', diff --git a/test/SaveHandler/DbTableGateway/PdoSqliteAdapterTest.php b/test/SaveHandler/DbTableGateway/PdoSqliteAdapterTest.php index fe54cfd3..38f75e2b 100644 --- a/test/SaveHandler/DbTableGateway/PdoSqliteAdapterTest.php +++ b/test/SaveHandler/DbTableGateway/PdoSqliteAdapterTest.php @@ -13,10 +13,7 @@ class PdoSqliteAdapterTest extends AbstractDbTableGatewayTest { - /** - * @return Adapter - */ - protected function getAdapter() + protected function getAdapter(): Adapter { if (! extension_loaded('pdo_sqlite')) { self::markTestSkipped( diff --git a/test/SaveHandler/DbTableGateway/PgsqlAdapterTest.php b/test/SaveHandler/DbTableGateway/PgsqlAdapterTest.php index 339fea54..adedf38f 100644 --- a/test/SaveHandler/DbTableGateway/PgsqlAdapterTest.php +++ b/test/SaveHandler/DbTableGateway/PgsqlAdapterTest.php @@ -14,12 +14,10 @@ class PgsqlAdapterTest extends AbstractDbTableGatewayTest { - /** - * @return Adapter - */ - protected function getAdapter() + protected function getAdapter(): Adapter { - if (! getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_PGSQL')) { + $enabled = (bool) getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_PGSQL'); + if (! $enabled) { self::markTestSkipped( sprintf( '%s tests with Pgsql adapter are disabled', @@ -28,7 +26,7 @@ protected function getAdapter() ); } - if (! extension_loaded('mysqli')) { + if (! extension_loaded('pdo_pgsql')) { self::markTestSkipped( sprintf( '%s tests with Pgsql adapter are not enabled due to missing Pgsql extension', diff --git a/test/SaveHandler/MongoDBOptionsTest.php b/test/SaveHandler/MongoDBOptionsTest.php index b34b70f1..6a5c6156 100644 --- a/test/SaveHandler/MongoDBOptionsTest.php +++ b/test/SaveHandler/MongoDBOptionsTest.php @@ -19,14 +19,16 @@ class MongoDBOptionsTest extends TestCase { public function testDefaults(): void { - if (! getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB')) { + $enabled = (bool) getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB'); + if (! $enabled) { $this->markTestSkipped('MongoDB tests are disabled'); } $options = new MongoDBOptions(); self::assertNull($options->getDatabase()); self::assertNull($options->getCollection()); - $mongoVersion = phpversion('mongo') ?: '0.0.0'; + $mongoVersion = phpversion('mongo'); + $mongoVersion = $mongoVersion === false ? '0.0.0' : $mongoVersion; $defaultSaveOptions = version_compare($mongoVersion, '1.3.0', '<') ? ['safe' => true] : ['w' => 1]; self::assertEquals($defaultSaveOptions, $options->getSaveOptions()); self::assertEquals('name', $options->getNameField()); diff --git a/test/SaveHandler/MongoDBTest.php b/test/SaveHandler/MongoDBTest.php index 37735649..259f6f27 100644 --- a/test/SaveHandler/MongoDBTest.php +++ b/test/SaveHandler/MongoDBTest.php @@ -25,28 +25,23 @@ */ class MongoDBTest extends TestCase { - /** @var MongoClient */ - protected $mongoClient; - - /** - * MongoCollection instance - * - * @var MongoCollection - */ - protected $mongoCollection; - - /** @var MongoDBOptions */ - protected $options; + private MongoClient $mongoClient; + private MongoCollection $mongoCollection; + private MongoDBOptions $options; + private bool $enabled = false; /** * Setup performed prior to each test method */ protected function setUp(): void { - if (! getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB')) { + $enabled = (bool) getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB'); + if (! $enabled) { $this->markTestSkipped('MongoDB tests are disabled'); } + $this->enabled = true; + $this->options = new MongoDBOptions( [ 'database' => 'laminas_tests', @@ -54,9 +49,11 @@ protected function setUp(): void ] ); - $this->mongoClient = new MongoClient( - getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB_CONNECTION_STRING') - ); + $mongoDsn = getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB_CONNECTION_STRING'); + self::assertIsString($mongoDsn); + self::assertNotEquals('', $mongoDsn); + + $this->mongoClient = new MongoClient($mongoDsn); $this->mongoCollection = $this->mongoClient->selectCollection( $this->options->getDatabase(), $this->options->getCollection() @@ -68,9 +65,11 @@ protected function setUp(): void */ protected function tearDown(): void { - if ($this->mongoCollection) { - $this->mongoCollection->drop(); + if (! $this->enabled) { + return; } + + $this->mongoCollection->drop(); } public function testReadWrite(): void diff --git a/test/SessionManagerTest.php b/test/SessionManagerTest.php index 5596b66d..301f7034 100644 --- a/test/SessionManagerTest.php +++ b/test/SessionManagerTest.php @@ -413,7 +413,10 @@ public function testDestroyByDefaultSendsAnExpireCookie(): void $sName = $this->manager->getName(); foreach ($headers as $header) { - if (stristr($header, 'Set-Cookie:') && stristr($header, $sName)) { + if ( + stristr($header, 'Set-Cookie:') !== false + && stristr($header, $sName) !== false + ) { $found = true; } } @@ -443,7 +446,10 @@ public function testSendingFalseToSendExpireCookieWhenCallingDestroyShouldNotSen $sName = $this->manager->getName(); foreach ($headers as $header) { - if (stristr($header, 'Set-Cookie:') && stristr($header, $sName)) { + if ( + stristr($header, 'Set-Cookie:') !== false + && stristr($header, $sName) !== false + ) { $found = true; } } @@ -600,7 +606,10 @@ public function testRegeneratingIdAfterSessionStartedShouldSendExpireCookie(): v $sName = $this->manager->getName(); foreach ($headers as $header) { - if (stristr($header, 'Set-Cookie:') && stristr($header, $sName)) { + if ( + stristr($header, 'Set-Cookie:') !== false + && stristr($header, $sName) !== false + ) { $found = true; } } @@ -629,7 +638,11 @@ public function testRememberMeShouldSendNewSessionCookieWithUpdatedTimestamp(): $cookie = false; foreach ($headers as $header) { - if (stristr($header, 'Set-Cookie:') && stristr($header, $sName) && ! stristr($header, '=deleted')) { + if ( + stristr($header, 'Set-Cookie:') !== false + && stristr($header, $sName) !== false + && stristr($header, '=deleted') === false + ) { $found = true; $cookie = $header; } @@ -673,7 +686,11 @@ public function testRememberMeShouldSetTimestampBasedOnConfigurationByDefault(): $cookie = false; foreach ($headers as $header) { - if (stristr($header, 'Set-Cookie:') && stristr($header, $sName) && ! stristr($header, '=deleted')) { + if ( + stristr($header, 'Set-Cookie:') !== false + && stristr($header, $sName) !== false + && stristr($header, '=deleted') === false + ) { $found = true; $cookie = $header; } @@ -687,9 +704,15 @@ public function testRememberMeShouldSetTimestampBasedOnConfigurationByDefault(): self::fail('Cookie did not contain expiry? ' . var_export($headers, true)); } + self::assertIsInt($_SERVER['REQUEST_TIME']); + $compare = $_SERVER['REQUEST_TIME'] + $ttl; $cookieTs = $ts->getTimestamp(); - self::assertContains($cookieTs, range($compare, $compare + 10), 'Session cookie: ' . var_export($headers, 1)); + self::assertContains( + $cookieTs, + range($compare, $compare + 10), + 'Session cookie: ' . var_export($headers, true), + ); } /** @@ -712,7 +735,11 @@ public function testForgetMeShouldSendCookieWithZeroTimestamp(): void $sName = $this->manager->getName(); foreach ($headers as $header) { - if (stristr($header, 'Set-Cookie:') && stristr($header, $sName) && ! stristr($header, '=deleted')) { + if ( + stristr($header, 'Set-Cookie:') !== false + && stristr($header, $sName) !== false + && stristr($header, '=deleted') === false + ) { $found = true; } }