diff --git a/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php b/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php index 71088e34dcb3d84c78a7d839c512b65d1fe161a6..86daddcff06e5a6c50a66f6498b58347e9a1797f 100644 --- a/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php +++ b/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php @@ -46,6 +46,7 @@ interface AgreementInterface * Returns the agreement status. * * @return bool Agreement status. + * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ public function getIsActive(); @@ -54,6 +55,7 @@ interface AgreementInterface * * @return bool * true - HTML. * * false - plain text. + * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ public function getIsHtml(); } diff --git a/app/code/Magento/Directory/Model/Currency.php b/app/code/Magento/Directory/Model/Currency.php index 7b8365e55828b7bc1382c1971dc01182fdfe802e..3b5ec26325abc5716c3c2137e5c4e75549eaf4d0 100644 --- a/app/code/Magento/Directory/Model/Currency.php +++ b/app/code/Magento/Directory/Model/Currency.php @@ -158,6 +158,7 @@ class Currency extends \Magento\Framework\Model\AbstractModel * @param string $id * @param string $field * @return $this + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function load($id, $field = null) { diff --git a/app/code/Magento/Payment/Model/Method/AbstractMethod.php b/app/code/Magento/Payment/Model/Method/AbstractMethod.php index 69e2ccddf9ad9dc4768a0e28c4a40a4d4016af8b..ca6dd62a7c5856d84d6706e77910e093cbdc7046 100644 --- a/app/code/Magento/Payment/Model/Method/AbstractMethod.php +++ b/app/code/Magento/Payment/Model/Method/AbstractMethod.php @@ -19,6 +19,7 @@ use Magento\Quote\Api\Data\PaymentMethodInterface; * @method AbstractMethod setStore() * @SuppressWarnings(PHPMD.ExcessivePublicCount) * @SuppressWarnings(PHPMD.TooManyFields) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements MethodInterface, diff --git a/app/code/Magento/Payment/Model/Method/Cc.php b/app/code/Magento/Payment/Model/Method/Cc.php index cc4de6cbacc90b4647273d9c358bbcfe99f5947d..ab4058f3789c723d03664657ade6e5cf126956af 100644 --- a/app/code/Magento/Payment/Model/Method/Cc.php +++ b/app/code/Magento/Payment/Model/Method/Cc.php @@ -5,6 +5,9 @@ */ namespace Magento\Payment\Model\Method; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Cc extends \Magento\Payment\Model\Method\AbstractMethod { /** @@ -52,6 +55,7 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Framework\Model\Context $context, diff --git a/app/code/Magento/Payment/Model/Method/Free.php b/app/code/Magento/Payment/Model/Method/Free.php index 07776869cac32f16f8a121c92266bc0c7662e1ea..b7a7e00f601dbe9cf3e4124757070b6eb11de0fd 100644 --- a/app/code/Magento/Payment/Model/Method/Free.php +++ b/app/code/Magento/Payment/Model/Method/Free.php @@ -51,6 +51,7 @@ class Free extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Framework\Model\Context $context, diff --git a/app/code/Magento/Quote/Api/Data/ShippingMethodInterface.php b/app/code/Magento/Quote/Api/Data/ShippingMethodInterface.php index de59f64804233de805613c794590d09864da4e0b..62dafce5a1dce5b5541d9c851fb3ea3c85b20e8e 100644 --- a/app/code/Magento/Quote/Api/Data/ShippingMethodInterface.php +++ b/app/code/Magento/Quote/Api/Data/ShippingMethodInterface.php @@ -88,6 +88,7 @@ interface ShippingMethodInterface extends \Magento\Framework\Api\ExtensibleDataI * Returns the value of the availability flag for the current shipping method. * * @return bool + * @SuppressWarnings(PHPMD.BooleanGetMethodName) */ public function getAvailable(); } diff --git a/app/code/Magento/Quote/Api/PaymentMethodManagementInterface.php b/app/code/Magento/Quote/Api/PaymentMethodManagementInterface.php index 3f6db9a7e120b6d1d3350e2f63fec297cd39bf62..47fa55271c3c86742b444c7ba8d684516c7fd460 100644 --- a/app/code/Magento/Quote/Api/PaymentMethodManagementInterface.php +++ b/app/code/Magento/Quote/Api/PaymentMethodManagementInterface.php @@ -13,8 +13,9 @@ interface PaymentMethodManagementInterface * @param int $cartId The cart ID. * @param \Magento\Quote\Api\Data\PaymentInterface $method The payment method. * @return int Payment method ID. - * @throws \Magento\Framework\Exception\State\InvalidTransitionException The billing or shipping address is not set, or the specified payment method is not available. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist. + * @throws \Magento\Framework\Exception\State\InvalidTransitionException The billing or shipping address + * is not set, or the specified payment method is not available. */ public function set($cartId, \Magento\Quote\Api\Data\PaymentInterface $method); diff --git a/app/code/Magento/Quote/Api/ShippingMethodManagementInterface.php b/app/code/Magento/Quote/Api/ShippingMethodManagementInterface.php index d6d11dca4d38c764a2225948e05564790d8801e0..9e7577a8f69614c328b50239b5fa9ef84032d571 100644 --- a/app/code/Magento/Quote/Api/ShippingMethodManagementInterface.php +++ b/app/code/Magento/Quote/Api/ShippingMethodManagementInterface.php @@ -16,8 +16,9 @@ interface ShippingMethodManagementInterface * @return bool * @throws \Magento\Framework\Exception\InputException The shipping method is not valid for an empty cart. * @throws \Magento\Framework\Exception\CouldNotSaveException The shipping method could not be saved. - * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart contains only virtual products so the shipping method does not apply. * @throws \Magento\Framework\Exception\StateException The billing or shipping address is not set. + * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart contains only virtual products + * so the shipping method does not apply. */ public function set($cartId, $carrierCode, $methodCode); diff --git a/app/code/Magento/Quote/Model/QuoteManagement.php b/app/code/Magento/Quote/Model/QuoteManagement.php index af2aaca9ebfbaf0c2acba837404d97d73d8843d4..7ff8097290597cf1d68362f18427680d498b0ef8 100644 --- a/app/code/Magento/Quote/Model/QuoteManagement.php +++ b/app/code/Magento/Quote/Model/QuoteManagement.php @@ -20,6 +20,8 @@ use Magento\Framework\Exception\StateException; /** * Class QuoteManagement + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class QuoteManagement implements \Magento\Quote\Api\CartManagementInterface { @@ -102,6 +104,7 @@ class QuoteManagement implements \Magento\Quote\Api\CartManagementInterface * @param QuoteRepository $quoteRepository * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository * @param \Magento\Customer\Model\CustomerFactory $customerModelFactory + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( EventManager $eventManager, diff --git a/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php b/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php index 3bd9d085df8a3bf687e828f3c0d6a8cfb86eda32..18fa11ad4c952efca48bdee43123e2e7a6588d36 100644 --- a/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php +++ b/app/code/Magento/Tax/Model/Quote/ToOrderConverter.php @@ -21,6 +21,7 @@ class ToOrderConverter * @param QuoteAddress $address * @param array $additional * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeConvert(QuoteAddressToOrder $subject, QuoteAddress $address, $additional = []) { @@ -32,6 +33,7 @@ class ToOrderConverter * @param QuoteAddressToOrder $subject * @param OrderInterface $order * @return OrderInterface + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterConvert(QuoteAddressToOrder $subject, OrderInterface $order) { diff --git a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php index 6cb6f6d9b3aef41db60fb3d0453d62d2b7912595..b34a8ab1ff966768b881821568227a3fbc196895 100644 --- a/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GiftMessage/Api/CartRepositoryTest.php @@ -68,7 +68,7 @@ class CartRepositoryTest extends WebapiAbstract { // sales/gift_options/allow_order must be set to 1 in system configuration // @todo remove next statement when \Magento\TestFramework\TestCase\WebapiAbstract::_updateAppConfig is fixed - $this->markTestIncomplete('This test relies on system configuration state.'); + $this->markTestIncomplete('This test relies on system configuration state.'); /** @var \Magento\Quote\Model\Quote $quote */ $quote = $this->objectManager->create('Magento\Quote\Model\Quote'); $quote->load('test_order_item_with_message', 'reserved_order_id'); diff --git a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php index d9e2f002dbb19dac3459cc5efe4be443b924a3e8..07d86c26ddd64da9594d2b0996aa4bc0dda45af7 100644 --- a/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Quote/Api/CouponManagementTest.php @@ -149,4 +149,4 @@ class CouponManagementTest extends WebapiAbstract $this->assertEquals($quoteWithCoupon->getCouponCode(), $couponCode); } -} \ No newline at end of file +} diff --git a/dev/tests/unit/testsuite/Magento/GiftMessage/Model/CartRepositoryTest.php b/dev/tests/unit/testsuite/Magento/GiftMessage/Model/CartRepositoryTest.php index 9fd0ea04554d8727848b2aabbb2f3cb234f0b57e..c2712492bba77c1d6250553f368de9b7c4d43a3d 100644 --- a/dev/tests/unit/testsuite/Magento/GiftMessage/Model/CartRepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/GiftMessage/Model/CartRepositoryTest.php @@ -75,7 +75,8 @@ class CartRepositoryTest extends \PHPUnit_Framework_TestCase ], [], '', - false); + false + ); $this->messageMock = $this->getMock('Magento\GiftMessage\Model\Message', [], [], '', false); $this->quoteItemMock = $this->getMock( '\Magento\Quote\Model\Quote\Item', @@ -85,7 +86,8 @@ class CartRepositoryTest extends \PHPUnit_Framework_TestCase ], [], '', - false); + false + ); $this->quoteMock = $this->getMock( '\Magento\Quote\Model\Quote', [ @@ -97,7 +99,8 @@ class CartRepositoryTest extends \PHPUnit_Framework_TestCase ], [], '', - false); + false + ); $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $this->giftMessageManagerMock = $this->getMock('Magento\GiftMessage\Model\GiftMessageManager', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/GiftMessage/Model/ItemRepositoryTest.php b/dev/tests/unit/testsuite/Magento/GiftMessage/Model/ItemRepositoryTest.php index 9bf0ac91e241fafbde90abdb677f586df388b04e..18fb89322ce346894f8746baa0650c205634bb02 100644 --- a/dev/tests/unit/testsuite/Magento/GiftMessage/Model/ItemRepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/GiftMessage/Model/ItemRepositoryTest.php @@ -76,7 +76,8 @@ class ItemRepositoryTest extends \PHPUnit_Framework_TestCase ], [], '', - false); + false + ); $this->messageMock = $this->getMock('Magento\GiftMessage\Model\Message', [], [], '', false); $this->quoteItemMock = $this->getMock( '\Magento\Qote\Model\Quote\Item', @@ -86,7 +87,8 @@ class ItemRepositoryTest extends \PHPUnit_Framework_TestCase ], [], '', - false); + false + ); $this->quoteMock = $this->getMock( '\Magento\Quote\Model\Quote', [ @@ -96,7 +98,8 @@ class ItemRepositoryTest extends \PHPUnit_Framework_TestCase ], [], '', - false); + false + ); $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $this->giftMessageManagerMock = $this->getMock('Magento\GiftMessage\Model\GiftMessageManager', [], [], '', false); diff --git a/dev/tests/unit/testsuite/Magento/Quote/Model/QuoteManagementTest.php b/dev/tests/unit/testsuite/Magento/Quote/Model/QuoteManagementTest.php index d2d0708632ca9669bacf9d438160cb95193abcc0..56e96636e95f65499191460d28001c78aeb07b73 100644 --- a/dev/tests/unit/testsuite/Magento/Quote/Model/QuoteManagementTest.php +++ b/dev/tests/unit/testsuite/Magento/Quote/Model/QuoteManagementTest.php @@ -8,6 +8,9 @@ namespace Magento\Quote\Model; use \Magento\Framework\Exception\NoSuchEntityException; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class QuoteManagementTest extends \PHPUnit_Framework_TestCase { /** @@ -520,7 +523,8 @@ class QuoteManagementTest extends \PHPUnit_Framework_TestCase ->willReturn($baseOrder); $this->quoteAddressToOrderAddress->expects($this->at(0)) ->method('convert') - ->with($shippingAddress, + ->with( + $shippingAddress, [ 'address_type' => 'shipping', 'email' => 'customer@example.com' @@ -529,7 +533,8 @@ class QuoteManagementTest extends \PHPUnit_Framework_TestCase ->willReturn($convertedShippingAddress); $this->quoteAddressToOrderAddress->expects($this->at(1)) ->method('convert') - ->with($billingAddress, + ->with( + $billingAddress, [ 'address_type' => 'billing', 'email' => 'customer@example.com'