Skip to content

Commit

Permalink
Merge pull request #218 from pamil/coding-standard
Browse files Browse the repository at this point in the history
Coding standard
  • Loading branch information
lchrusciel authored Sep 28, 2017
2 parents 64ac2c5 + f89641f commit b82a5ac
Show file tree
Hide file tree
Showing 308 changed files with 614 additions and 306 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"matthiasnoback/symfony-config-test": "^2.0",
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
"phpunit/phpunit": "^5.6",
"doctrine/common": "<2.8"
"doctrine/common": "<2.8",
"symplify/easy-coding-standard": "^2.4",
"sylius-labs/coding-standard": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions easy-coding-standard.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
includes:
- vendor/sylius-labs/coding-standard/easy-coding-standard.neon
6 changes: 3 additions & 3 deletions spec/Checker/PromotionCouponEligibilityCheckerSpec.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Checker;

use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\PromotionCouponInterface;
use Sylius\Component\Core\Model\PromotionInterface;
use Sylius\Component\Promotion\Checker\Eligibility\PromotionCouponEligibilityCheckerInterface;
use Sylius\Component\Promotion\Checker\Eligibility\PromotionEligibilityCheckerInterface;
use Sylius\ShopApiPlugin\Checker\PromotionCouponEligibilityChecker;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

final class PromotionCouponEligibilityCheckerSpec extends ObjectBehavior
{
Expand Down
4 changes: 2 additions & 2 deletions spec/Command/AddCouponSpec.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use Sylius\ShopApiPlugin\Command\AddCoupon;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

final class AddCouponSpec extends ObjectBehavior
{
Expand Down
3 changes: 1 addition & 2 deletions spec/Command/AddProductReviewByCodeSpec.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

final class AddProductReviewByCodeSpec extends ObjectBehavior
{
Expand Down
3 changes: 1 addition & 2 deletions spec/Command/AddProductReviewBySlugSpec.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

final class AddProductReviewBySlugSpec extends ObjectBehavior
{
Expand Down
5 changes: 2 additions & 3 deletions spec/Command/AddressOrderSpec.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use Sylius\ShopApiPlugin\Command\AddressCart;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\ShopApiPlugin\Command\AddressOrder;
use Sylius\ShopApiPlugin\Model\Address;

final class AddressOrderSpec extends ObjectBehavior
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/ChangeItemQuantitySpec.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use Sylius\ShopApiPlugin\Command\ChangeItemQuantity;
use PhpSpec\ObjectBehavior;

final class ChangeItemQuantitySpec extends ObjectBehavior
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/ChoosePaymentMethodSpec.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use Sylius\ShopApiPlugin\Command\ChoosePaymentMethod;
use PhpSpec\ObjectBehavior;

final class ChoosePaymentMethodSpec extends ObjectBehavior
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/ChooseShippingMethodSpec.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use Sylius\ShopApiPlugin\Command\ChooseShippingMethod;
use PhpSpec\ObjectBehavior;

final class ChooseShippingMethodSpec extends ObjectBehavior
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/CompleteOrderSpec.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use PhpSpec\ObjectBehavior;
use Sylius\ShopApiPlugin\Command\CompleteOrder;

final class CompleteOrderSpec extends ObjectBehavior
{
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/DropCartSpec.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use PhpSpec\ObjectBehavior;
use Sylius\ShopApiPlugin\Command\DropCart;

final class DropCartSpec extends ObjectBehavior
{
Expand Down
2 changes: 1 addition & 1 deletion spec/Command/GenerateResetPasswordTokenSpec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

Expand Down
2 changes: 1 addition & 1 deletion spec/Command/GenerateVerificationTokenSpec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

Expand Down
3 changes: 2 additions & 1 deletion spec/Command/PickupCartSpec.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use Sylius\ShopApiPlugin\Command\PickupCart;
use PhpSpec\ObjectBehavior;

final class PickupCartSpec extends ObjectBehavior
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/PutOptionBasedConfigurableItemToCartSpec.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use PhpSpec\ObjectBehavior;
use Sylius\ShopApiPlugin\Command\PutOptionBasedConfigurableItemToCart;

final class PutOptionBasedConfigurableItemToCartSpec extends ObjectBehavior
{
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/PutSimpleItemToCartSpec.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use Sylius\ShopApiPlugin\Command\PutSimpleItemToCart;
use PhpSpec\ObjectBehavior;

final class PutSimpleItemToCartSpec extends ObjectBehavior
Expand Down
3 changes: 2 additions & 1 deletion spec/Command/PutVariantBasedConfigurableItemToCartSpec.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

use PhpSpec\ObjectBehavior;
use Sylius\ShopApiPlugin\Command\PutVariantBasedConfigurableItemToCart;

final class PutVariantBasedConfigurableItemToCartSpec extends ObjectBehavior
{
Expand Down
2 changes: 1 addition & 1 deletion spec/Command/SendResetPasswordTokenSpec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

Expand Down
2 changes: 1 addition & 1 deletion spec/Command/SendVerificationTokenSpec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

Expand Down
2 changes: 1 addition & 1 deletion spec/Command/VerifyAccountSpec.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Command;

Expand Down
3 changes: 1 addition & 2 deletions spec/EventListener/RequestLocaleSetterSpec.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\EventListener;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\Component\Locale\Provider\LocaleProviderInterface;
use Sylius\ShopApiPlugin\EventListener\RequestLocaleSetter;
use Symfony\Component\HttpFoundation\Request;
Expand Down
6 changes: 2 additions & 4 deletions spec/EventListener/UserRegistrationListenerSpec.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\EventListener;

use Doctrine\Common\Persistence\ObjectManager;
use League\Tactician\CommandBus;
use PhpSpec\ObjectBehavior;
use Sylius\Component\Channel\Repository\ChannelRepositoryInterface;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\ShopUserInterface;
use Sylius\Component\User\Repository\UserRepositoryInterface;
use Sylius\ShopApiPlugin\Command\GenerateVerificationToken;
use Sylius\ShopApiPlugin\Command\SendVerificationToken;
use Sylius\ShopApiPlugin\Event\CustomerRegistered;
use PhpSpec\ObjectBehavior;
use Symfony\Component\EventDispatcher\GenericEvent;

final class UserRegistrationListenerSpec extends ObjectBehavior
{
Expand Down
5 changes: 3 additions & 2 deletions spec/Factory/AddressViewFactorySpec.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Factory;

use Sylius\Component\Core\Model\AddressInterface;
use Sylius\ShopApiPlugin\Factory\AddressViewFactory;
use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Model\AddressInterface;
use Sylius\ShopApiPlugin\Factory\AddressViewFactoryInterface;
use Sylius\ShopApiPlugin\View\AddressView;

Expand Down
2 changes: 2 additions & 0 deletions spec/Factory/AdjustmentViewFactorySpec.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Factory;

use PhpSpec\ObjectBehavior;
Expand Down
8 changes: 4 additions & 4 deletions spec/Factory/CartItemViewFactorySpec.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Factory;

use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\ShopApiPlugin\Factory\CartItemViewFactory;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\ShopApiPlugin\Factory\CartItemViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\ProductVariantViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\ProductViewFactoryInterface;
Expand Down Expand Up @@ -44,7 +44,7 @@ function it_builds_cart_item_view(
$cartItem->getProduct()->willReturn($tshirt);
$cartItem->getVariant()->willReturn($tshirtVariant);

$productViewFactory->create($tshirt, $channel,'en_GB')->willReturn(new ProductView());
$productViewFactory->create($tshirt, $channel, 'en_GB')->willReturn(new ProductView());

$productVariantViewFactory->create($tshirtVariant, $channel, 'en_GB')->willReturn(new ProductVariantView());

Expand Down
6 changes: 4 additions & 2 deletions spec/Factory/CartViewFactorySpec.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Factory;

use Doctrine\Common\Collections\ArrayCollection;
use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Model\AddressInterface;
use Sylius\Component\Core\Model\AdjustmentInterface;
use Sylius\Component\Core\Model\ChannelInterface;
Expand All @@ -13,15 +16,14 @@
use Sylius\ShopApiPlugin\Factory\AddressViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\AdjustmentViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\CartItemViewFactoryInterface;
use PhpSpec\ObjectBehavior;
use Sylius\ShopApiPlugin\Factory\CartViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\PaymentViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\ShipmentViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\TotalViewFactoryInterface;
use Sylius\ShopApiPlugin\View\AddressView;
use Sylius\ShopApiPlugin\View\AdjustmentView;
use Sylius\ShopApiPlugin\View\CartSummaryView;
use Sylius\ShopApiPlugin\View\ItemView;
use Sylius\ShopApiPlugin\Factory\ShipmentViewFactoryInterface;
use Sylius\ShopApiPlugin\View\PaymentView;
use Sylius\ShopApiPlugin\View\ShipmentView;
use Sylius\ShopApiPlugin\View\TotalsView;
Expand Down
13 changes: 3 additions & 10 deletions spec/Factory/DetailedProductViewFactorySpec.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Factory;

use PhpSpec\ObjectBehavior;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\ProductImageInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\Component\Product\Model\ProductAssociationInterface;
use Sylius\Component\Product\Model\ProductAssociationTypeInterface;
use Sylius\ShopApiPlugin\Factory\DetailedProductViewFactory;
use Sylius\ShopApiPlugin\Factory\ImageViewFactoryInterface;
use Sylius\ShopApiPlugin\Factory\ProductVariantViewFactoryInterface;
use PhpSpec\ObjectBehavior;
use Sylius\ShopApiPlugin\Factory\ProductViewFactoryInterface;
use Sylius\ShopApiPlugin\Generator\ProductBreadcrumbGeneratorInterface;
use Sylius\ShopApiPlugin\View\ImageView;
use Sylius\ShopApiPlugin\View\ProductVariantView;
use Sylius\ShopApiPlugin\View\ProductView;

final class DetailedProductViewFactorySpec extends ObjectBehavior
Expand Down
7 changes: 3 additions & 4 deletions spec/Factory/ImageViewFactorySpec.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php

declare(strict_types=1);

namespace spec\Sylius\ShopApiPlugin\Factory;

use Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Sylius\Component\Core\Model\ImageInterface;
use Sylius\ShopApiPlugin\Factory\ImageViewFactory;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\Component\Core\Model\ImageInterface;
use Sylius\ShopApiPlugin\Factory\ImageViewFactoryInterface;
use Sylius\ShopApiPlugin\View\ImageView;

Expand Down
Loading

0 comments on commit b82a5ac

Please sign in to comment.