UnleashedBuildTask   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A log() 0 8 3
1
<?php
2
3
namespace AntonyThorpe\SilverShopUnleashed\Task;
4
5
use SilverStripe\Control\Controller;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Control\Controller 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 SilverStripe\Control\Director;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Control\Director 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 SilverStripe\Dev\BuildTask;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Dev\BuildTask 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
use SilverStripe\ORM\DatabaseAdmin;
0 ignored issues
show
Bug introduced by
The type SilverStripe\ORM\DatabaseAdmin 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...
9
use SilverStripe\ORM\DB;
0 ignored issues
show
Bug introduced by
The type SilverStripe\ORM\DB 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...
10
11
/**
12
 * Base BuildTask for Unleashed Software
13
 */
14
abstract class UnleashedBuildTask extends BuildTask
15
{
16
    protected string $email_subject = "API Unleashed Software";
17
18
    protected bool $preview = false;
19
20
    /**
21
     * echo to screen for Build Reports
22
     */
23
    protected function log(string $text): void
24
    {
25
        if (Controller::curr() instanceof DatabaseAdmin) {
26
            DB::alteration_message($text, 'obsolete');
27
        } elseif (Director::is_cli()) {
28
            echo $text . "\n";
29
        } else {
30
            echo $text . "<br/>";
31
        }
32
    }
33
}
34