Issues (63)

src/Fixture/FrequentlyAskedQuestionFixture.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 FrequentlyAskedQuestionFixture extends AbstractFixture
18
{
19
    /** @var FixtureFactoryInterface */
20
    private $frequentlyAskedQuestionFixtureFactory;
21
22
    public function __construct(FixtureFactoryInterface $frequentlyAskedQuestionFixtureFactory)
23
    {
24
        $this->frequentlyAskedQuestionFixtureFactory = $frequentlyAskedQuestionFixtureFactory;
25
    }
26
27
    public function load(array $options): void
28
    {
29
        $this->frequentlyAskedQuestionFixtureFactory->load($options['custom']);
30
    }
31
32
    public function getName(): string
33
    {
34
        return 'frequently_asked_question';
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('enabled')->defaultTrue()->end()
47
                            ->integerNode('position')->defaultNull()->end()
48
                            ->arrayNode('channels')->scalarPrototype()->end()->end()
49
                            ->arrayNode('translations')
50
                                ->arrayPrototype()
51
                                    ->children()
52
                                        ->scalarNode('question')->defaultNull()->end()
53
                                        ->scalarNode('answer')->defaultNull()->end()
54
                                    ->end()
55
                                ->end()
56
                            ->end()
57
                        ->end()
58
                    ->end()
59
                ->end()
60
            ->end()
61
        ;
62
    }
63
}
64