Fix InvalidArgument in shipping options DTO#2243
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe import of the exception class in Changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/table-rate-shipping/src/DataTransferObjects/ShippingOptionLookup.php(1 hunks)
🧰 Additional context used
🪛 GitHub Check: PHP 8.4 - L^12.0 ↑
packages/table-rate-shipping/src/DataTransferObjects/ShippingOptionLookup.php
[failure] 21-21:
Class Doctrine\Common\Cache\Psr6\InvalidArgument not found.
🪛 GitHub Check: PHP 8.3 - L^12.0 ↑
packages/table-rate-shipping/src/DataTransferObjects/ShippingOptionLookup.php
[failure] 21-21:
Class Doctrine\Common\Cache\Psr6\InvalidArgument not found.
🪛 GitHub Check: PHP 8.3 - L^11.0 ↑
packages/table-rate-shipping/src/DataTransferObjects/ShippingOptionLookup.php
[failure] 21-21:
Class Doctrine\Common\Cache\Psr6\InvalidArgument not found.
🪛 GitHub Check: PHP 8.4 - L^11.0 ↑
packages/table-rate-shipping/src/DataTransferObjects/ShippingOptionLookup.php
[failure] 21-21:
Class Doctrine\Common\Cache\Psr6\InvalidArgument not found.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: admin - PHP 8.4 - L12.* ↑
- GitHub Check: shipping - PHP 8.4 - L12.* ↑
- GitHub Check: shipping - PHP 8.4 - L11.* ↑ E
- GitHub Check: core - PHP 8.4 - L12.* ↑ E
- GitHub Check: core - PHP 8.4 - L12.* ↑
- GitHub Check: admin - PHP 8.4 - L12.* ↑ E
- GitHub Check: admin - PHP 8.4 - L11.* ↑ E
- GitHub Check: search - PHP 8.3 - L11.* ↑ E
- GitHub Check: shipping - PHP 8.3 - L12.* ↑
- GitHub Check: core - PHP 8.4 - L11.* ↑
- GitHub Check: admin - PHP 8.3 - L12.* ↑ E
- GitHub Check: admin - PHP 8.3 - L12.* ↑
- GitHub Check: core - PHP 8.3 - L11.* ↑
- GitHub Check: core - PHP 8.3 - L12.* ↑
- GitHub Check: admin - PHP 8.3 - L11.* ↑
- GitHub Check: core - PHP 8.3 - L12.* ↑ E
- GitHub Check: admin - PHP 8.3 - L11.* ↑ E
- GitHub Check: core - PHP 8.3 - L11.* ↑ E
- GitHub Check: fix-code-style
🔇 Additional comments (2)
packages/table-rate-shipping/src/DataTransferObjects/ShippingOptionLookup.php (2)
5-5: Verify the import statementThe import
use Doctrine\Common\Cache\Psr6\InvalidArgument;appears to be incorrect based on the static analysis failures. This namespace suggests a PSR-6 cache-specific exception rather than a general invalid argument exception.Consider replacing with:
-use Doctrine\Common\Cache\Psr6\InvalidArgument; +use InvalidArgumentException;And then update line 21 to:
-InvalidArgument::class +InvalidArgumentException::class
17-22: Approve the throw_if usage patternThe change from
new InvalidArgumenttoInvalidArgument::classis syntactically correct for Laravel'sthrow_ifhelper function. This pattern allows Laravel to instantiate the exception with a default message when the condition is met.
Not sure why we were using
Doctrine\Common\Cache\Psr6\InvalidArgument;, I don't believe it's an exception that's supposed to be used externally to the package. It also no longer exists in the latest version.Summary by CodeRabbit