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

Dealer::play()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 10
rs 10
c 1
b 1
f 0
ccs 4
cts 4
cp 1
crap 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