From a1fe6376b81e6d037190aa1a5dc684d51eb674cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Wed, 15 Mar 2023 13:16:20 +0100 Subject: [PATCH] Upgrade PHPStan and use Composer v2 (#62) * Upgrade PHPStan and use Composer v2 * Revert to Composer v2.2 * Fix Composer version * Fix CI * Upgrade actions/cache action * Upgrade OS version in CI --- .github/workflows/ci.yaml | 48 ++++++------- .phive/phars.xml | 4 +- composer.json | 16 ++--- composer.lock | 144 ++++++++++++++++++++------------------ phpstan.neon.dist | 1 - src/dbless-wpdb.php | 4 +- 6 files changed, 110 insertions(+), 107 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ab6613c..90bf389 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: coding-standards: name: "Coding Standards" - runs-on: "ubuntu-18.04" + runs-on: "ubuntu-20.04" strategy: matrix: @@ -29,15 +29,15 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.2" + uses: "actions/checkout@v3" - name: "Install PHP with extensions" - uses: "shivammathur/setup-php@2.8.0" + uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer:2.2" - name: "Validate composer.json and composer.lock" run: "composer validate --strict" @@ -47,7 +47,7 @@ jobs: run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" - name: "Cache PHAR files installed with phive" - uses: "actions/cache@v2.1.0" + uses: "actions/cache@v3" with: path: "${{ runner.temp }}/.phive" key: "php-${{ matrix.php-version }}-phive-${{ matrix.dependencies }}-${{ hashFiles('.phive/phars.xml') }}" @@ -65,7 +65,7 @@ jobs: trustGpgKeys: "C00543248C87FB13,31C7E470E2138192" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2.1.0" + uses: "actions/cache@v3" with: path: "${{ env.COMPOSER_CACHE_DIR }}" key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" @@ -95,7 +95,7 @@ jobs: static-code-analysis: name: "Static Code Analysis" - runs-on: "ubuntu-18.04" + runs-on: "ubuntu-20.04" strategy: matrix: @@ -107,22 +107,22 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.2" + uses: "actions/checkout@v3" - name: "Install PHP with extensions" - uses: "shivammathur/setup-php@2.8.0" + uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer:2.2" - name: "Determine composer cache directory" shell: "bash" run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" - name: "Cache PHAR files installed with phive" - uses: "actions/cache@v2.1.0" + uses: "actions/cache@v3" with: path: "${{ runner.temp }}/.phive" key: "php-${{ matrix.php-version }}-phive-${{ matrix.dependencies }}-${{ hashFiles('.phive/phars.xml') }}" @@ -140,7 +140,7 @@ jobs: trustGpgKeys: "C00543248C87FB13,31C7E470E2138192" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2.1.0" + uses: "actions/cache@v3" with: path: "${{ env.COMPOSER_CACHE_DIR }}" key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" @@ -162,7 +162,7 @@ jobs: run: "mkdir -p .build/phpstan" - name: "Cache cache directory for phpstan/phpstan" - uses: "actions/cache@v2.1.0" + uses: "actions/cache@v3" with: path: ".build/phpstan" key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}" @@ -170,13 +170,13 @@ jobs: - name: "Run phpstan/phpstan" run: | - composer require --working-dir=tools "szepeviktor/phpstan-wordpress:^0.6.2" + composer require --working-dir=tools "szepeviktor/phpstan-wordpress:^1.1" tools/vendor/bin/phpstan analyze src/ tests: name: "Tests" - runs-on: "ubuntu-18.04" + runs-on: "ubuntu-20.04" strategy: matrix: @@ -198,22 +198,22 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.2" + uses: "actions/checkout@v3" - name: "Install PHP with extensions" - uses: "shivammathur/setup-php@2.8.0" + uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer:2.2" - name: "Determine composer cache directory" shell: "bash" run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2.1.0" + uses: "actions/cache@v3" with: path: "${{ env.COMPOSER_CACHE_DIR }}" key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" @@ -239,7 +239,7 @@ jobs: tests-old: name: "Tests on unsupported PHP" - runs-on: "ubuntu-18.04" + runs-on: "ubuntu-20.04" strategy: matrix: @@ -254,22 +254,22 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v2.3.2" + uses: "actions/checkout@v3" - name: "Install PHP with extensions" - uses: "shivammathur/setup-php@2.8.0" + uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" extensions: "${{ env.PHP_EXTENSIONS }}" coverage: "none" - tools: "composer:v1" + tools: "composer:2.2" - name: "Determine composer cache directory" shell: "bash" run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" - name: "Cache dependencies installed with composer" - uses: "actions/cache@v2.1.0" + uses: "actions/cache@v3" with: path: "${{ env.COMPOSER_CACHE_DIR }}" key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" diff --git a/.phive/phars.xml b/.phive/phars.xml index a8a19e5..1634060 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,5 +1,5 @@ - - + + diff --git a/composer.json b/composer.json index 39d7031..ad1768a 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "name": "automattic/wordbless", - "type": "wordpress-dropin", "description": "WorDBless allows you to use WordPress core functions in your PHPUnit tests without having to set up a database and the whole WordPress environment", "license": "GPL-2.0-or-later", + "type": "wordpress-dropin", "authors": [ { "name": "Automattic Inc." @@ -16,17 +16,17 @@ "require-dev": { "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^9.5" }, - "config": { - "allow-plugins": { - "roots/wordpress-core-installer": true - } - }, "autoload": { "psr-4": { "WorDBless\\": "src/", "WorDBless\\Composer\\": "src/Composer/" } }, + "config": { + "allow-plugins": { + "roots/wordpress-core-installer": true + } + }, "scripts": { "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", @@ -34,10 +34,10 @@ "phive install --trust-gpg-keys C00543248C87FB13,31C7E470E2138192", "@composer validate --strict", "tools/composer-normalize normalize --dry-run", - "@composer require --working-dir=tools 'wp-coding-standards/wpcs:^2.3.0'", + "@composer require --working-dir=tools --dev 'wp-coding-standards/wpcs:^2.3.0'", "tools/phpcs --config-set installed_paths tools/vendor/wp-coding-standards/wpcs", "tools/phpcs -s --standard=WordPress-Core --exclude=WordPress.Files.FileName src/", - "@composer require --working-dir=tools 'szepeviktor/phpstan-wordpress:^0.6.2'", + "@composer require --working-dir=tools --dev 'szepeviktor/phpstan-wordpress:^1.1'", "tools/vendor/bin/phpstan analyze --memory-limit=2G src/", "@phpunit" ], diff --git a/composer.lock b/composer.lock index 5e3e57f..fa9ad7b 100644 --- a/composer.lock +++ b/composer.lock @@ -8,30 +8,30 @@ "packages": [ { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -58,7 +58,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -74,7 +74,7 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "myclabs/deep-copy", @@ -137,16 +137,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.1", + "version": "v4.15.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", "shasum": "" }, "require": { @@ -187,9 +187,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" }, - "time": "2022-09-04T07:30:47+00:00" + "time": "2023-01-16T22:05:37+00:00" }, { "name": "phar-io/manifest", @@ -304,16 +304,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.17", + "version": "9.2.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", + "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", "shasum": "" }, "require": { @@ -369,7 +369,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" }, "funding": [ { @@ -377,7 +377,7 @@ "type": "github" } ], - "time": "2022-08-30T12:24:04+00:00" + "time": "2023-01-26T08:26:55+00:00" }, { "name": "phpunit/php-file-iterator", @@ -622,20 +622,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.24", + "version": "9.6.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5" + "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", - "reference": "d0aa6097bef9fd42458a9b3c49da32c6ce6129c5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7b1615e3e887d6c719121c6d4a44b0ab9645555", + "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -653,14 +653,14 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.1", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, "suggest": { @@ -673,7 +673,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -704,7 +704,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.24" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.3" }, "funding": [ { @@ -714,13 +714,17 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-08-30T07:42:16+00:00" + "time": "2023-02-04T13:37:15+00:00" }, { "name": "roots/wordpress", - "version": "6.0.2", + "version": "6.1.1", "source": { "type": "git", "url": "https://github.com/roots/wordpress.git", @@ -751,7 +755,7 @@ ], "support": { "issues": "https://github.com/roots/wordpress/issues", - "source": "https://github.com/roots/wordpress/tree/6.0.2" + "source": "https://github.com/roots/wordpress/tree/6.1.1" }, "funding": [ { @@ -838,22 +842,22 @@ }, { "name": "roots/wordpress-no-content", - "version": "6.0.2", + "version": "6.1.1", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress.git", - "reference": "6.0.2" + "reference": "6.1.1" }, "dist": { "type": "zip", - "url": "https://downloads.wordpress.org/release/wordpress-6.0.2-no-content.zip", - "shasum": "9e78ef932a99d62e6a0b045ff846fe5b2bf35e29" + "url": "https://downloads.wordpress.org/release/wordpress-6.1.1-no-content.zip", + "shasum": "ad2d202747c5356e7b6246fbc339b46aebfa0665" }, "require": { "php": ">= 5.6.20" }, "provide": { - "wordpress/core-implementation": "6.0.2" + "wordpress/core-implementation": "6.1.1" }, "suggest": { "ext-curl": "Performs remote request operations.", @@ -904,7 +908,7 @@ "type": "other" } ], - "time": "2022-08-30T17:52:03+00:00" + "time": "2022-11-15T19:14:34+00:00" }, { "name": "sebastian/cli-parser", @@ -1075,16 +1079,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -1137,7 +1141,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -1145,7 +1149,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -1272,16 +1276,16 @@ }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -1323,7 +1327,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -1331,20 +1335,20 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -1400,7 +1404,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -1408,7 +1412,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -1645,16 +1649,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -1693,10 +1697,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -1704,7 +1708,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -1763,16 +1767,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -1807,7 +1811,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -1815,7 +1819,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9f863f8..94a8bfa 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -8,4 +8,3 @@ parameters: - tests/phpstan/bootstrap.php - vendor/autoload.php ignoreErrors: - - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' diff --git a/src/dbless-wpdb.php b/src/dbless-wpdb.php index a36f38c..757759e 100644 --- a/src/dbless-wpdb.php +++ b/src/dbless-wpdb.php @@ -94,7 +94,7 @@ public function replace( $table, $data, $format = null ) { * * @param int|false $result The number of rows affected, or false on error. * @param string $table The database table. - * @param array $table The data to be inserted. + * @param array $data The data to be inserted. * @param array|string $format (Optional) An array of formats to be mapped to each of the value in $data. */ return apply_filters( 'wordbless_wpdb_replace', $result, $table, $data, $format ); @@ -135,7 +135,7 @@ public function close() { } public function has_cap( $db_cap ) { - return 1; + return true; } public function db_version() {