$ drupal-check -ad web/modules/commerce_paypal

 32/32 [============================] 100%

 ------ -----------------------------------------
  Line   commerce_paypal.post_update.php
 ------ -----------------------------------------
  32     Variable $message might not be defined.
  38     Variable $message might not be defined.
 ------ -----------------------------------------

 ------ -----------------------------------------
  Line   src\CheckoutSdk.php
 ------ -----------------------------------------
  299    \Drupal calls should be avoided in classes, use dependency injection instead
 ------ -----------------------------------------

 ------ -----------------------------------------
  Line   src\CheckoutSdkFactory.php
 ------ -----------------------------------------
         Class Sainsburys\Guzzle\Oauth2\GrantType\ClientCredentials not found and could not be autoloaded.
 ------ -----------------------------------------

 ------ -----------------------------------------
  Line   src\ClientCredentials.php
 ------ -----------------------------------------
         Class Sainsburys\Guzzle\Oauth2\GrantType\ClientCredentials not found and could not be autoloaded.
 ------ -----------------------------------------

 ------ -----------------------------------------
  Line   src\PluginForm\Checkout\PaymentOffsiteForm.php
 ------ -----------------------------------------
  20     \Drupal calls should be avoided in classes, use dependency injection instead
 ------ -----------------------------------------

 ------ -----------------------------------------
  Line   src\Plugin\Commerce\CheckoutPane\CheckoutPaymentProcess.php
 ------ -----------------------------------------
  66     \Drupal calls should be avoided in classes, use dependency injection instead
 ------ -----------------------------------------

 ------ -----------------------------------------
  Line   src\Plugin\Commerce\PaymentGateway\Checkout.php
 ------ -----------------------------------------
  363    \Drupal calls should be avoided in classes, use dependency injection instead
  743    \Drupal calls should be avoided in classes, use dependency injection instead
 ------ -----------------------------------------

 [ERROR] Found 9 errors
CommentFileSizeAuthor
#3 commerce_paypal-3084846-3.patch17.98 KBjsacksick

Comments

ilchovuchkov created an issue. See original summary.

vuil’s picture

Issue summary: View changes

Update the summary to be more readability.

jsacksick’s picture

Title: Test for Drupal 9 deprecations » Fix Drupal 9 deprecations
Category: Plan » Task
Status: Active » Needs review
StatusFileSize
new17.98 KB

I fixed most of the errors mentioned in the report, there's one \Drupal call we can't really avoid (the call to \Drupal::service('commerce_shipping.packer_manager')) because that would mean introducing a dependency to commerce_shipping which is something we don't want to enforce for sure.

The "Class Sainsburys\Guzzle\Oauth2\GrantType\ClientCredentials not found and could not be autoloaded." errors are not valid since this is caused by the missing Guzzle Oauth2 plugin library.

  • jsacksick committed 247063f on 8.x-1.x
    Issue #3084846 by jsacksick, ilchovuchkov: Fix several Drupal 9...
jsacksick’s picture

Status: Needs review » Fixed

After the patch, the only error remaining is the following:

 ------ ------------------------------------------------------------------------------
  Line   src/Plugin/Commerce/PaymentGateway/Checkout.php
 ------ ------------------------------------------------------------------------------
  755    \Drupal calls should be avoided in classes, use dependency injection instead
 ------ ------------------------------------------------------------------------------

Committed the patch from #3, thanks for the report.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.