$ 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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | commerce_paypal-3084846-3.patch | 17.98 KB | jsacksick |
Comments
Comment #2
vuilUpdate the summary to be more readability.
Comment #3
jsacksick commentedI fixed most of the errors mentioned in the report, there's one
\Drupalcall 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.
Comment #5
jsacksick commentedAfter the patch, the only error remaining is the following:
Committed the patch from #3, thanks for the report.