Skip to content

Commit

Permalink
Fix the build
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Nov 24, 2020
1 parent 6a3bcf2 commit 6452d64
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 86 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

###> phpunit/phpunit ###
/phpunit.xml
/.phpunit.result.cache
###< phpunit/phpunit ###

###> lexik/jwt-authentication-bundle ###
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,31 @@ public function choiceOrTextFieldFormAction(Request $request): Response
if (!$country->hasProvinces()) {
$form = $this->createProvinceTextForm();

$view = View::create()
->setData([
$content = $this->renderView(
$configuration->getTemplate('_provinceText.html'),
[
'metadata' => $this->metadata,
'form' => $form->createView(),
])
->setTemplate($configuration->getTemplate('_provinceText.html'))
;
]
);

return new JsonResponse([
'content' => $this->viewHandler->handle($configuration, $view)->getContent(),
'content' => $content,
]);
}

$form = $this->createProvinceChoiceForm($country);

$view = View::create()
->setData([
$content = $this->renderView(
$configuration->getTemplate('_provinceChoice.html'),
[
'metadata' => $this->metadata,
'form' => $form->createView(),
])
->setTemplate($configuration->getTemplate('_provinceChoice.html'))
;
]
);

return new JsonResponse([
'content' => $this->viewHandler->handle($configuration, $view)->getContent(),
'content' => $content,
]);
}

Expand Down
24 changes: 10 additions & 14 deletions src/Sylius/Bundle/CoreBundle/Controller/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ public function summaryAction(Request $request): Response

$form = $this->resourceFormFactory->create($configuration, $cart);

$view = View::create()
->setTemplate($configuration->getTemplate('summary.html'))
->setData([
return $this->render(
$configuration->getTemplate('summary.html'),
[
'cart' => $cart,
'form' => $form->createView(),
])
;

return $this->viewHandler->handle($configuration, $view);
]
);
}

public function thankYouAction(Request $request): Response
Expand All @@ -72,13 +70,11 @@ public function thankYouAction(Request $request): Response
$order = $this->repository->find($orderId);
Assert::notNull($order);

$view = View::create()
->setData([
return $this->render(
$configuration->getParameters()->get('template'),
[
'order' => $order,
])
->setTemplate($configuration->getParameters()->get('template'))
;

return $this->viewHandler->handle($configuration, $view);
]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ class PaymentMethodController extends ResourceController
{
public function getPaymentGatewaysAction(Request $request, string $template): Response
{
$configuration = $this->requestConfigurationFactory->create($this->metadata, $request);

$view = View::create()
->setTemplate($template)
->setTemplateVar($this->metadata->getPluralName())
->setData([
return $this->render(
$template,
[
'gatewayFactories' => $this->getParameter('sylius.gateway_factories'),
'metadata' => $this->metadata,
])
;

return $this->viewHandler->handle($configuration, $view);
]
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sylius\Bundle\CoreBundle\Doctrine\ORM\Handler;

use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Doctrine\ORM\OptimisticLockException;
use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration;
use Sylius\Bundle\ResourceBundle\Controller\ResourceUpdateHandlerInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Sylius/Bundle/CoreBundle/Tests/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Sylius\Bundle\CoreBundle\Tests;

use BabDev\PagerfantaBundle\BabDevPagerfantaBundle;
use Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle;
Expand Down Expand Up @@ -50,7 +51,6 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle;
use winzou\Bundle\StateMachineBundle\winzouStateMachineBundle;

final class TestKernel extends BaseKernel
Expand Down Expand Up @@ -96,7 +96,7 @@ public function registerBundles(): array
new LiipImagineBundle(),
new PayumBundle(),
new StofDoctrineExtensionsBundle(),
new WhiteOctoberPagerfantaBundle(),
new BabDevPagerfantaBundle(),
new SyliusFixturesBundle(),
new SyliusPayumBundle(),
new SyliusThemeBundle(),
Expand Down
4 changes: 2 additions & 2 deletions src/Sylius/Bundle/CoreBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"sylius/currency-bundle": "^1.6",
"sylius/customer-bundle": "^1.6",
"sylius/fixtures-bundle": "^1.6.1",
"sylius/grid-bundle": "^1.6",
"sylius/grid-bundle": "dev-master",
"sylius/inventory-bundle": "^1.6",
"sylius/locale-bundle": "^1.6",
"sylius/money-bundle": "^1.6",
Expand All @@ -52,7 +52,7 @@
"sylius/payum-bundle": "^1.6",
"sylius/product-bundle": "^1.6",
"sylius/promotion-bundle": "^1.6",
"sylius/resource-bundle": "^1.6",
"sylius/resource-bundle": "dev-master",
"sylius/review-bundle": "^1.6",
"sylius/shipping-bundle": "^1.6",
"sylius/taxation-bundle": "^1.6",
Expand Down
36 changes: 16 additions & 20 deletions src/Sylius/Bundle/OrderBundle/Controller/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ public function summaryAction(Request $request): Response

$form = $this->resourceFormFactory->create($configuration, $cart);

$view = View::create()
->setTemplate($configuration->getTemplate('summary.html'))
->setData([
return $this->render(
$configuration->getTemplate('summary.html'),
[
'cart' => $cart,
'form' => $form->createView(),
])
;

return $this->viewHandler->handle($configuration, $view);
]
);
}

public function widgetAction(Request $request): Response
Expand All @@ -65,12 +63,12 @@ public function widgetAction(Request $request): Response
return $this->viewHandler->handle($configuration, View::create($cart));
}

$view = View::create()
->setTemplate($configuration->getTemplate('summary.html'))
->setData(['cart' => $cart])
;

return $this->viewHandler->handle($configuration, $view);
return $this->render(
$configuration->getTemplate('summary.html'),
[
'cart' => $cart,
]
);
}

public function saveAction(Request $request): Response
Expand Down Expand Up @@ -118,17 +116,15 @@ public function saveAction(Request $request): Response
return $this->viewHandler->handle($configuration, View::create($form, Response::HTTP_BAD_REQUEST));
}

$view = View::create()
->setData([
return $this->render(
$configuration->getTemplate(ResourceActions::UPDATE . '.html'),
[
'configuration' => $configuration,
$this->metadata->getName() => $resource,
'form' => $form->createView(),
'cart' => $resource,
])
->setTemplate($configuration->getTemplate(ResourceActions::UPDATE . '.html'))
;

return $this->viewHandler->handle($configuration, $view);
]
);
}

public function clearAction(Request $request): Response
Expand Down
12 changes: 5 additions & 7 deletions src/Sylius/Bundle/OrderBundle/Controller/OrderItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,14 @@ public function addAction(Request $request): Response
return $this->handleBadAjaxRequestView($configuration, $form);
}

$view = View::create()
->setData([
return $this->render(
$configuration->getTemplate(CartActions::ADD . '.html'),
[
'configuration' => $configuration,
$this->metadata->getName() => $orderItem,
'form' => $form->createView(),
])
->setTemplate($configuration->getTemplate(CartActions::ADD . '.html'))
;

return $this->viewHandler->handle($configuration, $view);
]
);
}

public function removeAction(Request $request): Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@ class ProductAttributeController extends ResourceController
{
public function getAttributeTypesAction(Request $request, string $template): Response
{
$configuration = $this->requestConfigurationFactory->create($this->metadata, $request);

$view = View::create()
->setTemplate($template)
->setTemplateVar($this->metadata->getPluralName())
->setData([
return $this->render(
$template,
[
'types' => $this->get('sylius.registry.attribute_type')->all(),
'metadata' => $this->metadata,
])
;

return $this->viewHandler->handle($configuration, $view);
]
);
}

public function renderAttributesAction(Request $request): Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,15 @@ public function generateAction(Request $request): Response
return $this->viewHandler->handle($configuration, View::create($form));
}

$view = View::create()
->setTemplate($configuration->getTemplate('generate.html'))
->setData([
return $this->render(
$configuration->getTemplate('generate.html'),
[
'configuration' => $configuration,
'metadata' => $this->metadata,
'promotion' => $promotion,
'form' => $form->createView(),
])
;

return $this->viewHandler->handle($configuration, $view);
]
);
}

protected function getGenerator(): PromotionCouponGeneratorInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/ReviewBundle/test/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function registerBundles(): array
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sylius\Bundle\UserBundle\SyliusUserBundle(),
Expand Down

0 comments on commit 6452d64

Please sign in to comment.