Skip to content

Commit

Permalink
MAGETWO-39814: [GITHUB] Improve \Magento\Framework\Api\SortOrder #1422
Browse files Browse the repository at this point in the history
 - Fixed code style and static tests
  • Loading branch information
Andrey Konosov committed Jul 28, 2015
1 parent 886df1a commit 44188aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/code/Magento/Quote/Model/QuoteRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
use Magento\Framework\Exception\InputException;
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;

/**
* Class QuoteRepository
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class QuoteRepository implements \Magento\Quote\Api\CartRepositoryInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Magento\Framework\Api\SortOrder;
use \Magento\Tax\Model\TaxRuleRepository;


class TaxRuleRepositoryTest extends \PHPUnit_Framework_TestCase
{
/**
Expand Down
9 changes: 8 additions & 1 deletion lib/internal/Magento/Framework/Api/SortOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ class SortOrder extends AbstractSimpleObject
const SORT_ASC = 'ASC';
const SORT_DESC = 'DESC';

/**
* Initialize object and validate sort direction
*
* @param array $data
*/
public function __construct(array $data = [])
{
parent::__construct($data);
Expand Down Expand Up @@ -75,7 +80,7 @@ public function setDirection($direction)
* Validate direction argument ASC or DESC
*
* @param mixed $direction
* @return string
* @return null
* @throws InputException
*/
private function validateDirection($direction)
Expand All @@ -87,6 +92,7 @@ private function validateDirection($direction)
/**
* @param string $direction
* @throws InputException
* @return null
*/
private function validateDirectionIsString($direction)
{
Expand All @@ -101,6 +107,7 @@ private function validateDirectionIsString($direction)
/**
* @param string $direction
* @throws InputException
* @return null
*/
private function validateDirectionIsAscOrDesc($direction)
{
Expand Down

0 comments on commit 44188aa

Please sign in to comment.