Trivia   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 10
c 2
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A trivia() 0 10 1
1
<?php
2
3
namespace PragmaRX\Random;
4
5
use PragmaRX\Random\Generators\ArrayGenerator;
6
use PragmaRX\Trivia\Trivia as TriviaService;
7
8
trait Trivia
9
{
10
    use ArrayGenerator;
11
12
    /**
13
     * Generate trivia lines.
14
     *
15
     * @return static
16
     */
17 1
    public function trivia()
18
    {
19 1
        $this->array = true;
20
21 1
        $this->count = 1;
22
23 1
        $this->items = (new TriviaService())->all();
0 ignored issues
show
Documentation Bug introduced by
It seems like (new \PragmaRX\Trivia\Trivia())->all() of type object<PragmaRX\Coollection\Package\Coollection> is incompatible with the declared type array of property $items.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
24
25 1
        return $this;
26
    }
27
}
28