From 8d6b9c7fdf98b70832721a92052e4f89bd9120da Mon Sep 17 00:00:00 2001
From: Ievgen Shakhsuvarov <ishakhsuvarov@ebay.com>
Date: Fri, 23 Jan 2015 16:07:18 +0200
Subject: [PATCH] MAGETWO-32775: Prepare pull request for Checkout related
 modules MSC - stitic tests fix

---
 .../CheckoutAgreements/Api/Data/AgreementInterface.php   | 2 ++
 app/code/Magento/Directory/Model/Currency.php            | 1 +
 app/code/Magento/Payment/Model/Method/AbstractMethod.php | 1 +
 app/code/Magento/Payment/Model/Method/Cc.php             | 4 ++++
 app/code/Magento/Payment/Model/Method/Free.php           | 1 +
 .../Magento/Quote/Api/Data/ShippingMethodInterface.php   | 1 +
 .../Quote/Api/PaymentMethodManagementInterface.php       | 3 ++-
 .../Quote/Api/ShippingMethodManagementInterface.php      | 3 ++-
 app/code/Magento/Quote/Model/QuoteManagement.php         | 3 +++
 app/code/Magento/Tax/Model/Quote/ToOrderConverter.php    | 2 ++
 .../Magento/GiftMessage/Api/CartRepositoryTest.php       | 2 +-
 .../testsuite/Magento/Quote/Api/CouponManagementTest.php | 2 +-
 .../Magento/GiftMessage/Model/CartRepositoryTest.php     | 9 ++++++---
 .../Magento/GiftMessage/Model/ItemRepositoryTest.php     | 9 ++++++---
 .../Magento/Quote/Model/QuoteManagementTest.php          | 9 +++++++--
 15 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php b/app/code/Magento/CheckoutAgreements/Api/Data/AgreementInterface.php
index 71088e34dcb..86daddcff06 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 7b8365e5582..3b5ec26325a 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 69e2ccddf9a..ca6dd62a7c5 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 cc4de6cbacc..ab4058f3789 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 07776869cac..b7a7e00f601 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 de59f648042..62dafce5a1d 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 3f6db9a7e12..47fa55271c3 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 d6d11dca4d3..9e7577a8f69 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 af2aaca9ebf..7ff80972905 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 3bd9d085df8..18fa11ad4c9 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 6cb6f6d9b3a..b34a8ab1ff9 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 d9e2f002dbb..07d86c26ddd 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 9fd0ea04554..c2712492bba 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 9bf0ac91e24..18fb89322ce 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 d2d0708632c..56e96636e95 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'
-- 
GitLab