Completed
Pull Request — master (#166)
by
unknown
13:08 queued 10:56
created

Recursive   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 3
1
<?php
2
3
namespace Spatie\CollectionMacros\Macros;
4
5
/**
6
 * Use to deep collect multi-dimensional associative arrays.
7
 */
8
class Recursive
9
{
10
	public function __invoke()
11
	{
12
		return function () {
13
			return $this->map(function ($value) {
0 ignored issues
show
Bug introduced by
The method map() does not seem to exist on object<Spatie\CollectionMacros\Macros\Recursive>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
14
				if (is_array($value) || is_object($value)) {
15
					return collect($value)->recursive();
16
				}
17
18
				return $value;
19
			});
20
		};
21
	}
22
}