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

Transcript   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 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