Trivia::trivia()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

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