Issues (63)

src/Fixture/BlockFixture.php (1 issue)

Labels
Severity
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\SyliusCmsPlugin\Fixture;
12
13
use BitBag\SyliusCmsPlugin\Fixture\Factory\FixtureFactoryInterface;
14
use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture;
15
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
16
17
final class BlockFixture extends AbstractFixture
18
{
19
    /** @var FixtureFactoryInterface */
20
    private $blockFixtureFactory;
21
22
    public function __construct(FixtureFactoryInterface $blockFixtureFactory)
23
    {
24
        $this->blockFixtureFactory = $blockFixtureFactory;
25
    }
26
27
    public function load(array $options): void
28
    {
29
        $this->blockFixtureFactory->load($options['custom']);
30
    }
31
32
    public function getName(): string
33
    {
34
        return 'block';
35
    }
36
37
    protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void
38
    {
39
        $optionsNode
40
            ->children()
41
                ->arrayNode('custom')
42
                    ->arrayPrototype()
43
                        ->children()
44
                            ->booleanNode('remove_existing')->defaultTrue()->end()
45
                            ->integerNode('number')->defaultNull()->end()
0 ignored issues
show
The method integerNode() does not exist on Symfony\Component\Config...der\NodeParentInterface. It seems like you code against a sub-type of Symfony\Component\Config...der\NodeParentInterface such as Symfony\Component\Config...ion\Builder\NodeBuilder. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
                            ->/** @scrutinizer ignore-call */ integerNode('number')->defaultNull()->end()
Loading history...
46
                            ->booleanNode('last_four_products')->defaultFalse()->end()
47
                            ->booleanNode('enabled')->defaultTrue()->end()
48
                            ->integerNode('products')->defaultNull()->end()
49
                            ->arrayNode('productCodes')->scalarPrototype()->end()->end()
50
                            ->arrayNode('taxons')->scalarPrototype()->end()->end()
51
                            ->arrayNode('sections')->scalarPrototype()->end()->end()
52
                            ->arrayNode('channels')->scalarPrototype()->end()->end()
53
                            ->arrayNode('translations')
54
                                ->arrayPrototype()
55
                                    ->children()
56
                                        ->scalarNode('name')->defaultNull()->end()
57
                                        ->scalarNode('content')->defaultNull()->end()
58
                                        ->scalarNode('link')->defaultNull()->end()
59
                                        ->scalarNode('image_path')->defaultNull()->end()
60
                                    ->end()
61
                                ->end()
62
                            ->end()
63
                        ->end()
64
                    ->end()
65
                ->end()
66
            ->end()
67
        ;
68
    }
69
}
70