Skip to content

Commit 4758783

Browse files
committed
CS fixer
1 parent 3c681c4 commit 4758783

File tree

53 files changed

+62
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+62
-83
lines changed

.php_cs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Paweł Jędrzejewski
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
use Symfony\CS\FixerInterface;
13+
14+
$finder = Symfony\CS\Finder\DefaultFinder::create()
15+
->notName('*.yml')
16+
->notName('*.xml')
17+
->notName('*Spec.php')
18+
->exclude('app')
19+
;
20+
21+
return Symfony\CS\Config\Config::create()->finder($finder);

.phpspec_cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Paweł Jędrzejewski
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
$finder = Symfony\Component\Finder\Finder::create()
13+
->files()
14+
->name('*Spec.php')
15+
->in(__DIR__.'/src')
16+
;
17+
18+
return Symfony\CS\Config\Config::create()->finder($finder);

bin/sylius-cs-fixer

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
php-cs-fixer fix .
4+
php-cs-fixer fix . --config-file .phpspec_cs --fixers=-visibility

src/Sylius/Bundle/AddressingBundle/spec/Sylius/Bundle/AddressingBundle/Form/Type/CountryEntityChoiceTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\AddressingBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1716

1817
/**

src/Sylius/Bundle/AddressingBundle/spec/Sylius/Bundle/AddressingBundle/Form/Type/ProvinceChoiceTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\AddressingBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
1716

1817
/**

src/Sylius/Bundle/AddressingBundle/spec/Sylius/Bundle/AddressingBundle/Form/Type/ZoneEntityChoiceTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\AddressingBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1716

1817
/**

src/Sylius/Bundle/AddressingBundle/spec/Sylius/Bundle/AddressingBundle/Form/Type/ZoneMemberCollectionTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\AddressingBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1716

1817
/**

src/Sylius/Bundle/CartBundle/spec/Sylius/Bundle/CartBundle/Storage/SessionCartStorageSpec.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ function it_returns_cart_identifier_via_session($session)
4545

4646
function it_sets_cart_identifier_via_session($session, CartInterface $cart)
4747
{
48-
$cart->getIdentifier()->will(function() {
48+
$cart->getIdentifier()->will(function () {
4949
return 3;
5050
});
51-
$session->set(SessionCartStorage::KEY, 3)->will(function() use ($session) {
51+
$session->set(SessionCartStorage::KEY, 3)->will(function () use ($session) {
5252
$session->get(SessionCartStorage::KEY)->willReturn(3);
5353
});
5454

src/Sylius/Bundle/CoreBundle/Cart/ItemResolver.php

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
use Sylius\Component\Cart\Provider\CartProviderInterface;
1717
use Sylius\Component\Cart\Resolver\ItemResolverInterface;
1818
use Sylius\Component\Cart\Resolver\ItemResolvingException;
19-
use Sylius\Component\Core\Model\OrderItemInterface;
20-
use Sylius\Component\Core\Model\ProductInterface;
2119
use Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface;
2220
use Sylius\Component\Pricing\Calculator\DelegatingCalculatorInterface;
2321
use Sylius\Component\Resource\Repository\RepositoryInterface;

src/Sylius/Bundle/CoreBundle/DataCollector/SyliusDataCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ public function getName()
4141
{
4242
return 'sylius';
4343
}
44-
}
44+
}

src/Sylius/Bundle/CoreBundle/EventListener/ConfirmOrderListener.php

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ConfirmOrderListener
2424
* Set an Order as completed
2525
*
2626
* @param GenericEvent $event
27+
*
2728
* @throws UnexpectedTypeException
2829
*/
2930
public function confirmOrder(GenericEvent $event)

src/Sylius/Bundle/CoreBundle/Form/Type/Pricing/GroupBasedConfigurationType.php

-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ public function getName()
6868
return 'sylius_price_calculator_group_based';
6969
}
7070
}
71-

src/Sylius/Bundle/CoreBundle/spec/Sylius/Bundle/CoreBundle/EventListener/PurchaseListenerSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\CoreBundle\EventListener;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Sylius\Bundle\CoreBundle\Event\PurchaseCompleteEvent;
1716
use Sylius\Component\Cart\Provider\CartProviderInterface;
1817
use Sylius\Component\Payment\Model\PaymentInterface;

src/Sylius/Bundle/CoreBundle/spec/Sylius/Bundle/CoreBundle/Mailer/TwigSwiftMailerSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ function it_prepares_email_properly($mailer, $twigEnvironment, \Twig_Template $t
5252

5353
$this->sendEmail($templateName, $context, $from, $to);
5454
}
55-
}
55+
}

src/Sylius/Bundle/CoreBundle/spec/Sylius/Bundle/CoreBundle/OAuth/UserProviderSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use FOS\UserBundle\Model\UserManagerInterface;
1515
use PhpSpec\ObjectBehavior;
16-
use Prophecy\Argument;
1716

1817
class UserProviderSpec extends ObjectBehavior
1918
{

src/Sylius/Bundle/InventoryBundle/spec/Sylius/Bundle/InventoryBundle/Validator/Constraints/InStockValidatorSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ function it_should_not_add_violation_if_stock_is_sufficient(
7171

7272
$this->validate($inventoryUnit, $constraint);
7373
}
74-
}
74+
}

src/Sylius/Bundle/MoneyBundle/spec/Sylius/Bundle/MoneyBundle/Form/Type/MoneyTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\MoneyBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1716

1817
/**

src/Sylius/Bundle/MoneyBundle/spec/Sylius/Bundle/MoneyBundle/Templating/Helper/MoneyHelperSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace spec\Sylius\Bundle\MoneyBundle\Twig;
12+
namespace spec\Sylius\Bundle\MoneyBundle\Templating\Helper;
1313

1414
use PhpSpec\ObjectBehavior;
1515
use Sylius\Component\Money\Context\CurrencyContextInterface;

src/Sylius/Bundle/PayumBundle/spec/Sylius/Bundle/PayumBundle/Payum/Paypal/Action/NotifyOrderActionSpec.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function it_must_not_dispatch_pre_and_post_payment_state_changed_if_state_not_ch
8989
$order->getPayment()->willReturn($paymentModel);
9090

9191
$paymentModel->getState()->willReturn(Payment::STATE_COMPLETED);
92-
$paymentModel->setState(Argument::type('string'))->will(function($args) use ($paymentModel) {
92+
$paymentModel->setState(Argument::type('string'))->will(function ($args) use ($paymentModel) {
9393
$paymentModel->getState()->willReturn($args[0]);
9494
});
9595

@@ -132,7 +132,7 @@ function it_must_dispatch_pre_and_post_payment_state_changed_if_state_changed(
132132
$order->getPayment()->willReturn($paymentModel);
133133

134134
$paymentModel->getState()->willReturn(Payment::STATE_COMPLETED);
135-
$paymentModel->setState(Argument::type('string'))->will(function($args) use ($paymentModel) {
135+
$paymentModel->setState(Argument::type('string'))->will(function ($args) use ($paymentModel) {
136136
$paymentModel->getState()->willReturn($args[0]);
137137
});
138138

src/Sylius/Bundle/PricingBundle/DependencyInjection/Configuration.php

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Sylius\Bundle\PricingBundle\DependencyInjection;
1313

14-
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
1514
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1615
use Symfony\Component\Config\Definition\ConfigurationInterface;
1716

src/Sylius/Bundle/PricingBundle/Form/EventListener/BuildPriceableFormListener.php

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public function preBind(FormEvent $event)
7171
{
7272
$data = $event->getData();
7373

74-
7574
if (empty($data) || !array_key_exists('pricingCalculator', $data)) {
7675
return;
7776
}

src/Sylius/Bundle/PricingBundle/Form/Extension/PriceableTypeExtension.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Form\FormBuilderInterface;
1818
use Symfony\Component\Form\FormInterface;
1919
use Symfony\Component\Form\FormView;
20-
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
2120

2221
/**
2322
* Priceable form extension.

src/Sylius/Bundle/PricingBundle/Form/Type/CalculatorChoiceType.php

-1
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ public function getName()
6666
return 'sylius_price_calculator_choice';
6767
}
6868
}
69-

src/Sylius/Bundle/PricingBundle/Form/Type/VolumeBasedConfigurationType.php

-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@ public function getName()
5050
return 'sylius_price_calculator_volume_based';
5151
}
5252
}
53-

src/Sylius/Bundle/PricingBundle/Twig/PricingExtension.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Sylius\Bundle\PricingBundle\Twig;
1313

1414
use Sylius\Bundle\PricingBundle\Templating\Helper\PricingHelper;
15-
use Sylius\Component\Pricing\Calculator\DelegatingCalculatorInterface;
1615
use Sylius\Component\Pricing\Model\PriceableInterface;
1716

1817
/**

src/Sylius/Bundle/ProductBundle/spec/Sylius/Bundle/ProductBundle/Form/Type/ProductTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ function it_builds_form_with_proper_fields(FormBuilder $builder)
8080
->willReturn($builder)
8181
;
8282

83-
8483
$this->buildForm($builder, array());
8584
}
8685

src/Sylius/Bundle/PromotionBundle/Form/EventListener/BuildActionFormListener.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Sylius\Bundle\PromotionBundle\Form\EventListener;
1313

1414
use Sylius\Component\Registry\ServiceRegistryInterface;
15-
use Sylius\Component\Promotion\Action\Registry\PromotionActionRegistryInterface;
1615
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1716
use Symfony\Component\Form\FormEvent;
1817
use Symfony\Component\Form\FormEvents;

src/Sylius/Bundle/PromotionBundle/Form/Type/RuleType.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Sylius\Bundle\PromotionBundle\Form\EventListener\BuildRuleFormListener;
1515
use Sylius\Component\Registry\ServiceRegistryInterface;
16-
use Sylius\Component\Promotion\Checker\Registry\RuleCheckerRegistryInterface;
1716
use Symfony\Component\Form\AbstractType;
1817
use Symfony\Component\Form\FormBuilderInterface;
1918
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

src/Sylius/Bundle/ResourceBundle/spec/Sylius/Bundle/ResourceBundle/Doctrine/ORM/EntityRepositorySpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ function it_applies_criteria_when_finding_one($queryBuilder, Expr $expr)
8888
'bar' => 'baz',
8989
);
9090

91-
9291
foreach ($criteria as $property => $value) {
9392
$queryBuilder
9493
->expr()

src/Sylius/Bundle/ResourceBundle/spec/Sylius/Bundle/ResourceBundle/Form/DataTransformer/ObjectSelectionToIdentifierCollectionTransformerSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Doctrine\Common\Collections\Collection;
1515
use PhpSpec\ObjectBehavior;
16-
use Prophecy\Argument;
1716

1817
// Since the root namespace "spec" is not in our autoload
1918
require_once __DIR__.DIRECTORY_SEPARATOR.'FakeEntity.php';

src/Sylius/Bundle/ResourceBundle/spec/Sylius/Bundle/ResourceBundle/Twig/ResourceExtensionSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Pagerfanta\Pagerfanta;
1515
use PhpSpec\ObjectBehavior;
16-
use Prophecy\Argument;
1716
use Symfony\Bundle\TwigBundle\TwigEngine;
1817
use Symfony\Component\DependencyInjection\ContainerInterface;
1918
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;

src/Sylius/Bundle/SettingsBundle/spec/Sylius/Bundle/SettingsBundle/Templating/Helper/SettingsHelperSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace spec\Sylius\Bundle\SettingsBundle\Twig;
12+
namespace spec\Sylius\Bundle\SettingsBundle\Templating\Helper;
1313

1414
use PhpSpec\ObjectBehavior;
1515
use Sylius\Bundle\SettingsBundle\Manager\SettingsManagerInterface;

src/Sylius/Bundle/TaxationBundle/spec/Sylius/Bundle/TaxationBundle/Form/Type/CalculatorChoiceTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\TaxationBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1716

1817
/**

src/Sylius/Bundle/TaxationBundle/spec/Sylius/Bundle/TaxationBundle/Form/Type/TaxCategoryEntityTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\TaxationBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1716

1817
/**

src/Sylius/Bundle/TaxonomyBundle/spec/Sylius/Bundle/TaxonomyBundle/Form/DataTransformer/TaxonSelectionToCollectionTransformerSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Doctrine\Common\Collections\Collection;
1515
use PhpSpec\ObjectBehavior;
16-
use Prophecy\Argument;
1716

1817
// Since the root namespace "spec" is not in our autoload.
1918
require_once __DIR__.DIRECTORY_SEPARATOR.'FakeEntity.php';

src/Sylius/Bundle/VariationBundle/spec/Sylius/Bundle/VariationBundle/Form/DataTransformer/VariantToCombinationTransformerSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ function it_should_not_reverse_transform_variable_with_variants_if_options_not_m
9393

9494
$this->reverseTransform(array($optionValue))->shouldReturn(null);
9595
}
96-
}
96+
}

src/Sylius/Bundle/VariationBundle/spec/Sylius/Bundle/VariationBundle/Form/Type/VariantTypeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Bundle\VariationBundle\Form\Type;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
1716

1817
/**

src/Sylius/Bundle/WebBundle/Resources/views/Backend/Misc/delete.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
<a href="{{ app.request.headers.get('referer') }}" class="btn btn-info"><i class="glyphicon glyphicon-remove"></i> {{ 'sylius.cancel'|trans }}</a>
1616
</div>
1717
</form>
18-
{% endblock %}
18+
{% endblock %}

src/Sylius/Bundle/WebBundle/Resources/views/Frontend/Account/Address/delete.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
</div>
1717
</form>
1818
</div>
19-
{% endblock %}
19+
{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% extends 'SyliusWebBundle:Common/Address:_form.html.twig' %}
1+
{% extends 'SyliusWebBundle:Common/Address:_form.html.twig' %}

src/Sylius/Component/Cart/spec/Sylius/Component/Cart/Resolver/ItemResolvingExceptionSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Component\Cart\Resolver;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615

1716
/**
1817
* @author Julien Janvier <[email protected]>

src/Sylius/Component/Core/spec/Sylius/Component/Core/OrderProcessing/InventoryHandlerSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Doctrine\Common\Collections\ArrayCollection;
1515
use PhpSpec\ObjectBehavior;
16-
use Prophecy\Argument;
1716
use Sylius\Component\Core\Model\InventoryUnitInterface;
1817
use Sylius\Component\Core\Model\OrderInterface;
1918
use Sylius\Component\Core\Model\OrderItemInterface;

src/Sylius/Component/Core/spec/Sylius/Component/Core/OrderProcessing/StateResolverSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Component\Core\OrderProcessing;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Sylius\Component\Core\Model\OrderInterface;
1716
use Sylius\Component\Core\Model\OrderShippingStates;
1817
use Sylius\Component\Core\Model\ShipmentInterface;

src/Sylius/Component/Core/spec/Sylius/Component/Core/Pricing/GroupBasedCalculatorSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PhpSpec\ObjectBehavior;
1515
use Sylius\Component\Core\Model\GroupInterface;
16-
use Sylius\Component\Core\Pricing\Calculators;
1716
use Sylius\Component\Pricing\Model\PriceableInterface;;
1817

1918
/**

src/Sylius/Component/Inventory/spec/Sylius/Component/Inventory/Operator/InsufficientStockExceptionSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Component\Inventory\Operator;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Prophecy\Argument;
1615
use Sylius\Component\Inventory\Model\StockableInterface;
1716

1817
/**

src/Sylius/Component/Pricing/Calculator/VolumeBasedCalculator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function calculate(PriceableInterface $subject, array $configuration, arr
2828
$quantity = array_key_exists('quantity', $context) ? $context['quantity'] : 1;
2929

3030
foreach ($configuration as $range) {
31-
if (empty($range['max']) && $quantity > $range['min']) {
31+
if (empty($range['max']) && $quantity > $range['min']) {
3232
return $range['price'];
3333
}
3434

src/Sylius/Component/Product/spec/Sylius/Component/Product/Model/AttributeSpec.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace spec\Sylius\Component\Product\Model;
1313

1414
use PhpSpec\ObjectBehavior;
15-
use Sylius\Component\Product\Model\AttributeTypes;
1615

1716
/**
1817
* @author Paweł Jędrzejewski <[email protected]>

0 commit comments

Comments
 (0)