Test Failed
Pull Request — master (#2)
by Pol
03:30
created

Dice::roll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 9
ccs 0
cts 7
cp 0
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
crap 2
1
<?php
2
3
namespace drupol\Yaroc\Examples;
4
5
use drupol\Yaroc\Plugin\Method\GenerateIntegers;
6
7
/**
8
 * Class Dice.
9
 */
10
class Dice extends BaseExample
11
{
12
13
    /**
14
     * @throws \Http\Client\Exception
15
     *
16
     * @return bool|mixed
17
     */
18
    public function roll()
19
    {
20
        $parameters = ['n' => 2, 'min' => 1, 'max' => 6];
21
22
        $generateIntegers = (new GenerateIntegers($this->getHttpClient()))
23
            ->withParameters($parameters);
24
25
        return $this->getRandomOrgAPI()->getData($generateIntegers);
26
    }
27
}
28