TryCatch::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\CollectionMacros\Macros;
4
5
use Spatie\CollectionMacros\Helpers\CatchableCollectionProxy;
6
7
class TryCatch
8
{
9
    public function __invoke()
10
    {
11
        return function () {
12
            return new CatchableCollectionProxy($this);
0 ignored issues
show
Compatibility introduced by
$this of type object<Spatie\CollectionMacros\Macros\TryCatch> is not a sub-type of object<Illuminate\Support\Enumerable>. It seems like you assume a child interface of the class Spatie\CollectionMacros\Macros\TryCatch to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
13
        };
14
    }
15
}
16