Passed
Push — main ( f3cfb1...17781b )
by Emil
04:34
created

Dealer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A play() 0 10 2
1
<?php
2
3
namespace App\Game\BlackJack;
4
5
/**
6
 * Dealer.
7
 */
8
class Dealer extends Player
9
{
10
    /**
11
     * play.
12
     *
13
     * Simple logic to play the dealer
14
     */
15 6
    public function play(): bool
16
    {
17
        // If hand value 17 or higher
18 6
        if ($this->handValue > 16) {
19
            // Stop playing
20 6
            return false;
21
        }
22
23
        // Continue playing
24 5
        return true;
25
    }
26
}
27