Completed
Pull Request — master (#404)
by De Cramer
03:04
created

ExpansionVersion::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 0
cts 9
cp 0
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 4
crap 2
1
<?php
2
3
namespace eXpansion\Bundle\ServerInformation\Services\ServerInformation;
4
5
use eXpansion\Bundle\ServerInformation\Ui\Factory\ServerInformationLineFactory;
6
use eXpansion\Framework\AdminGroups\Helpers\AdminGroups;
7
use eXpansion\Framework\Core\Helpers\Version;
8
use eXpansion\Framework\Core\Storage\GameDataStorage;
9
use eXpansion\Framework\Core\Storage\PlayerStorage;
10
use FML\Controls\Control;
11
12 View Code Duplication
class ExpansionVersion extends AbstractServerInformation
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    /** @var Version */
15
    protected $version;
16
17
    public function __construct(
18
        ServerInformationLineFactory $serverInformationLineFactory,
19
        AdminGroups $adminGroupHelper,
20
        Version $version,
21
        $requiredPermission = null
22
    ) {
23
        parent::__construct($serverInformationLineFactory, $adminGroupHelper, $requiredPermission);
24
25
        $this->version = $version;
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31
    public function getInformation(string $login): Control
32
    {
33
        return $this->serverInformationLineFactory->create("expansion_server_information.exp_version", $this->version->getExpansionVersion());
34
    }
35
}
36