Passed
Push — 4 ( 8f1c68...89c87d )
by Steve
09:03
created

DatabaseAdminExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A onAfterBuild() 0 9 2
1
<?php
2
3
namespace SilverStripe\Dev\Validation;
4
5
use ReflectionException;
6
use SilverStripe\Core\Extension;
7
use SilverStripe\ORM\DatabaseAdmin;
8
9
/**
10
 * Hook up static validation to the deb/build process
11
 *
12
 * @method DatabaseAdmin getOwner()
13
 */
14
class DatabaseAdminExtension extends Extension
15
{
16
    /**
17
     * Extension point in @see DatabaseAdmin::doBuild()
18
     *
19
     * @param bool $quiet
20
     * @param bool $populate
21
     * @param bool $testMode
22
     * @throws ReflectionException
23
     */
24
    public function onAfterBuild(bool $quiet, bool $populate, bool $testMode): void
0 ignored issues
show
Unused Code introduced by
The parameter $quiet is not used and could be removed. ( Ignorable by Annotation )

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

24
    public function onAfterBuild(/** @scrutinizer ignore-unused */ bool $quiet, bool $populate, bool $testMode): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $testMode is not used and could be removed. ( Ignorable by Annotation )

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

24
    public function onAfterBuild(bool $quiet, bool $populate, /** @scrutinizer ignore-unused */ bool $testMode): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $populate is not used and could be removed. ( Ignorable by Annotation )

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

24
    public function onAfterBuild(bool $quiet, /** @scrutinizer ignore-unused */ bool $populate, bool $testMode): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        $service = RelationValidationService::singleton();
27
28
        if (!$service->config()->get('output_enabled')) {
29
            return;
30
        }
31
32
        $service->executeValidation();
33
    }
34
}
35