From 0abe1f0e7d42f283fd6517cb43cfcbda60151a31 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 9 Jul 2024 12:10:49 +0200 Subject: [PATCH 01/13] Removed name from datasource, updated GravityFormsDataSource with all formatted values. --- src/Addon/GravityExportAddon.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Addon/GravityExportAddon.php b/src/Addon/GravityExportAddon.php index 7b2f7f65..964f75aa 100644 --- a/src/Addon/GravityExportAddon.php +++ b/src/Addon/GravityExportAddon.php @@ -124,6 +124,8 @@ public function minimum_requirements(): array { 'dom', 'zlib', 'xml', + 'iconv', + 'mbstring', ], ] ]; From 97ab3d6b94ded487a5f61bb08cec9d97fe23d7aa Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Mon, 26 Aug 2024 12:06:25 +0200 Subject: [PATCH 02/13] PHPStan fixes --- composer.json | 11 +- composer.lock | 196 +++++++++++------- phpstan.neon | 13 +- src/Action/CountDownloads.php | 1 + src/Action/FilterRequest.php | 21 +- src/Action/NotificationAttachmentAction.php | 2 +- src/Addon/GravityExportAddon.php | 20 +- src/Component/Usage.php | 4 +- src/Field/Meta/CreatedBy.php | 15 +- src/Field/ProductField.php | 4 +- src/Field/SurveyLikertField.php | 2 +- src/GFExcel.php | 25 +-- src/GFExcelOutput.php | 4 +- src/GravityForms/Field/DownloadUrl.php | 3 +- src/Renderer/AbstractPHPExcelRenderer.php | 35 ++-- src/ServiceProvider/AddOnProvider.php | 16 ++ src/Shortcode/DownloadUrl.php | 2 +- src/Shorttag/DownloadUrl.php | 5 +- .../Manager/MigrationManagerTest.php | 1 + tests/Transformer/TransformerTest.php | 5 +- 20 files changed, 228 insertions(+), 157 deletions(-) diff --git a/composer.json b/composer.json index 7ffa3b32..b050e87a 100644 --- a/composer.json +++ b/composer.json @@ -37,16 +37,23 @@ "GFExcel\\": "src/" } }, + "repositories": [ + { + "type": "vcs", + "url": "git@github.com:gravityforms/gravityforms.git" + } + ], "autoload-dev": { "psr-4": { "GFExcel\\Tests\\": "tests/" } }, "require-dev": { + "gravityforms/gravityforms": "dev-master", "phpunit/phpunit": "7.5.*", "10up/wp_mock": "0.4.*", - "szepeviktor/phpstan-wordpress": "^0.6.2", - "phpstan/phpstan-mockery": "^0.12.5", + "szepeviktor/phpstan-wordpress": "^1.0", + "phpstan/phpstan-mockery": "^1.1", "overtrue/phplint": "^2.1" }, "scripts": { diff --git a/composer.lock b/composer.lock index 818d8f4c..6af0296a 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": "7e1c8cbf65da32fab2c5aaef2376dcac", + "content-hash": "c2420b025b6683e1206b934a0f60c789", "packages": [ { "name": "ezyang/htmlpurifier", @@ -1042,6 +1042,49 @@ ], "time": "2022-12-30T00:15:36+00:00" }, + { + "name": "gravityforms/gravityforms", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:gravityforms/gravityforms.git", + "reference": "4c7b8bb00ba96b441afb45c36103622a8c9c1cad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/gravityforms/gravityforms/zipball/4c7b8bb00ba96b441afb45c36103622a8c9c1cad", + "reference": "4c7b8bb00ba96b441afb45c36103622a8c9c1cad", + "shasum": "" + }, + "require-dev": { + "lucatume/function-mocker": "~1.0", + "phpunit/phpunit": ">4.0 <7", + "yoast/phpunit-polyfills": "^1.0" + }, + "default-branch": true, + "type": "wordpress-plugin", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "rocketgenius", + "email": "support@gravityhelp.com", + "homepage": "https://gravityforms.com" + } + ], + "description": "Gravity Forms", + "homepage": "https://gravityforms.com", + "keywords": [ + "gravity forms", + "wordpress" + ], + "support": { + "issues": "https://gravityforms.com", + "source": "https://github.com/gravityforms/gravityforms/tree/master" + }, + "time": "2024-08-20T17:03:30+00:00" + }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -1444,27 +1487,28 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v5.9.9", + "version": "v6.6.0", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "06c51c4863659ea9e9f4c2a23293728a677cb059" + "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/06c51c4863659ea9e9f4c2a23293728a677cb059", - "reference": "06c51c4863659ea9e9f4c2a23293728a677cb059", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/86e8753e89d59849276dcdd91b9a7dd78bb4abe2", + "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2", "shasum": "" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "nikic/php-parser": "^4.13", - "php": "^7.4 || ~8.0.0", + "php": "^7.4 || ^8.0", "php-stubs/generator": "^0.8.3", - "phpdocumentor/reflection-docblock": "5.3", + "phpdocumentor/reflection-docblock": "^5.4.1", "phpstan/phpstan": "^1.10.49", "phpunit/phpunit": "^9.5", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.11" + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", @@ -1485,9 +1529,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.9" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.6.0" }, - "time": "2024-04-14T17:16:00+00:00" + "time": "2024-07-17T08:50:38+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1720,20 +1764,20 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.100", + "version": "1.11.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "48236ddf823547081b2b153d1cd2994b784328c3" + "reference": "707c2aed5d8d0075666e673a5e71440c1d01a5a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/48236ddf823547081b2b153d1cd2994b784328c3", - "reference": "48236ddf823547081b2b153d1cd2994b784328c3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/707c2aed5d8d0075666e673a5e71440c1d01a5a3", + "reference": "707c2aed5d8d0075666e673a5e71440c1d01a5a3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.2|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -1743,11 +1787,6 @@ "phpstan.phar" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -1758,9 +1797,16 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.100" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -1770,44 +1816,38 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2022-11-01T09:52:08+00:00" + "time": "2024-08-19T14:37:29+00:00" }, { "name": "phpstan/phpstan-mockery", - "version": "0.12.14", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-mockery.git", - "reference": "7cc74bf434b3c2190f7f4cfc08c74f7c0b65667f" + "reference": "88ae85931768efd3aaf3cce4cb9cb54c4d157d03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/7cc74bf434b3c2190f7f4cfc08c74f7c0b65667f", - "reference": "7cc74bf434b3c2190f7f4cfc08c74f7c0b65667f", + "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/88ae85931768efd3aaf3cce4cb9cb54c4d157d03", + "reference": "88ae85931768efd3aaf3cce4cb9cb54c4d157d03", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^0.12.60" + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.10" }, "require-dev": { "mockery/mockery": "^1.2.4", + "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^0.12.16", - "phpstan/phpstan-strict-rules": "^0.12.5", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", "phpunit/phpunit": "^9.5" }, "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - }, "phpstan": { "includes": [ "extension.neon" @@ -1826,9 +1866,9 @@ "description": "PHPStan Mockery extension", "support": { "issues": "https://github.com/phpstan/phpstan-mockery/issues", - "source": "https://github.com/phpstan/phpstan-mockery/tree/0.12.14" + "source": "https://github.com/phpstan/phpstan-mockery/tree/1.1.2" }, - "time": "2021-06-10T12:12:36+00:00" + "time": "2024-01-10T13:50:05+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2874,16 +2914,16 @@ }, { "name": "symfony/console", - "version": "v5.4.41", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", - "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", "shasum": "" }, "require": { @@ -2953,7 +2993,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.41" + "source": "https://github.com/symfony/console/tree/v5.4.42" }, "funding": [ { @@ -2969,7 +3009,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T07:48:55+00:00" + "time": "2024-07-26T12:21:55+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3040,16 +3080,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.40", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" + "reference": "0724c51fa067b198e36506d2864e09a52180998a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", + "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", + "reference": "0724c51fa067b198e36506d2864e09a52180998a", "shasum": "" }, "require": { @@ -3083,7 +3123,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.40" + "source": "https://github.com/symfony/finder/tree/v5.4.42" }, "funding": [ { @@ -3099,7 +3139,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-07-22T08:53:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3642,16 +3682,16 @@ }, { "name": "symfony/string", - "version": "v5.4.41", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096" + "reference": "909cec913edea162a3b2836788228ad45fcab337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/065a9611e0b1fd2197a867e1fb7f2238191b7096", - "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096", + "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", + "reference": "909cec913edea162a3b2836788228ad45fcab337", "shasum": "" }, "require": { @@ -3708,7 +3748,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.41" + "source": "https://github.com/symfony/string/tree/v5.4.42" }, "funding": [ { @@ -3724,7 +3764,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T09:20:55+00:00" + "time": "2024-07-20T18:38:32+00:00" }, { "name": "symfony/yaml", @@ -3803,30 +3843,35 @@ }, { "name": "szepeviktor/phpstan-wordpress", - "version": "v0.6.6", + "version": "v1.3.5", "source": { "type": "git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git", - "reference": "f5040549dc5f46d81ea2432de726c2a0a4ad1141" + "reference": "7f8cfe992faa96b6a33bbd75c7bace98864161e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/f5040549dc5f46d81ea2432de726c2a0a4ad1141", - "reference": "f5040549dc5f46d81ea2432de726c2a0a4ad1141", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/7f8cfe992faa96b6a33bbd75c7bace98864161e7", + "reference": "7f8cfe992faa96b6a33bbd75c7bace98864161e7", "shasum": "" }, "require": { - "php": "~7.1", - "php-stubs/wordpress-stubs": "^4.7 || ^5.0", - "phpstan/phpstan": "^0.12.26", + "php": "^7.2 || ^8.0", + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", + "phpstan/phpstan": "^1.10.31", "symfony/polyfill-php73": "^1.12.0" }, "require-dev": { - "composer/composer": "^1.8.6", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "composer/composer": "^2.1.14", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.1", - "phpstan/phpstan-strict-rules": "^0.12", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.4.3" + "phpstan/phpstan-strict-rules": "^1.2", + "phpunit/phpunit": "^8.0 || ^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" + }, + "suggest": { + "swissspidy/phpstan-no-private": "Detect usage of internal core functions, classes and methods" }, "type": "phpstan-extension", "extra": { @@ -3838,7 +3883,7 @@ }, "autoload": { "psr-4": { - "PHPStan\\WordPress\\": "src/" + "SzepeViktor\\PHPStan\\WordPress\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3855,15 +3900,9 @@ ], "support": { "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", - "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v0.6.6" + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.5" }, - "funding": [ - { - "url": "https://www.paypal.me/szepeviktor", - "type": "custom" - } - ], - "time": "2020-10-18T12:11:45+00:00" + "time": "2024-06-28T22:27:19+00:00" }, { "name": "theseer/tokenizer", @@ -3977,7 +4016,8 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "gravitykit/gravityexport-base": 20 + "gravitykit/gravityexport-base": 20, + "gravityforms/gravityforms": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/phpstan.neon b/phpstan.neon index 98fdeb12..e9ed009f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -11,6 +11,8 @@ parameters: bootstrapFiles: - gfexcel.php - tests/phpstan/bootstrap.php + editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' + inferPrivatePropertyTypeFromConstructor: true # autoload_files: # # Missing constants, function and class stubs @@ -24,11 +26,16 @@ parameters: paths: - src - tests + + scanDirectories: + - vendor/gravityforms/gravityforms # Gravity Forms has no `autoload` section, so we need to configure the path. + - /Users/doekenorg/Sites/gravity-export/wp-content/plugins/gravityformssurvey + # excludes_analyse: # - %currentWorkingDirectory%/inc/views/ ignoreErrors: - - '/Function gform_tooltip not found\./' - - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' +# - '/Function gform_tooltip not found\./' +# - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' - '/^Function gf_apply_filters invoked with \d+ parameters, 2 required.$/' - '/^Function gf_do_action invoked with \d+ parameters, 1 required.$/' - '/Parameter #3 \$default of function rgar expects string\|null/' @@ -46,4 +53,4 @@ parameters: # - '/^Parameter #2 \$deprecated of function load_plugin_textdomain expects string, false given\.$/' # WP-CLI accepts a class as callable # - '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/' - # Please consider commenting ignores: issue URL or reason for ignoring \ No newline at end of file + # Please consider commenting ignores: issue URL or reason for ignoring diff --git a/src/Action/CountDownloads.php b/src/Action/CountDownloads.php index 3f593503..a494b6cd 100644 --- a/src/Action/CountDownloads.php +++ b/src/Action/CountDownloads.php @@ -36,6 +36,7 @@ public function __construct() { * @since 1.6.1 * * @param int $form_id The form id. + * @return void */ public function incrementCounter( $form_id ) { // Get the form data. diff --git a/src/Action/FilterRequest.php b/src/Action/FilterRequest.php index 729a918d..294d4d1e 100644 --- a/src/Action/FilterRequest.php +++ b/src/Action/FilterRequest.php @@ -58,7 +58,7 @@ class FilterRequest */ public function __construct() { - add_action('request', [$this, 'request'], 0); + add_filter('request', [$this, 'request'], 0); add_filter('query_vars', [$this, 'getQueryVars']); add_filter('gfexcel_output_search_criteria', [$this, 'setSearchCriteria'], 0); } @@ -119,18 +119,15 @@ public function setSearchCriteria($criteria) * Parses a filter-string and adds the filters to the internal array. * @since 1.7.0 * @param string $filter_string the string that contains the filters. - * + * @return void */ - private function parseFilters(string $filter_string) - { - $sets = explode(';', $filter_string); - if (count($sets) > 0) { - foreach ($sets as $set_string) { - $filter = explode(':', $set_string); - $this->addFilter($filter); - } - } - } + private function parseFilters( string $filter_string ) { + $sets = explode( ';', $filter_string ); + foreach ( $sets as $set_string ) { + $filter = explode( ':', $set_string ); + $this->addFilter( $filter ); + } + } /** * Adds the filter to the internal array. diff --git a/src/Action/NotificationAttachmentAction.php b/src/Action/NotificationAttachmentAction.php index d926c804..d56129b3 100644 --- a/src/Action/NotificationAttachmentAction.php +++ b/src/Action/NotificationAttachmentAction.php @@ -24,7 +24,7 @@ final class NotificationAttachmentAction { * @since 2.0.0 */ public function __construct() { - add_action( 'gform_notification', \Closure::fromCallable( [ $this, 'handle_notification' ] ), 10, 3 ); + add_filter( 'gform_notification', \Closure::fromCallable( [ $this, 'handle_notification' ] ), 10, 3 ); add_action( 'gform_after_email', \Closure::fromCallable( [ $this, 'remove_temporary_file' ] ), 10, 13 ); } diff --git a/src/Addon/GravityExportAddon.php b/src/Addon/GravityExportAddon.php index 964f75aa..ada41991 100644 --- a/src/Addon/GravityExportAddon.php +++ b/src/Addon/GravityExportAddon.php @@ -14,6 +14,7 @@ use GFExcel\GravityForms\Field\DownloadFile; use GFExcel\GravityForms\Field\DownloadUrl; use GFExcel\GravityForms\Field\SortFields; +use GFExcel\Renderer\AbstractPHPExcelRenderer; use GFExcel\Renderer\PHPExcelMultisheetRenderer; use GFExcel\Repository\FieldsRepository; use GFExcel\Repository\FormRepositoryInterface; @@ -23,7 +24,7 @@ * GravityExport Lite add-on. * @since 2.0.0 */ -final class GravityExportAddon extends \GFFeedAddon implements AddonInterface, ActionAwareInterface { +final class GravityExportAddon extends \GFFeedAddOn implements AddonInterface, ActionAwareInterface { use ActionAware; use AddonTrait; use AddonHelperTrait; @@ -154,10 +155,10 @@ public function __construct( FormRepositoryInterface $form_repository ) { public function init_admin(): void { parent::init_admin(); - add_action( 'bulk_actions-toplevel_page_gf_edit_forms', \Closure::fromCallable( [ $this, 'bulk_actions' ] ) ); + add_filter( 'bulk_actions-toplevel_page_gf_edit_forms', \Closure::fromCallable( [ $this, 'bulk_actions' ] ) ); add_action( 'wp_loaded', \Closure::fromCallable( [ $this, 'handle_bulk_actions' ] ) ); add_filter( 'gform_form_actions', \Closure::fromCallable( [ $this, 'gform_form_actions' ] ), 10, 2 ); - add_filter( 'wp_before_admin_bar_render', \Closure::fromCallable( [ $this, 'admin_bar' ] ), 20 ); + add_action( 'wp_before_admin_bar_render', \Closure::fromCallable( [ $this, 'admin_bar' ] ), 20 ); add_filter( 'gform_export_fields', \Closure::fromCallable( [ $this, 'gform_export_fields' ] ) ); } @@ -898,7 +899,7 @@ public function get_feed_by_form_id( int $form_id = 0 ): ?array { * * @param string $field The name of the meta field. * @param int $form_id The form id. - * @param null $default The default value. + * @param mixed|null $default The default value. * * @return mixed The field value. */ @@ -924,7 +925,6 @@ private function bulk_actions( array $actions ): array { } /** - * /** * Handles the download of multiple forms as a bulk action. * @since 1.2.0 * @throws \PhpOffice\PhpSpreadsheet\Exception When the file could not be rendered. @@ -951,6 +951,10 @@ private function handle_bulk_actions(): void { ? new PHPExcelMultisheetRenderer() : GFExcel::getRenderer( current( $form_ids ) ); + if ( ! $renderer instanceof AbstractPHPExcelRenderer ) { + return; + } + foreach ( $form_ids as $form_id ) { $feed = $this->get_feed_by_form_id( $form_id ); $output = new GFExcelOutput( (int) $form_id, $renderer, null, $feed['id'] ?? null ); @@ -983,7 +987,7 @@ private function get_bulk_action(): ?string { * @return array The new form actions. */ private function gform_form_actions( array $form_actions, string $form_id ): array { - if ( $url = GFExcel::url( $form_id ) ) { + if ( $url = GFExcel::url( (int) $form_id ) ) { $form_actions['download'] = [ 'label' => __( 'Download', 'gk-gravityexport-lite' ), @@ -1062,6 +1066,10 @@ public function can_duplicate_feed( $id ): bool { */ public function duplicate_feed( $id, $new_form_id = false ): ?int { $new_feed_id = parent::duplicate_feed( $id, $new_form_id ); + if ( ! $new_feed_id ) { + return null; + } + $new_feed = \GFAPI::get_feed( $new_feed_id ); if ( is_array( $new_feed ) && $this->hasAction( DownloadUrlResetAction::$name ) ) { diff --git a/src/Component/Usage.php b/src/Component/Usage.php index b7dd94d1..02eb1231 100644 --- a/src/Component/Usage.php +++ b/src/Component/Usage.php @@ -23,7 +23,7 @@ public function getCount( bool $number_format = true ): string { require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); } - /** @var \stdClass $data */ + /** @var object|array $data */ $data = plugins_api( 'plugin_information', [ 'slug' => 'gf-entries-in-excel', 'fields' => [ 'active_installs' => true ], @@ -56,7 +56,7 @@ public function getTarget( bool $number_format = true ): string { // What step should we reach for? $next_level = 1000; - $usage_target = ( ( $current_count / $next_level ) + 1 ) * $next_level; + $usage_target = ( ( (int) $current_count / $next_level ) + 1 ) * $next_level; return (string) $number_format ? number_format_i18n( $usage_target ) : $usage_target; } diff --git a/src/Field/Meta/CreatedBy.php b/src/Field/Meta/CreatedBy.php index 1fb5676a..25c00792 100644 --- a/src/Field/Meta/CreatedBy.php +++ b/src/Field/Meta/CreatedBy.php @@ -8,13 +8,13 @@ class CreatedBy extends MetaField { /** @var string */ - const USER_ID = 'user_id'; + public const USER_ID = 'user_id'; /** @var string */ - const NICKNAME = 'nickname'; + public const NICKNAME = 'nickname'; /** @var string */ - const DISPLAY_NAME = 'display_name'; + public const DISPLAY_NAME = 'display_name'; /** * {@inheritdoc} @@ -54,10 +54,11 @@ public function getValueType() */ private function getUserName($user_id, $property = 'nickname') { - if (!is_numeric($user_id) || (!$user = get_userdata($user_id))) { - // no user id or no user, return default. - return $user_id; - } + $user = get_userdata( $user_id ); + if ( ! $user ) { + // no user id or no user, return default. + return $user_id; + } if (!isset($user->$property)) { throw new \InvalidArgumentException(sprintf('User object does not contain the property \'%s\'', $property)); diff --git a/src/Field/ProductField.php b/src/Field/ProductField.php index ff31e768..359d60ab 100644 --- a/src/Field/ProductField.php +++ b/src/Field/ProductField.php @@ -98,12 +98,12 @@ protected function getGFieldValue($entry, $input_id) /** * Whether the product field has a numeric value / price. - * @return bool. + * @return bool */ protected function hasNumericPrice(): bool { $plugin = GravityExportAddon::get_instance(); - return gf_apply_filters( [ + return (bool) gf_apply_filters( [ 'gfexcel_numeric_price', $this->field->get_input_type(), $this->field->formId, diff --git a/src/Field/SurveyLikertField.php b/src/Field/SurveyLikertField.php index 89d6f410..89eea079 100644 --- a/src/Field/SurveyLikertField.php +++ b/src/Field/SurveyLikertField.php @@ -25,7 +25,7 @@ public function getFieldValue( $entry, $input_id = '' ) { } return $this->field->gsurveyLikertEnableMultipleRows - ? $this->field->get_column_text( false, $entry, $input_id, true ) + ? $this->field->get_column_text( '', $entry, $input_id, true ) : $this->field->get_value_export( $entry, $input_id ); } diff --git a/src/GFExcel.php b/src/GFExcel.php index 6d3b3099..6660ec5c 100644 --- a/src/GFExcel.php +++ b/src/GFExcel.php @@ -45,7 +45,7 @@ class GFExcel /** * The endpoint slug of the plugin. * @since 1.0.0 - * @var string + * @var string[] */ public static $endpoints = [ 'gf-entries-in-excel', @@ -71,11 +71,11 @@ class GFExcel */ public function __construct() { - add_action('init', [$this, 'addPermalinkRules']); - add_action('request', [$this, 'request']); - add_action('parse_request', [$this, 'downloadFile']); - add_filter('query_vars', [$this, 'getQueryVars']); - add_filter('robots_txt', [$this, 'robotsTxt']); + add_action( 'init', [ $this, 'addPermalinkRules' ] ); + add_filter( 'request', [ $this, 'request' ] ); + add_filter( 'parse_request', [ $this, 'downloadFile' ] ); + add_filter( 'query_vars', [ $this, 'getQueryVars' ] ); + add_filter( 'robots_txt', [ $this, 'robotsTxt' ] ); } /** Return the url for the form @@ -179,11 +179,11 @@ public static function getFilename( $form ) { * @return string The file extension. */ public static function getFileExtension( $form ) { - if ( ! static::$file_extension ) { + if ( ! self::$file_extension ) { $form_id = rgar( $form, 'id', 0 ); $extension = gf_apply_filters( [ - static::KEY_FILE_EXTENSION, + self::KEY_FILE_EXTENSION, $form_id, ], GravityExportAddon::get_instance()->get_feed_meta_field( 'file_extension', $form_id, 'xlsx' ), @@ -197,7 +197,7 @@ public static function getFileExtension( $form ) { return $extension; } - return static::$file_extension; + return self::$file_extension; } /** @@ -240,6 +240,7 @@ public static function canDownloadForm( int $form_id ): bool { * Registers the permalink structures for the download * * @since 1.0.0 + * @return void */ public function addPermalinkRules() { @@ -289,7 +290,7 @@ public function request($query_vars) if ( preg_match( '/\\.(' . GFExcel::getPluginFileExtensions( true ) . ')$/is', $hash, $match ) ) { $hash = str_replace( $match[0], '', $hash ); - static::$file_extension = $match[1]; + self::$file_extension = $match[1]; } $feed = $this->getFeedByHash( $hash ); @@ -342,7 +343,7 @@ public function downloadFile(\WP $wp) * @used-by \GFExcel\Action\CountDownloads::incrementCounter * * @param int $form_id ID of the form being downloaded - * @param GFExcelOutput Output of the file + * @param GFExcelOutput $output Output of the file */ do_action(GFExcelConfigConstants::GFEXCEL_EVENT_DOWNLOAD, $form_id, $output); @@ -438,7 +439,7 @@ public static function isFormSecured( int $form_id ) { $feed = GravityExportAddon::get_instance()->get_feed_by_form_id($form_id); - return (bool) rgars( $feed, 'meta/is_secured', false ); + return (bool) rgars( $feed, 'meta/is_secured' ); } /** diff --git a/src/GFExcelOutput.php b/src/GFExcelOutput.php index 14fd2573..b1507199 100644 --- a/src/GFExcelOutput.php +++ b/src/GFExcelOutput.php @@ -197,7 +197,7 @@ private function getForm() * * @since 1.9 * - * @return array|false + * @return array */ private function getFeed() { @@ -231,7 +231,7 @@ private function getFieldColumns(\GF_Field $field) { $fieldClass = $this->transformer->transform($field); return array_filter($fieldClass->getColumns(), function ($column) { - return $column instanceof BaseValue; + return $column instanceof BaseValue; // @phpstan-ignore instanceof.alwaysTrue }); } diff --git a/src/GravityForms/Field/DownloadUrl.php b/src/GravityForms/Field/DownloadUrl.php index 7ebb0491..7c05b0e9 100644 --- a/src/GravityForms/Field/DownloadUrl.php +++ b/src/GravityForms/Field/DownloadUrl.php @@ -29,9 +29,8 @@ class DownloadUrl extends Text { /** * This is a readonly field. * @since 2.0.0 - * @var bool */ - public $readonly = true; + public $readonly = 'readonly'; /** * @inheritdoc diff --git a/src/Renderer/AbstractPHPExcelRenderer.php b/src/Renderer/AbstractPHPExcelRenderer.php index 6f18e68b..6d37d3dc 100644 --- a/src/Renderer/AbstractPHPExcelRenderer.php +++ b/src/Renderer/AbstractPHPExcelRenderer.php @@ -159,11 +159,9 @@ public function fatalHandler(): void */ protected function autoSizeColumns(Worksheet $worksheet, int $columns_count): AbstractPHPExcelRenderer { - for ($i = 1; $i <= $columns_count; $i++) { - if ($dimension = $worksheet->getColumnDimensionByColumn($i)) { - $dimension->setAutoSize(true); - } - } + for ( $i = 1; $i <= $columns_count; $i ++ ) { + $worksheet->getColumnDimensionByColumn( $i )->setAutoSize( true ); + } $max_width = gf_apply_filters([ 'gfexcel_renderer_columns_max_width', @@ -198,9 +196,9 @@ protected function addCellsToWorksheet(Worksheet $worksheet, array $matrix, int $form_id, ], false, $row); - if ($hide_row && ($row_dimension = $worksheet->getRowDimension($x + 1))) { - $row_dimension->setVisible(false); - } + if ( $hide_row ) { + $worksheet->getRowDimension( $x + 1 )->setVisible( false ); + } foreach ($row as $i => $value) { try { @@ -211,13 +209,8 @@ protected function addCellsToWorksheet(Worksheet $worksheet, array $matrix, int $this->getCellType($value) ); - $cell = $worksheet->getCellByColumnAndRow($i + 1, $x + 1); - if (!$cell) { - // This isn't going to happen, but it makes the IDE happy. - continue; - } - - $this->setProperties($cell, $value, $form_id); + $cell = $worksheet->getCellByColumnAndRow( $i + 1, $x + 1 ); + $this->setProperties( $cell, $value, $form_id ); $wrap_text = (bool) gf_apply_filters([ 'gfexcel_renderer_wrap_text', @@ -405,12 +398,12 @@ private function setCellStyle(Cell $cell, $value): bool } if ($value->hasBorder()) { - $array = array_filter([ - $value->getBorderPosition() => array_filter([ - 'borderStyle' => Border::BORDER_THIN, - 'color' => $value->getBorderColor() ? ['rgb' => $value->getBorderColor()] : null, - ]), - ]); + $array = [ + $value->getBorderPosition() => array_filter( [ + 'borderStyle' => Border::BORDER_THIN, + 'color' => $value->getBorderColor() ? [ 'rgb' => $value->getBorderColor() ] : null, + ] ), + ]; $cell->getStyle()->getBorders()->applyFromArray($array); } diff --git a/src/ServiceProvider/AddOnProvider.php b/src/ServiceProvider/AddOnProvider.php index 4064c776..5941c55a 100644 --- a/src/ServiceProvider/AddOnProvider.php +++ b/src/ServiceProvider/AddOnProvider.php @@ -20,7 +20,9 @@ use GFExcel\Notification\Repository\NotificationRepository; use GFExcel\Notification\Repository\NotificationRepositoryInterface; use GFExcel\Shortcode\DownloadUrl; +use League\Container\Container; use League\Container\Definition\DefinitionInterface; +use Psr\Container\ContainerInterface; /** * Service provider for the gravity forms add-on. @@ -103,4 +105,18 @@ public function boot(): void { $this->addAction( DownloadUrlDisableAction::class ); $this->addAction( DownloadCountResetAction::class ); } + + /** + * {@inheritDoc} + * Overwritten to ensure proper container type. + * @since $ver$ + * @return Container + */ + public function getContainer(): ContainerInterface { + if ( ! $this->container instanceof Container ) { + throw new \InvalidArgumentException( 'Wrong container type provided.' ); + } + + return $this->container; + } } diff --git a/src/Shortcode/DownloadUrl.php b/src/Shortcode/DownloadUrl.php index c72753a0..1c2140c5 100644 --- a/src/Shortcode/DownloadUrl.php +++ b/src/Shortcode/DownloadUrl.php @@ -168,7 +168,7 @@ private static function is_embed_protected( array $feed ): bool { return true; } - return (bool) rgars( $feed, 'meta/has_embed_secret', false ); + return (bool) rgars( $feed, 'meta/has_embed_secret' ); } /** diff --git a/src/Shorttag/DownloadUrl.php b/src/Shorttag/DownloadUrl.php index fe3a9053..12511852 100644 --- a/src/Shorttag/DownloadUrl.php +++ b/src/Shorttag/DownloadUrl.php @@ -1,10 +1,7 @@ manager->getMigrations(); self::assertCount( 3, $migrations ); + /** @var Test_Migration_1_0_0[] $migrations */ foreach ( $migrations as $migration ) { self::assertTrue( $migration->ran ); self::assertSame( $this->manager, $migration->getManager() ); diff --git a/tests/Transformer/TransformerTest.php b/tests/Transformer/TransformerTest.php index 77d85a59..13958f1c 100644 --- a/tests/Transformer/TransformerTest.php +++ b/tests/Transformer/TransformerTest.php @@ -44,6 +44,7 @@ public function testTransformWithCustomField(): void { $this->field->method( 'get_input_type' )->willReturn( 'test' ); + /** @var TestField $field */ $field = $transformer->transform( $this->field ); self::assertInstanceOf( TestField::class, $field ); @@ -73,13 +74,15 @@ public function testTransformWithSeparableField(): void { final class TestField implements FieldInterface, TransformerAwareInterface { public $transformer; - public function __construct( \GF_Field $field ) { + public function __construct( \GF_Field $field ) { // @phpstan-ignore constructor.unusedParameter } public function getColumns() { + return []; } public function getCells( $entry ) { + return []; } public function setTransformer( Transformer $transformer ): void { From abb1c41dab61f8a4698c6c71d44501f648cf5ae8 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Mon, 26 Aug 2024 12:20:33 +0200 Subject: [PATCH 03/13] Remove need for inner composer.json --- composer.json | 2 +- src/Addon/GravityExportAddon.php | 4 ++-- src/composer.json | 10 ---------- 3 files changed, 3 insertions(+), 13 deletions(-) delete mode 100644 src/composer.json diff --git a/composer.json b/composer.json index b050e87a..94a2950b 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "@unbuild", "cp composer.json build/composer.json", "mkdir build/src && cp src/GFExcelAdmin.php build/src/", - "composer config repositories.source '{\"type\":\"path\", \"url\":\"../src\",\"options\": {\"symlink\":false}}' --working-dir=build", + "composer config repositories.source '{\"type\":\"package\", \"package\": { \"name\": \"gravitykit/gravityexport-lite-src\", \"version\": \"dev-main\", \"dist\": { \"type\": \"path\", \"url\":\"../src\", \"options\": {\"symlink\":false}}}}' --working-dir=build", "composer require gravitykit/gravityexport-lite-src:@dev --update-no-dev --working-dir=build --no-scripts", "cd build && ./strauss.phar", "composer dump-autoload -o --working-dir=build" diff --git a/src/Addon/GravityExportAddon.php b/src/Addon/GravityExportAddon.php index ada41991..93b26a08 100644 --- a/src/Addon/GravityExportAddon.php +++ b/src/Addon/GravityExportAddon.php @@ -125,8 +125,8 @@ public function minimum_requirements(): array { 'dom', 'zlib', 'xml', - 'iconv', - 'mbstring', + 'iconv', + 'mbstring', ], ] ]; diff --git a/src/composer.json b/src/composer.json deleted file mode 100644 index ac414663..00000000 --- a/src/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "gravitykit/gravityexport-lite-src", - "description": "Internal package for build purposes", - "type": "library", - "autoload": { - "psr-4": { - "GFExcel\\": "./" - } - } -} From cc3d6450e818e234455eeec5a8fa29eb24280687 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 27 Aug 2024 11:00:13 +0200 Subject: [PATCH 04/13] Fix PHPStan issues --- .gitattributes | 3 +- .gitignore | 1 + phpstan-stubs/gravityforms.php.stub | 38 ++++++++++++ phpstan.neon | 56 ----------------- phpstan.neon.dist | 40 ++++++++++++ src/Renderer/PHPExcelRenderer.php | 61 +++++++++---------- tests/Action/NotificationsActionTest.php | 6 +- .../Repository/NotificationRepositoryTest.php | 6 +- 8 files changed, 119 insertions(+), 92 deletions(-) create mode 100644 phpstan-stubs/gravityforms.php.stub delete mode 100644 phpstan.neon create mode 100644 phpstan.neon.dist diff --git a/.gitattributes b/.gitattributes index ea3b568e..fbde67ec 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,7 +11,8 @@ phpunit.xml.dist export-ignore README.md export-ignore strauss.phar export-ignore build export-ignore -tests +tests export-ignore +phpstan-stubs export-ignore /.circleci export-ignore /.github export-ignore diff --git a/.gitignore b/.gitignore index 6d93d504..258571e4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ vendor_prefixed !vendor_prefixed/.gitkeep !build/strauss.phar !build/vendor_prefixed/.gitkeep +phpstan.neon diff --git a/phpstan-stubs/gravityforms.php.stub b/phpstan-stubs/gravityforms.php.stub new file mode 100644 index 00000000..5c8e9b61 --- /dev/null +++ b/phpstan-stubs/gravityforms.php.stub @@ -0,0 +1,38 @@ + $array Array from which the property's value should be retrieved. + * @param string $prop Name of the property to be retrieved. + * @param mixed $default Optional. Value that should be returned if the property is not set or empty. Defaults to null. + * + * @return null|string|mixed The value + */ +function rgar( $array, $prop, $default = null ) { +} diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index e9ed009f..00000000 --- a/phpstan.neon +++ /dev/null @@ -1,56 +0,0 @@ -#$ composer update --optimize-autoloader -#$ vendor/bin/phpstan analyze - -includes: - # @see https://github.com/phpstan/phpstan-src/blob/master/conf/bleedingEdge.neon - - phar://phpstan.phar/conf/bleedingEdge.neon - # Include this extension - - vendor/szepeviktor/phpstan-wordpress/extension.neon -parameters: - level: 5 - bootstrapFiles: - - gfexcel.php - - tests/phpstan/bootstrap.php - editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' - - inferPrivatePropertyTypeFromConstructor: true - # autoload_files: - # # Missing constants, function and class stubs - # - %currentWorkingDirectory%/tests/phpstan/bootstrap.php - # # Plugin stubs - # - %currentWorkingDirectory%/tests/phpstan/PLUGIN-stubs.php - # # Procedural code - # - %currentWorkingDirectory%/myplugin-functions.php - # autoload_directories: - # - %currentWorkingDirectory%/inc/ - paths: - - src - - tests - - scanDirectories: - - vendor/gravityforms/gravityforms # Gravity Forms has no `autoload` section, so we need to configure the path. - - /Users/doekenorg/Sites/gravity-export/wp-content/plugins/gravityformssurvey - - # excludes_analyse: - # - %currentWorkingDirectory%/inc/views/ - ignoreErrors: -# - '/Function gform_tooltip not found\./' -# - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' - - '/^Function gf_apply_filters invoked with \d+ parameters, 2 required.$/' - - '/^Function gf_do_action invoked with \d+ parameters, 1 required.$/' - - '/Parameter #3 \$default of function rgar expects string\|null/' - # Unit tests edge cases - - '/^Result of method .*?::.*?\(\) \(void\) is used.$/' - - '/MockObject|stdClass>? given.$/' - # Fixed in WordPress 5.3 - #- '#^Function do_action(_ref_array)? invoked with [3456] parameters, 1-2 required\.$#' - #- '#^Function current_user_can invoked with 2 parameters, 1 required\.$#' - #- '#^Function add_query_arg invoked with [123] parameters?, 0 required\.$#' - #- '#^Function wp_sprintf invoked with [23456] parameters, 1 required\.$#' - #- '#^Function add_post_type_support invoked with [345] parameters, 2 required\.$#' - #- '#^Function ((get|add)_theme_support|current_theme_supports) invoked with [2345] parameters, 1 required\.$#' - # https://core.trac.wordpress.org/ticket/43304 -# - '/^Parameter #2 \$deprecated of function load_plugin_textdomain expects string, false given\.$/' - # WP-CLI accepts a class as callable -# - '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/' - # Please consider commenting ignores: issue URL or reason for ignoring diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 00000000..2b0f72f1 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,40 @@ +#$ composer update --optimize-autoloader +#$ vendor/bin/phpstan analyze + +includes: + # @see https://github.com/phpstan/phpstan-src/blob/master/conf/bleedingEdge.neon + - phar://phpstan.phar/conf/bleedingEdge.neon + # Include this extension + - vendor/szepeviktor/phpstan-wordpress/extension.neon +parameters: + level: 5 + bootstrapFiles: + - gfexcel.php + - tests/phpstan/bootstrap.php + editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' + + inferPrivatePropertyTypeFromConstructor: true + # autoload_files: + # # Missing constants, function and class stubs + # - %currentWorkingDirectory%/tests/phpstan/bootstrap.php + # # Plugin stubs + # - %currentWorkingDirectory%/tests/phpstan/PLUGIN-stubs.php + # # Procedural code + # - %currentWorkingDirectory%/myplugin-functions.php + # autoload_directories: + # - %currentWorkingDirectory%/inc/ + paths: + - src + - tests + + scanDirectories: + - vendor/gravityforms/gravityforms # Gravity Forms has no `autoload` section, so we need to configure the path. + + scanFiles: + - phpstan-stubs/gravityforms.php.stub # Needed until https://github.com/phpstan/phpstan/issues/11559 is resolved. + + # excludes_analyse: + # - %currentWorkingDirectory%/inc/views/ + ignoreErrors: + # Unit tests edge cases + - '/MockObject|stdClass>? given.$/' diff --git a/src/Renderer/PHPExcelRenderer.php b/src/Renderer/PHPExcelRenderer.php index d79b86df..9220acc2 100644 --- a/src/Renderer/PHPExcelRenderer.php +++ b/src/Renderer/PHPExcelRenderer.php @@ -59,42 +59,41 @@ protected function getFileName() * @param string $title * @return PHPExcelRenderer */ - private function setTitle($title) - { - $title = gf_apply_filters( - [ - 'gfexcel_renderer_title', - $this->form['id'], - ], - $title, - $this->form - ); - - $this->setWorksheetTitle($this->worksheet, $this->form); - $this->spreadsheet->getProperties()->setTitle($title); - - return $this; - } + private function setTitle( $title ) { + $title = gf_apply_filters( + [ + 'gfexcel_renderer_title', + $this->form['id'], + ], + $title, + $this->form + ); + + $this->setWorksheetTitle( $this->worksheet, $this->form ); + $this->spreadsheet->getProperties()->setTitle( $title ); + + return $this; + } /** * Fluent setter for file subject. * @param string $title * @return PHPExcelRenderer */ - private function setSubject($title) - { - $title = gf_apply_filters( - [ - 'gfexcel_renderer_subject', - $this->form['id'], - ], - $title, - $this->form - ); + private function setSubject( $title ) { + $title = gf_apply_filters( + [ + 'gfexcel_renderer_subject', + $this->form['id'], + ], + $title, + $this->form + ); - $this->spreadsheet->getProperties()->setSubject($title); - return $this; - } + $this->spreadsheet->getProperties()->setSubject( (string) $title ); + + return $this; + } /** * Fluent setter for properties @@ -131,8 +130,8 @@ private function setDescription($description) $this->form ); - $this->spreadsheet->getProperties() - ->setDescription($description); + $this->spreadsheet->getProperties()->setDescription( (string) $description ); + return $this; } } diff --git a/tests/Action/NotificationsActionTest.php b/tests/Action/NotificationsActionTest.php index 5e4e2601..ca976381 100644 --- a/tests/Action/NotificationsActionTest.php +++ b/tests/Action/NotificationsActionTest.php @@ -107,7 +107,8 @@ public function testDismissNotificationWithInvalidValues(): void ], ]); - $this->assertNull($this->action->dismissNotification()); + $this->expectNotToPerformAssertions(); + $this->action->dismissNotification(); } /** @@ -158,6 +159,7 @@ public function testRegisterScripts(): void ], ]); - $this->assertNull($this->action->registerScripts()); + $this->expectNotToPerformAssertions(); + $this->action->registerScripts(); } } diff --git a/tests/Notification/Repository/NotificationRepositoryTest.php b/tests/Notification/Repository/NotificationRepositoryTest.php index dd299f89..d156a8d8 100644 --- a/tests/Notification/Repository/NotificationRepositoryTest.php +++ b/tests/Notification/Repository/NotificationRepositoryTest.php @@ -84,7 +84,8 @@ public function testMarkAsDismissed(): void 'return' => true, ]); - $this->assertNull($this->repository->markAsDismissed($notifications[0])); + $this->expectNotToPerformAssertions(); + $this->repository->markAsDismissed($notifications[0]); } /** @@ -124,7 +125,8 @@ public function testStoreNotification(): void 'return' => true, ]); - $this->assertNull($this->repository->storeNotification(...$new_notifications)); + $this->expectNotToPerformAssertions(); + $this->repository->storeNotification(...$new_notifications); } /** From 9259e44659c5545ee435c584146aab0343b6438f Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Mon, 2 Sep 2024 10:01:53 +0200 Subject: [PATCH 05/13] Fix typecast of title --- composer.json | 2 +- src/Renderer/PHPExcelRenderer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 94a2950b..1246c30c 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,7 @@ "overtrue/phplint": "^2.1" }, "scripts": { - "unbuild": "rm -rf build/composer.* build/vendor build/src", + "unbuild": "rm -rf build/composer.* build/vendor*/* build/src", "build": [ "@unbuild", "cp composer.json build/composer.json", diff --git a/src/Renderer/PHPExcelRenderer.php b/src/Renderer/PHPExcelRenderer.php index 9220acc2..2fff9a87 100644 --- a/src/Renderer/PHPExcelRenderer.php +++ b/src/Renderer/PHPExcelRenderer.php @@ -70,7 +70,7 @@ private function setTitle( $title ) { ); $this->setWorksheetTitle( $this->worksheet, $this->form ); - $this->spreadsheet->getProperties()->setTitle( $title ); + $this->spreadsheet->getProperties()->setTitle( (string) $title ); return $this; } From 14c9acd88b76b34c2f85894dc74d1fc2560fdee6 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Mon, 2 Sep 2024 10:18:05 +0200 Subject: [PATCH 06/13] Fix Github Action --- .github/workflows/phpunit.yml | 5 +++++ composer.json | 1 + 2 files changed, 6 insertions(+) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 29e14317..d073aa4b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -31,6 +31,8 @@ jobs: restore-keys: | ${{ runner.os }}-build-${{ matrix.php-versions }}- - name: Install dependencies + env: + COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{secrets.COMPOSER_AUTH}}"} }' if: steps.cache.outputs.cache-hit != 'true' # We run `--no-scripts` to avoid using Strauss during unit tests run: composer install --prefer-dist --no-progress --no-scripts @@ -40,5 +42,8 @@ jobs: - name: Run linter run: composer run-script linter + - name: Run PHPStan + run: composer run-script analyse + - name: Run test suite run: composer run-script test diff --git a/composer.json b/composer.json index 1246c30c..8ca3089f 100644 --- a/composer.json +++ b/composer.json @@ -69,6 +69,7 @@ ], "linter": "vendor/bin/phplint --no-cache", "test": "vendor/bin/phpunit", + "analyse": "vendor/bin/phpstan", "post-install-cmd": [ "composer dump-autoload -o" ], From aa5f8b65d40113b7b3bf9bfa785a960c1605168a Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Mon, 2 Sep 2024 10:24:58 +0200 Subject: [PATCH 07/13] Exclude PHPStan check in CI --- .github/workflows/phpunit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index d073aa4b..b6eaf83b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -42,8 +42,8 @@ jobs: - name: Run linter run: composer run-script linter - - name: Run PHPStan - run: composer run-script analyse +# - name: Run PHPStan +# run: composer run-script analyse - name: Run test suite run: composer run-script test From 4678987784b590f652bd6b06ca825141f301ae69 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 3 Sep 2024 09:11:44 +0200 Subject: [PATCH 08/13] Revert "Remove need for inner composer.json" This reverts commit abb1c41dab61f8a4698c6c71d44501f648cf5ae8. --- composer.json | 2 +- src/Addon/GravityExportAddon.php | 4 ++-- src/composer.json | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/composer.json diff --git a/composer.json b/composer.json index 8ca3089f..5d69d008 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "@unbuild", "cp composer.json build/composer.json", "mkdir build/src && cp src/GFExcelAdmin.php build/src/", - "composer config repositories.source '{\"type\":\"package\", \"package\": { \"name\": \"gravitykit/gravityexport-lite-src\", \"version\": \"dev-main\", \"dist\": { \"type\": \"path\", \"url\":\"../src\", \"options\": {\"symlink\":false}}}}' --working-dir=build", + "composer config repositories.source '{\"type\":\"path\", \"url\":\"../src\",\"options\": {\"symlink\":false}}' --working-dir=build", "composer require gravitykit/gravityexport-lite-src:@dev --update-no-dev --working-dir=build --no-scripts", "cd build && ./strauss.phar", "composer dump-autoload -o --working-dir=build" diff --git a/src/Addon/GravityExportAddon.php b/src/Addon/GravityExportAddon.php index 93b26a08..ada41991 100644 --- a/src/Addon/GravityExportAddon.php +++ b/src/Addon/GravityExportAddon.php @@ -125,8 +125,8 @@ public function minimum_requirements(): array { 'dom', 'zlib', 'xml', - 'iconv', - 'mbstring', + 'iconv', + 'mbstring', ], ] ]; diff --git a/src/composer.json b/src/composer.json new file mode 100644 index 00000000..ac414663 --- /dev/null +++ b/src/composer.json @@ -0,0 +1,10 @@ +{ + "name": "gravitykit/gravityexport-lite-src", + "description": "Internal package for build purposes", + "type": "library", + "autoload": { + "psr-4": { + "GFExcel\\": "./" + } + } +} From 87f27955fd407dbcfcf4d772ad8ede26a8ec3a6e Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 3 Sep 2024 09:25:30 +0200 Subject: [PATCH 09/13] Fix PHPStan for survey add-on --- .github/workflows/phpunit.yml | 4 ++-- composer.json | 13 +++++++++++++ composer.lock | 15 +++++++++++++-- phpstan.neon.dist | 1 + src/Addon/GravityExportAddon.php | 6 +++--- tests/phpstan/bootstrap.php | 5 ----- 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index b6eaf83b..d073aa4b 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -42,8 +42,8 @@ jobs: - name: Run linter run: composer run-script linter -# - name: Run PHPStan -# run: composer run-script analyse + - name: Run PHPStan + run: composer run-script analyse - name: Run test suite run: composer run-script test diff --git a/composer.json b/composer.json index 5d69d008..25ed5777 100644 --- a/composer.json +++ b/composer.json @@ -41,6 +41,18 @@ { "type": "vcs", "url": "git@github.com:gravityforms/gravityforms.git" + }, + { + "type": "package", + "package": { + "name": "gravityforms/gravitysurvey", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:gravityforms/gravityformssurvey.git", + "reference": "HEAD" + } + } } ], "autoload-dev": { @@ -50,6 +62,7 @@ }, "require-dev": { "gravityforms/gravityforms": "dev-master", + "gravityforms/gravitysurvey": "dev-master", "phpunit/phpunit": "7.5.*", "10up/wp_mock": "0.4.*", "szepeviktor/phpstan-wordpress": "^1.0", diff --git a/composer.lock b/composer.lock index 6af0296a..e55ce628 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": "c2420b025b6683e1206b934a0f60c789", + "content-hash": "1a75632605983f4878c430df0945e125", "packages": [ { "name": "ezyang/htmlpurifier", @@ -1085,6 +1085,16 @@ }, "time": "2024-08-20T17:03:30+00:00" }, + { + "name": "gravityforms/gravitysurvey", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:gravityforms/gravityformssurvey.git", + "reference": "HEAD" + }, + "type": "library" + }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -4017,7 +4027,8 @@ "minimum-stability": "stable", "stability-flags": { "gravitykit/gravityexport-base": 20, - "gravityforms/gravityforms": 20 + "gravityforms/gravityforms": 20, + "gravityforms/gravitysurvey": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 2b0f72f1..8657dd18 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -29,6 +29,7 @@ parameters: scanDirectories: - vendor/gravityforms/gravityforms # Gravity Forms has no `autoload` section, so we need to configure the path. + - vendor/gravityforms/gravitysurvey # Gravity Forms' Survey Add-on has no `autoload` section, so we need to configure the path. scanFiles: - phpstan-stubs/gravityforms.php.stub # Needed until https://github.com/phpstan/phpstan/issues/11559 is resolved. diff --git a/src/Addon/GravityExportAddon.php b/src/Addon/GravityExportAddon.php index ada41991..e98297b8 100644 --- a/src/Addon/GravityExportAddon.php +++ b/src/Addon/GravityExportAddon.php @@ -125,8 +125,8 @@ public function minimum_requirements(): array { 'dom', 'zlib', 'xml', - 'iconv', - 'mbstring', + 'iconv', + 'mbstring', ], ] ]; @@ -1070,7 +1070,7 @@ public function duplicate_feed( $id, $new_form_id = false ): ?int { return null; } - $new_feed = \GFAPI::get_feed( $new_feed_id ); + $new_feed = \GFAPI::get_feed( $new_feed_id ); if ( is_array( $new_feed ) && $this->hasAction( DownloadUrlResetAction::$name ) ) { $form_id = $new_feed['form_id'] ?? 0; diff --git a/tests/phpstan/bootstrap.php b/tests/phpstan/bootstrap.php index aac71930..b3d9bbc7 100644 --- a/tests/phpstan/bootstrap.php +++ b/tests/phpstan/bootstrap.php @@ -1,6 +1 @@ Date: Tue, 3 Sep 2024 09:30:02 +0200 Subject: [PATCH 10/13] Update GitHub cache action version --- .github/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index d073aa4b..8a86e157 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -24,7 +24,7 @@ jobs: run: composer validate - name: Cache dependencies id: cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: vendor key: ${{ runner.os }}-build-${{ matrix.php-versions }}-${{ hashFiles('composer.json') }} From d723c7a23185380beff29657fdfd64c4364d233d Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 3 Sep 2024 09:31:56 +0200 Subject: [PATCH 11/13] Update GitHub checkout action version --- .github/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 8a86e157..9dd49adb 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -13,7 +13,7 @@ jobs: matrix: php-versions: ['7.3', '7.4', '7.2'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 with: From 8b6b3edc7718cd1f3ed4e1f075a110cd7edc578d Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 3 Sep 2024 09:35:47 +0200 Subject: [PATCH 12/13] Update CircleCI machine image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e0e31aed..93ce00a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ anchors: default_job_config: &default_job_config working_directory: /home/circleci/plugin machine: - image: ubuntu-2004:202201-02 + image: default jobs: build_package_release: From 4e1565a89a1c9d66e0d5734bf491a45c51a78b05 Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Thu, 26 Sep 2024 12:12:56 -0400 Subject: [PATCH 13/13] Update composer.lock --- composer.lock | 170 +++++++++++++++++++++++++------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/composer.lock b/composer.lock index 09267767..38ff3be8 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": "1a75632605983f4878c430df0945e125", + "content-hash": "2d862b87a2548dbf43760d5b03b874ed", "packages": [ { "name": "ezyang/htmlpurifier", @@ -1128,12 +1128,12 @@ "source": { "type": "git", "url": "git@github.com:gravityforms/gravityforms.git", - "reference": "4c7b8bb00ba96b441afb45c36103622a8c9c1cad" + "reference": "b60b7c952f5c9ba7a9fcab4a692cc3bea7fded33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gravityforms/gravityforms/zipball/4c7b8bb00ba96b441afb45c36103622a8c9c1cad", - "reference": "4c7b8bb00ba96b441afb45c36103622a8c9c1cad", + "url": "https://api.github.com/repos/gravityforms/gravityforms/zipball/b60b7c952f5c9ba7a9fcab4a692cc3bea7fded33", + "reference": "b60b7c952f5c9ba7a9fcab4a692cc3bea7fded33", "shasum": "" }, "require-dev": { @@ -1163,7 +1163,7 @@ "issues": "https://gravityforms.com", "source": "https://github.com/gravityforms/gravityforms/tree/master" }, - "time": "2024-08-20T17:03:30+00:00" + "time": "2024-09-25T17:32:10+00:00" }, { "name": "gravityforms/gravitysurvey", @@ -1854,16 +1854,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.11", + "version": "1.12.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "707c2aed5d8d0075666e673a5e71440c1d01a5a3" + "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/707c2aed5d8d0075666e673a5e71440c1d01a5a3", - "reference": "707c2aed5d8d0075666e673a5e71440c1d01a5a3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", + "reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17", "shasum": "" }, "require": { @@ -1908,32 +1908,32 @@ "type": "github" } ], - "time": "2024-08-19T14:37:29+00:00" + "time": "2024-09-26T12:45:22+00:00" }, { "name": "phpstan/phpstan-mockery", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-mockery.git", - "reference": "88ae85931768efd3aaf3cce4cb9cb54c4d157d03" + "reference": "98cac6e256b4ee60fdeb26a7dd81bb271b454e80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/88ae85931768efd3aaf3cce4cb9cb54c4d157d03", - "reference": "88ae85931768efd3aaf3cce4cb9cb54c4d157d03", + "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/98cac6e256b4ee60fdeb26a7dd81bb271b454e80", + "reference": "98cac6e256b4ee60fdeb26a7dd81bb271b454e80", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" + "phpstan/phpstan": "^1.12" }, "require-dev": { - "mockery/mockery": "^1.2.4", + "mockery/mockery": "^1.6.11", "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan-strict-rules": "^1.6", "phpunit/phpunit": "^9.5" }, "type": "phpstan-extension", @@ -1956,9 +1956,9 @@ "description": "PHPStan Mockery extension", "support": { "issues": "https://github.com/phpstan/phpstan-mockery/issues", - "source": "https://github.com/phpstan/phpstan-mockery/tree/1.1.2" + "source": "https://github.com/phpstan/phpstan-mockery/tree/1.1.3" }, - "time": "2024-01-10T13:50:05+00:00" + "time": "2024-09-11T15:47:29+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3004,16 +3004,16 @@ }, { "name": "symfony/console", - "version": "v5.4.42", + "version": "v5.4.44", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" + "reference": "5b5a0aa66e3296e303e22490f90f521551835a83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "url": "https://api.github.com/repos/symfony/console/zipball/5b5a0aa66e3296e303e22490f90f521551835a83", + "reference": "5b5a0aa66e3296e303e22490f90f521551835a83", "shasum": "" }, "require": { @@ -3083,7 +3083,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.42" + "source": "https://github.com/symfony/console/tree/v5.4.44" }, "funding": [ { @@ -3099,7 +3099,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:21:55+00:00" + "time": "2024-09-20T07:56:40+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3170,16 +3170,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0724c51fa067b198e36506d2864e09a52180998a" + "reference": "ae25a9145a900764158d439653d5630191155ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", - "reference": "0724c51fa067b198e36506d2864e09a52180998a", + "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", + "reference": "ae25a9145a900764158d439653d5630191155ca0", "shasum": "" }, "require": { @@ -3213,7 +3213,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.42" + "source": "https://github.com/symfony/finder/tree/v5.4.43" }, "funding": [ { @@ -3229,24 +3229,24 @@ "type": "tidelift" } ], - "time": "2024-07-22T08:53:29+00:00" + "time": "2024-08-13T14:03:51+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", - "reference": "0424dff1c58f028c451efff2045f5d92410bd540", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -3292,7 +3292,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -3308,24 +3308,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -3370,7 +3370,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -3386,24 +3386,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -3451,7 +3451,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -3467,24 +3467,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", - "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -3527,7 +3527,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -3543,24 +3543,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -3607,7 +3607,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -3623,20 +3623,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v5.4.40", + "version": "v5.4.44", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046" + "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "url": "https://api.github.com/repos/symfony/process/zipball/1b9fa82b5c62cd49da8c9e3952dd8531ada65096", + "reference": "1b9fa82b5c62cd49da8c9e3952dd8531ada65096", "shasum": "" }, "require": { @@ -3669,7 +3669,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.40" + "source": "https://github.com/symfony/process/tree/v5.4.44" }, "funding": [ { @@ -3685,7 +3685,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-17T12:46:43+00:00" }, { "name": "symfony/service-contracts", @@ -3772,16 +3772,16 @@ }, { "name": "symfony/string", - "version": "v5.4.42", + "version": "v5.4.44", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "909cec913edea162a3b2836788228ad45fcab337" + "reference": "832caa16b6d9aac6bf11747315225f5aba384c24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", - "reference": "909cec913edea162a3b2836788228ad45fcab337", + "url": "https://api.github.com/repos/symfony/string/zipball/832caa16b6d9aac6bf11747315225f5aba384c24", + "reference": "832caa16b6d9aac6bf11747315225f5aba384c24", "shasum": "" }, "require": { @@ -3838,7 +3838,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.42" + "source": "https://github.com/symfony/string/tree/v5.4.44" }, "funding": [ { @@ -3854,20 +3854,20 @@ "type": "tidelift" } ], - "time": "2024-07-20T18:38:32+00:00" + "time": "2024-09-20T07:56:40+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.40", + "version": "v5.4.44", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83" + "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/81cad0ceab3d61fe14fe941ff18a230ac9c80f83", - "reference": "81cad0ceab3d61fe14fe941ff18a230ac9c80f83", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7025b964f123bbf1896d7563db6ec7f1f63e918a", + "reference": "7025b964f123bbf1896d7563db6ec7f1f63e918a", "shasum": "" }, "require": { @@ -3913,7 +3913,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.40" + "source": "https://github.com/symfony/yaml/tree/v5.4.44" }, "funding": [ { @@ -3929,7 +3929,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-16T14:36:56+00:00" }, { "name": "szepeviktor/phpstan-wordpress",