Passed
Push — master ( 5ad2cb...35956d )
by Antonio Carlos
03:45
created

Trivia   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A trivia() 0 10 1
1
<?php
2
3
namespace PragmaRX\Random;
4
5
use PragmaRX\Trivia\Trivia as TriviaService;
6
7
trait Trivia
8
{
9
    /**
10
     * Generate trivia lines.
11
     *
12
     * @return static
13
     */
14 1
    public function trivia()
15
    {
16 1
        $this->array = true;
0 ignored issues
show
Bug introduced by
The property array does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
17
18 1
        $this->count = 1;
0 ignored issues
show
Bug introduced by
The property count does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
19
20 1
        $this->items = (new TriviaService())->all();
0 ignored issues
show
Bug introduced by
The property items does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
21
22 1
        return $this;
23
    }
24
}
25