CardGraphic   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 3
1
<?php
2
3
namespace App\Card;
4
5
/**
6
 * Methods for CardGraphic class.
7
 */
8
class CardGraphic extends Card
9
{
10
    /**
11
     * @var array<string, string>
12
     */
13
    private $graphics = [
14
        'C' => '♣',
15
        'S' => '♠',
16
        'H' => '♥',
17
        'D' => '♦'
18
    ];
19
20 10
    public function __construct(array $card)
21
    {
22 10
        parent::__construct($card);
23
24 10
        foreach ($this->graphics as $suit => $unicode) {
25 10
            if ($suit == $this->value[0]) {
26 10
                array_push($this->value, $unicode);
27
            }
28
        }
29
    }
30
}
31