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

NestedItem::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\Item as ResourcesItem;
14
15
/**
16
 * @package flipbox\transform\transformers
17
 * @author Flipbox Factory <[email protected]>
18
 * @since 1.0.0
19
 */
20
class NestedItem extends ResourcesItem implements TransformerInterface
21
{
22
23
    use NestedResourceTrait;
24
25
    /**
26
     * @inheritdoc
27
     */
28
    public function transform(string $identifier = null)
29
    {
30
31
        return $this->scope->getFactory()->transform(
32
            $this,
33
            $identifier,
0 ignored issues
show
Bug introduced by
It seems like $identifier defined by parameter $identifier on line 28 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...
34
            $this->scope
35
        );
36
37
    }
38
39
}
40