Merge pull request #1106 from woocommerce/PCP-994-oxxo-type-error-after-2-0-update

Do not check type in filter callback signature (994)
This commit is contained in:
Emili Castells 2023-01-23 11:03:56 +01:00 committed by GitHub
commit d7130a9fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,15 @@ class OXXO {
add_filter(
'woocommerce_available_payment_gateways',
function ( array $methods ): array {
/**
* Param types removed to avoid third-party issues.
*
* @psalm-suppress MissingClosureParamType
*/
function ( $methods ) {
if ( ! is_array( $methods ) ) {
return $methods;
}
if ( ! $this->checkout_allowed_for_oxxo() ) {
unset( $methods[ OXXOGateway::ID ] );