Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
- name: Run PHPUnit
run: ./vendor/bin/phpunit

- name: Run Psalm
run: ./vendor/bin/psalm --show-info=false --threads=2
- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --error-format=github

- name: Run PhpCS
run: ./vendor/bin/phpcs -n --parallel=2 --runtime-set ignore_warnings_on_exit 1
4 changes: 4 additions & 0 deletions .idea/WooCommerce.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@
"inpsyde/php-coding-standards": "^1.0.0",
"inpsyde/composer-assets-compiler": "^2.5",
"php-stubs/wordpress-stubs": "^5.0@stable",
"php-stubs/woocommerce-stubs": "7.9.0",
"php-stubs/woocommerce-stubs": "^10.6",
"vimeo/psalm": "^4.8 || ^5.13.0",
"vlucas/phpdotenv": "^5.6"
"vlucas/phpdotenv": "^5.6",
"szepeviktor/phpstan-wordpress": "^1.3",
"phpstan/extension-installer": "^1.4",
"php-stubs/woocommerce-subscriptions-stubs": "^8.4"
},
"autoload": {
"psr-4": {
Expand All @@ -59,6 +62,8 @@
"fix-coding-standards": "vendor/bin/phpcbf",
"tests": "@php ./vendor/phpunit/phpunit/phpunit --coverage-text",
"tests:no-cov": "@php ./vendor/phpunit/phpunit/phpunit --no-coverage",
"phpstan": "vendor/bin/phpstan analyse",
"phpstan:raw": "vendor/bin/phpstan analyse --no-progress --error-format=raw",
"check-psalm": "vendor/bin/psalm",
"check-psalm:no-cache": "vendor/bin/psalm --no-cache"
},
Expand Down Expand Up @@ -98,7 +103,8 @@
"composer/package-versions-deprecated": true,
"automattic/jetpack-autoloader": false,
"composer/installers": true,
"inpsyde/composer-assets-compiler": true
"inpsyde/composer-assets-compiler": true,
"phpstan/extension-installer": true
}
}
}
224 changes: 217 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions inc/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ function is_order_received_page()

if (!function_exists('untrailingslashit')) {
/**
* @since WooCommerce 2.2.0
* @param string $string
* @param string|null $string
* @return string
* @since WooCommerce 2.2.0
*/
function untrailingslashit($string)
function untrailingslashit(?string $string): string
{
if ($string === null) {
return '';
Expand Down
4 changes: 3 additions & 1 deletion lib/payment-gateway/src/PaymentGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public function __construct(
unset($this->form_fields);
unset($this->enabled);

// phpstan:ignore [wc-stub] process_admin_options is inherited from WC_Payment_Gateway but absent from stubs
// @phpstan-ignore-next-line
add_action(
'woocommerce_update_options_payment_gateways_' . $this->id,
[$this, 'process_admin_options']
Expand Down Expand Up @@ -420,7 +422,7 @@ public function get_field_value($key, $field, $postData = [])
sprintf('Field "%1$s" is invalid: %2$s', $key, $exception->getMessage())
);

return null;
return '';
}
}

Expand Down
Loading
Loading