Passed
Branch master (4407aa)
by ANTHONIUS
03:52
created

Configuration   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 29
dl 0
loc 42
ccs 24
cts 24
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addServiceSection() 0 16 1
A getConfigTreeBuilder() 0 22 2
1
<?php
0 ignored issues
show
Coding Style introduced by
Class found in ".php" file; use ".inc" extension instead
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "Configuration.php" doesn't match the expected filename "configuration.php"
Loading history...
2
0 ignored issues
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
3
/*
0 ignored issues
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
4
 * This file is part of the DoyoUserBundle project.
5
 *
6
 * (c) Anthonius Munthi <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Doyo\UserBundle\DependencyInjection;
15
16
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
17
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
18
use Symfony\Component\Config\Definition\ConfigurationInterface;
19
20
class Configuration implements ConfigurationInterface
0 ignored issues
show
Coding Style Documentation introduced by
Missing doc comment for class Configuration
Loading history...
21
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Configuration
Loading history...
22 1
    public function getConfigTreeBuilder()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
Coding Style introduced by
Missing doc comment for function getConfigTreeBuilder()
Loading history...
23
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
24 1
        $treeBuilder = new TreeBuilder('doyo_user');
25
26
        //@codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// @codeCoverageIgnoreStart" but found "//@codeCoverageIgnoreStart"
Loading history...
27
        if (method_exists($treeBuilder, 'getRootNode')) {
28
            $rootNode = $treeBuilder->getRootNode();
29
        } else {
30
            $rootNode = $treeBuilder->root('doyo_user');
31
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
32
        //@codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
No space found before comment text; expected "// @codeCoverageIgnoreEnd" but found "//@codeCoverageIgnoreEnd"
Loading history...
Coding Style introduced by
There should be no blank line after an inline comment.
Loading history...
33
34
        $rootNode
35 1
            ->children()
0 ignored issues
show
Coding Style introduced by
Space found before object operator
Loading history...
36 1
                ->scalarNode('db_driver')->defaultValue('orm')->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
37 1
                ->scalarNode('user_class')->isRequired()->cannotBeEmpty()->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
38 1
                ->scalarNode('model_manager_name')->defaultValue('default')->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
39 1
                ->booleanNode('api_platform')->defaultValue(false)->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
40 1
            ->end();
0 ignored issues
show
Coding Style introduced by
Space found before object operator
Loading history...
41 1
        $this->addServiceSection($rootNode);
42
43 1
        return $treeBuilder;
44
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getConfigTreeBuilder()
Loading history...
45
46 1
    private function addServiceSection(ArrayNodeDefinition $node)
0 ignored issues
show
Coding Style introduced by
Private method name "Configuration::addServiceSection" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Missing doc comment for function addServiceSection()
Loading history...
47
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
48
        $node
49 1
            ->addDefaultsIfNotSet()
0 ignored issues
show
Coding Style introduced by
Space found before object operator
Loading history...
50 1
            ->children()
0 ignored issues
show
Coding Style introduced by
Space found before object operator
Loading history...
51 1
                ->arrayNode('service')
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
52 1
                    ->addDefaultsIfNotSet()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 20
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
53 1
                        ->children()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 24
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
54 1
                            ->scalarNode('email_canonicalizer')->defaultValue('doyo_user.util.canonicalizer.default')->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 28
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 124 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
55 1
                            ->scalarNode('username_canonicalizer')->defaultValue('doyo_user.util.canonicalizer.default')->end()
0 ignored issues
show
Bug introduced by
The method scalarNode() 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

55
                            ->/** @scrutinizer ignore-call */ scalarNode('username_canonicalizer')->defaultValue('doyo_user.util.canonicalizer.default')->end()
Loading history...
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 28
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 127 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
56 1
                            ->scalarNode('password_updater')->defaultValue('doyo_user.util.password_updater.default')->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 28
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 124 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
57 1
                            ->scalarNode('user_manager')->defaultValue('doyo_user.user_manager.default')->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 28
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 111 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
58 1
                        ->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 24
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
59 1
                    ->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 20
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
60 1
                ->end()
0 ignored issues
show
Coding Style introduced by
Object operator not indented correctly; expected 12 spaces but found 16
Loading history...
Coding Style introduced by
Space found before object operator
Loading history...
61 1
            ->end();
0 ignored issues
show
Coding Style introduced by
Space found before object operator
Loading history...
62
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end addServiceSection()
Loading history...
63
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
64