Completed
Push — master ( 57919c...74fef5 )
by Nate
03:31
created

NestedCollection   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 10 1
1
<?php
2
3
/**
4
 * @package   Transform
5
 * @author    Flipbox Factory
6
 * @copyright Copyright (c) 2017, Flipbox Digital
7
 * @link      https://github.com/flipbox/transform/releases/latest
8
 * @license   https://github.com/flipbox/transform/blob/master/LICENSE
9
 */
10
11
namespace flipbox\transform\transformers;
12
13
use flipbox\transform\resources\Collection as ResourcesCollection;
14
15
/**
16
 * @package flipbox\transform\transformers
17
 * @author Flipbox Factory <[email protected]>
18
 * @since 1.0.0
19
 *
20
 * @property array $data
21
 */
22
class NestedCollection extends ResourcesCollection implements TransformerInterface
23
{
24
25
    use NestedResourceTrait;
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function transform(string $identifier = null)
31
    {
32
33
        return $this->scope->getFactory()->transform(
34
            $this,
35
            $identifier,
0 ignored issues
show
Bug introduced by
It seems like $identifier defined by parameter $identifier on line 30 can also be of type string; however, flipbox\transform\Factory::transform() does only seem to accept null, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
36
            $this->scope
37
        );
38
39
    }
40
41
}
42