Completed
Push — master ( 250cb0...5473d5 )
by Florian
01:41
created

Values::values()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Cocur\Chain\Link;
4
5
use Cocur\Chain\Chain;
6
7
/**
8
 * Values.
9
 *
10
 * @author    Florian Eckerstorfer
11
 * @copyright 2015-2018 Florian Eckerstorfer
12
 */
13
trait Values
14
{
15
    /**
16
     * @return Chain
0 ignored issues
show
Documentation introduced by
Should the return type not be Values?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
17
     */
18 1
    public function values()
19
    {
20 1
        $this->array = array_values($this->array);
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...
21
22 1
        return $this;
23
    }
24
}
25