GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( af736d...64dffd )
by Odiseo
09:41
created

BannerFixture::load()   F

Complexity

Conditions 14
Paths 456

Size

Total Lines 124
Code Lines 72

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 14
eloc 72
c 1
b 0
f 0
nc 456
nop 1
dl 0
loc 124
rs 2.8953

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusBannerPlugin\Fixture;
6
7
use Doctrine\Common\Persistence\ObjectManager;
8
use Faker\Factory;
9
use Odiseo\SyliusBannerPlugin\Entity\BannerInterface;
10
use Sylius\Bundle\CoreBundle\Fixture\AbstractResourceFixture;
11
use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture;
12
use Sylius\Component\Channel\Model\ChannelInterface;
13
use Sylius\Component\Channel\Repository\ChannelRepositoryInterface;
14
use Sylius\Component\Locale\Model\LocaleInterface;
15
use Sylius\Component\Resource\Factory\FactoryInterface;
16
use Sylius\Component\Resource\Repository\RepositoryInterface;
17
use Sylius\Component\Taxonomy\Model\TaxonInterface;
18
use Sylius\Component\Taxonomy\Repository\TaxonRepositoryInterface;
19
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
20
use Symfony\Component\Finder\Finder;
21
use Symfony\Component\HttpFoundation\File\UploadedFile;
22
use Symfony\Component\OptionsResolver\OptionsResolver;
23
24
final class BannerFixture extends AbstractResourceFixture
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void
30
    {
31
        $resourceNode
32
            ->children()
33
                ->arrayNode('channels')->scalarPrototype()->end()->end()
0 ignored issues
show
Bug introduced by
The method end() does not exist on Symfony\Component\Config...der\NodeParentInterface. It seems like you code against a sub-type of said class. However, the method does not exist in Symfony\Component\Config...ion\Builder\TreeBuilder. Are you sure you never get one of those? ( Ignorable by Annotation )

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

33
                ->arrayNode('channels')->scalarPrototype()->end()->/** @scrutinizer ignore-call */ end()
Loading history...
34
                ->scalarNode('image')->end()
35
                ->scalarNode('mobile_image')->end()
36
        ;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getName(): string
43
    {
44
        return 'banner';
45
    }
46
}
47