Completed
Pull Request — master (#2)
by Pol
02:05
created

Dice::roll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

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 7
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
namespace drupol\Yaroc\Examples;
4
5
use drupol\Yaroc\Plugin\Provider;
6
7
/**
8
 * Class Dice.
9
 */
10
class Dice extends BaseExample
11
{
12
13
    /**
14
     * @throws \Http\Client\Exception
15
     *
16
     * @return bool|mixed
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array|false.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
17
     */
18
    public function roll()
19
    {
20
        $generateIntegers = Provider::withResource('generateIntegers')
21
            ->withParameters(['n' => 2, 'min' => 1, 'max' => 6]);
22
23
        return $this->getRandomOrgAPI()->getData($generateIntegers);
24
    }
25
}
26