ShortSword::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 2
b 0
f 0
nc 1
nop 7
dl 0
loc 17
ccs 5
cts 5
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Inventory\Weapon\ShortSword;
6
7
use AardsGerds\Game\Build\Attribute\Damage;
8
use AardsGerds\Game\Build\Attribute\Strength;
9
use AardsGerds\Game\Build\Talent\WeaponMastery\WeaponMastery;
10
use AardsGerds\Game\Build\Talent\WeaponMastery\WeaponMasteryLevel;
11
use AardsGerds\Game\Inventory\Coin;
12
use AardsGerds\Game\Inventory\Weapon\Weapon;
13
use AardsGerds\Game\Inventory\Weapon\WeaponType;
14
15
abstract class ShortSword extends Weapon
16
{
17 4
    public function __construct(
18
        string $name,
19
        string $description,
20
        Coin $sellValue,
21
        Coin $buyValue,
22
        Damage $damage,
23
        WeaponMasteryLevel $requiredWeaponMasteryLevel,
24
        protected Strength $requiredStrength,
25
    ) {
26 4
        parent::__construct(
27 4
            $name,
28
            $description,
29
            $sellValue,
30
            $buyValue,
31 4
            WeaponType::shortSword(),
32
            $damage,
33 4
            WeaponMastery::shortSword($requiredWeaponMasteryLevel),
34
        );
35 4
    }
36
}
37