Completed
Pull Request — master (#2)
by Pol
07:20 queued 05:24
created

Dice   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 4

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A roll() 0 7 1
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
     * @SuppressWarnings(PHPMD.StaticAccess)
19
     */
20
    public function roll()
21
    {
22
        $generateIntegers = Provider::withResource('generateIntegers')
23
            ->withParameters(['n' => 2, 'min' => 1, 'max' => 6]);
24
25
        return $this->getRandomOrgAPI()->getData($generateIntegers);
26
    }
27
}
28