Passed
Pull Request — master (#93)
by
unknown
03:38
created

ExportWishlistToPdfAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 6
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handleCommand() 0 4 1
1
<?php
2
3
/*
4
 * This file was created by developers working at BitBag
5
 * Do you need more information about us and what we do? Visit our https://bitbag.io website!
6
 * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
7
*/
8
9
declare(strict_types=1);
10
11
namespace BitBag\SyliusWishlistPlugin\Controller\Action;
12
13
use BitBag\SyliusWishlistPlugin\Command\Wishlist\AddWishlistProduct;
14
use BitBag\SyliusWishlistPlugin\Command\Wishlist\ExportSelectedProductsFromWishlistToPdf;
15
use BitBag\SyliusWishlistPlugin\Context\WishlistContextInterface;
16
use BitBag\SyliusWishlistPlugin\Exporter\ExporterWishlistToPdfInterface;
0 ignored issues
show
Bug introduced by
The type BitBag\SyliusWishlistPlu...rWishlistToPdfInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use BitBag\SyliusWishlistPlugin\Factory\Command\CommandFactory;
18
use BitBag\SyliusWishlistPlugin\Factory\Command\CommandFactoryInterface;
19
use BitBag\SyliusWishlistPlugin\Form\Type\WishlistCollectionType;
20
use BitBag\SyliusWishlistPlugin\Processor\WishlistCommandProcessorInterface;
21
use Doctrine\Common\Collections\ArrayCollection;
22
use Sylius\Component\Order\Context\CartContextInterface;
23
use Symfony\Component\Form\FormFactoryInterface;
24
use Symfony\Component\Form\FormInterface;
25
use Symfony\Component\HttpFoundation\RedirectResponse;
26
use Symfony\Component\HttpFoundation\Request;
27
use Symfony\Component\HttpFoundation\Response;
28
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
29
use Symfony\Component\Messenger\HandleTrait;
30
use Symfony\Component\Messenger\MessageBusInterface;
31
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
32
use Symfony\Contracts\Translation\TranslatorInterface;
33
use Twig\Environment;
34
35
final class ExportWishlistToPdfAction extends BaseWishlistProductsAction
36
{
37
    protected function handleCommand(FormInterface $form): void
38
    {
39
        $command = new ExportSelectedProductsFromWishlistToPdf($form->get('items')->getData());
40
        $this->messageBus->dispatch($command);
41
    }
42
}
43