Weapon   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 5
b 0
f 0
dl 0
loc 22
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getType() 0 3 1
A getDamage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Inventory\Weapon;
6
7
use AardsGerds\Game\Build\Attribute\Damage;
8
use AardsGerds\Game\Build\Talent\WeaponMastery\WeaponMastery;
9
use AardsGerds\Game\Inventory\Coin;
10
use AardsGerds\Game\Inventory\InventoryItem;
11
12
abstract class Weapon extends InventoryItem
13
{
14 6
    public function __construct(
15
        string $name,
16
        string $description,
17
        Coin $sellValue,
18
        Coin $buyValue,
19
        protected WeaponType $type,
20
        protected Damage $damage,
21
        protected WeaponMastery $requiredWeaponMastery,
22
    ) {
23 6
        parent::__construct($name, $description, $sellValue, $buyValue);
24 6
    }
25
26 4
    public function getType(): WeaponType
27
    {
28 4
        return $this->type;
29
    }
30
31 3
    public function getDamage(): Damage
32
    {
33 3
        return $this->damage;
34
    }
35
}
36