Passed
Push — master ( b19e1a...9e97df )
by Robert
03:55
created

Transcript::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace LivePersonInc\LiveEngageLaravel\Collections;
4
5
use Illuminate\Support\Collection;
6
use LivePersonInc\LiveEngageLaravel\Models\Message;
7
8
class Transcript extends Collection
9
{
10 2
	public function __construct(array $models = [])
11
	{
12
		$models = array_map(function($item) {
13 2
			return new Message((array) $item);
14 2
		}, $models);
15 2
		return parent::__construct($models);
0 ignored issues
show
Bug introduced by
Are you sure the usage of parent::__construct($models) targeting Illuminate\Support\Collection::__construct() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
16
	}
17
}
18