Cancelled
Branch master (244451)
by Tim
10:31
created

Store::invokeTest()   B

Complexity

Conditions 3
Paths 3

Size

Total Lines 26
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 13
nc 3
nop 0
dl 0
loc 26
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace SimpleSAML\Module\monitor\TestSuite;
4
5
use \SimpleSAML\Module\monitor\TestConfiguration as TestConfiguration;
6
use \SimpleSAML\Module\monitor\State as State;
7
use \SimpleSAML\Module\monitor\TestData as TestData;
8
9
final class Store extends \SimpleSAML\Module\monitor\TestSuiteFactory
10
{
11
    /**
12
     * var string|null
13
     */
14
    private $store = null;
15
16
    /**
17
     * @param TestConfiguration $configuration
18
     */
19
    public function __construct($configuration)
20
    {
21
        $globalConfig = $configuration->getGlobalConfig();
22
        $this->store = $globalConfig->getString('store.type', 'phpsession');
23
        $this->setCategory('Session store');
24
25
        parent::__construct($configuration);
26
    }
27
28
    /**
29
     * @return void
30
     */
31
    public function invokeTest()
32
    {
33
        $configuration = $this->getConfiguration();
34
35
        switch ($this->store) {
36
            case 'phpsession':
37
                $test = new Store\Phpsession($configuration);
38
                break;
39
            case 'memcache':
40
                $test = new Store\Memcache($configuration);
41
                break;
42
// TODO:
43
//            case 'redis':
44
//            case 'redissentinel':
45
//                $test = new Store\Redis($configuration);
46
//                break;
47
//            case 'sql':
48
//                $test = new Store\Sql($configuration);
49
//                break;
50
            default:
51
                SimpleSAML_Logger::warning("Not implemented;  $this->store - Skipping Store TestSuite.");
0 ignored issues
show
Bug introduced by
The type SimpleSAML\Module\monito...Suite\SimpleSAML_Logger 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...
52
                return;
53
        }
54
55
        $this->addTestResult($test->getTestResult());
56
        $this->setTestResult($test->getTestResult());
57
    }
58
}
59