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

NestedCollection::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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