Passed
Push — master ( 5f46e8...f05eff )
by Paweł
03:06
created

Weapon   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

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
    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
        parent::__construct($name, $description, $sellValue, $buyValue);
24
    }
25
26
    public function getType(): WeaponType
27
    {
28
        return $this->type;
29
    }
30
31
    public function getDamage(): Damage
32
    {
33
        return $this->damage;
34
    }
35
}
36