Completed
Push — master ( 3af5ad...f60e47 )
by Sandro
10s
created

ProvidesDefaultOptionsMandatoryContainerIdBench   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFactoryClass() 0 4 1
A options() 0 4 1
A can() 0 4 1
A fallback() 0 4 1
1
<?php
2
/**
3
 * Sandro Keil (https://sandro-keil.de)
4
 *
5
 * @link      http://github.com/sandrokeil/interop-config for the canonical source repository
6
 * @copyright Copyright (c) 2015-2016 Sandro Keil
7
 * @license   http://github.com/sandrokeil/interop-config/blob/master/LICENSE.md New BSD License
8
 */
9
10
namespace InteropBench\Config;
11
12
use Interop\Config\RequiresConfig;
13
use InteropTest\Config\TestAsset\ConnectionDefaultOptionsMandatoryContainetIdConfiguration;
14
15
class ProvidesDefaultOptionsMandatoryContainerIdBench extends BaseCase
16
{
17
    protected function getFactoryClass(): RequiresConfig
18
    {
19
        return new ConnectionDefaultOptionsMandatoryContainetIdConfiguration();
20
    }
21
22
    /**
23
     * @Subject
24
     * @Groups({"default", "configId", "mandatory"})
25
     */
26
    public function options(): void
27
    {
28
        $this->factory->options($this->config, $this->configId);
0 ignored issues
show
Unused Code introduced by
The call to RequiresConfig::options() has too many arguments starting with $this->configId.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
29
    }
30
31
    /**
32
     * @Subject
33
     * @Groups({"default", "configId", "mandatory"})
34
     */
35
    public function can(): void
36
    {
37
        $this->factory->canRetrieveOptions($this->config, $this->configId);
0 ignored issues
show
Unused Code introduced by
The call to RequiresConfig::canRetrieveOptions() has too many arguments starting with $this->configId.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
38
    }
39
40
    /**
41
     * @Subject
42
     * @Groups({"default", "configId", "mandatory"})
43
     */
44
    public function fallback(): void
45
    {
46
        $this->factory->optionsWithFallback($this->config, $this->configId);
0 ignored issues
show
Bug introduced by
The method optionsWithFallback() does not exist on Interop\Config\RequiresConfig. Did you maybe mean options()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
47
    }
48
}
49