Skip to content

Commit eb4b80e

Browse files
committed
OP-551: Comment-out removed classes and interfaces
1 parent 79fb58c commit eb4b80e

File tree

4 files changed

+72
-72
lines changed

4 files changed

+72
-72
lines changed

src/Command/Wishlist/WishlistTokenValueAwareInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
namespace BitBag\SyliusWishlistPlugin\Command\Wishlist;
1313

1414
use BitBag\SyliusWishlistPlugin\Entity\WishlistInterface;
15-
use Sylius\Bundle\ApiBundle\Command\CommandAwareDataTransformerInterface;
15+
//use Sylius\Bundle\ApiBundle\Command\CommandAwareDataTransformerInterface;
1616

17-
interface WishlistTokenValueAwareInterface extends CommandAwareDataTransformerInterface, WishlistSyncCommandInterface
17+
interface WishlistTokenValueAwareInterface extends /** CommandAwareDataTransformerInterface, */ WishlistSyncCommandInterface
1818
{
1919
public function getWishlist(): WishlistInterface;
2020

src/Controller/OrderItemController.php

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -24,68 +24,68 @@
2424
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
2525
use Symfony\Contracts\Translation\TranslatorInterface;
2626

27-
final class OrderItemController extends BaseController
28-
{
29-
public function addAction(Request $request): Response
30-
{
31-
$cart = $this->getCurrentCart();
32-
$configuration = $this->requestConfigurationFactory->create($this->metadata, $request);
33-
34-
$this->isGrantedOr403($configuration, CartActions::ADD);
35-
/** @var OrderItemInterface $orderItem */
36-
$orderItem = $this->newResourceFactory->create($configuration, $this->factory);
37-
38-
$this->getQuantityModifier()->modify($orderItem, 1);
39-
40-
/** @var string $formType */
41-
$formType = $configuration->getFormType();
42-
43-
$form = $this->getFormFactory()->create(
44-
$formType,
45-
$this->createAddToCartCommand($cart, $orderItem),
46-
$configuration->getFormOptions(),
47-
);
48-
49-
$form->handleRequest($request);
50-
51-
/** @var SubmitButton $addToWishlist */
52-
$addToWishlist = $form->get('addToWishlist');
53-
54-
if ($addToWishlist->isClicked()) {
55-
/** @var AddToCartCommandInterface $addToCartCommand */
56-
$addToCartCommand = $form->getData();
57-
58-
/** @var OrderItemInterface $item */
59-
$item = $addToCartCommand->getCartItem();
60-
/** @var ?ProductVariantInterface $variant */
61-
$variant = $item->getVariant();
62-
63-
/** @var ?WishlistInterface $wishlist */
64-
$wishlist = $form->get('wishlists')->getData();
65-
66-
if (null === $variant) {
67-
throw new NotFoundHttpException('Could not find variant');
68-
}
69-
70-
if (null === $wishlist) {
71-
/** @var Session $session */
72-
$session = $request->getSession();
73-
/** @var ?TranslatorInterface $translator */
74-
$translator = $this->get('translator');
75-
76-
if (null !== $translator) {
77-
$session->getFlashBag()->add('error', $translator->trans('bitbag_sylius_wishlist_plugin.ui.go_to_wishlist_failure'));
78-
}
79-
80-
return new Response($this->generateUrl('sylius_shop_homepage'));
81-
}
82-
83-
return new Response($this->generateUrl('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_add_product_variant', [
84-
'wishlistId' => $wishlist->getId(),
85-
'variantId' => $variant->getId(),
86-
]));
87-
}
88-
89-
return parent::addAction($request);
90-
}
91-
}
27+
//final class OrderItemController extends BaseController
28+
//{
29+
// public function addAction(Request $request): Response
30+
// {
31+
// $cart = $this->getCurrentCart();
32+
// $configuration = $this->requestConfigurationFactory->create($this->metadata, $request);
33+
//
34+
// $this->isGrantedOr403($configuration, CartActions::ADD);
35+
// /** @var OrderItemInterface $orderItem */
36+
// $orderItem = $this->newResourceFactory->create($configuration, $this->factory);
37+
//
38+
// $this->getQuantityModifier()->modify($orderItem, 1);
39+
//
40+
// /** @var string $formType */
41+
// $formType = $configuration->getFormType();
42+
//
43+
// $form = $this->getFormFactory()->create(
44+
// $formType,
45+
// $this->createAddToCartCommand($cart, $orderItem),
46+
// $configuration->getFormOptions(),
47+
// );
48+
//
49+
// $form->handleRequest($request);
50+
//
51+
// /** @var SubmitButton $addToWishlist */
52+
// $addToWishlist = $form->get('addToWishlist');
53+
//
54+
// if ($addToWishlist->isClicked()) {
55+
// /** @var AddToCartCommandInterface $addToCartCommand */
56+
// $addToCartCommand = $form->getData();
57+
//
58+
// /** @var OrderItemInterface $item */
59+
// $item = $addToCartCommand->getCartItem();
60+
// /** @var ?ProductVariantInterface $variant */
61+
// $variant = $item->getVariant();
62+
//
63+
// /** @var ?WishlistInterface $wishlist */
64+
// $wishlist = $form->get('wishlists')->getData();
65+
//
66+
// if (null === $variant) {
67+
// throw new NotFoundHttpException('Could not find variant');
68+
// }
69+
//
70+
// if (null === $wishlist) {
71+
// /** @var Session $session */
72+
// $session = $request->getSession();
73+
// /** @var ?TranslatorInterface $translator */
74+
// $translator = $this->get('translator');
75+
//
76+
// if (null !== $translator) {
77+
// $session->getFlashBag()->add('error', $translator->trans('bitbag_sylius_wishlist_plugin.ui.go_to_wishlist_failure'));
78+
// }
79+
//
80+
// return new Response($this->generateUrl('sylius_shop_homepage'));
81+
// }
82+
//
83+
// return new Response($this->generateUrl('bitbag_sylius_wishlist_plugin_shop_locale_wishlist_add_product_variant', [
84+
// 'wishlistId' => $wishlist->getId(),
85+
// 'variantId' => $variant->getId(),
86+
// ]));
87+
// }
88+
//
89+
// return parent::addAction($request);
90+
// }
91+
//}

src/Resources/config/resources.yml

Whitespace-only changes.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
sylius_order:
2-
resources:
3-
order_item:
4-
classes:
5-
controller: BitBag\SyliusWishlistPlugin\Controller\OrderItemController
1+
#sylius_order:
2+
# resources:
3+
# order_item:
4+
# classes:
5+
# controller: BitBag\SyliusWishlistPlugin\Controller\OrderItemController

0 commit comments

Comments
 (0)