GraphicCard::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
nc 1
nop 5
dl 0
loc 4
c 1
b 0
f 0
cc 1
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Model;
4
5
use App\Model\Card;
6
7
class GraphicCard extends Card
8
{
9
    private string $graphic;
10
11 2
    public function __construct(string $suit, string $name, int $value, string $graphic, ?int $alternativeValue = null)
12
    {
13 2
        parent::__construct($suit, $name, $value, $alternativeValue);
14 2
        $this->graphic = $graphic;
15
    }
16
17
    /**
18
     * Returns an array containing the card's suit, name, value, alternative value, and graphic.
19
     *
20
     * @return array<mixed> The card's suit, name, value, alternative value, and graphic.
21
     */
22 1
    public function getCard(): array
23
    {
24 1
        return [$this->suit, $this->name, $this->value, $this->alternativeValue, $this->graphic];
25
    }
26
}
27