OrganizationPersonaSequenceFixture   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 2
A getOrder() 0 3 1
1
<?php
2
3
namespace App\Fixture;
4
5
use Doctrine\Common\DataFixtures\FixtureInterface;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\DataFixtures\FixtureInterface 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...
6
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\DataFixt...OrderedFixtureInterface 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...
7
use Doctrine\Common\Persistence\ObjectManager;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Persistence\ObjectManager 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...
8
9
/**
10
 * Class OrganizationPersonaSequenceFixture
11
 */
12
final class OrganizationPersonaSequenceFixture implements FixtureInterface, OrderedFixtureInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function load(ObjectManager $manager)
18
    {
19
        $connection = $manager->getConnection();
20
        $platform = $connection->getDatabasePlatform()->getName();
21
22
        switch ($platform) {
23
            case 'postgresql':
24
                $connection->exec('ALTER SEQUENCE app_organization_persona_id_seq RESTART WITH 1');
25
                $connection->exec('ALTER SEQUENCE app_organization_persona_trans_id_seq RESTART WITH 1');
26
                break;
27
        }
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function getOrder()
34
    {
35
        return -10;
36
    }
37
}
38