FolderGenerator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 8 1
1
<?php
2
3
/*
4
 * This file is part of the PostmanGeneratorBundle package.
5
 *
6
 * (c) Vincent Chalamon <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace PostmanGeneratorBundle\Generator;
13
14
use Dunglas\ApiBundle\Api\ResourceInterface;
15
use PostmanGeneratorBundle\Model\Folder;
16
use Ramsey\Uuid\Uuid;
17
18
class FolderGenerator implements GeneratorInterface
19
{
20
    /**
21
     * {@inheritdoc}
22
     *
23
     * @return Folder
24
     */
25 1
    public function generate(ResourceInterface $resource = null)
26
    {
27 1
        $folder = new Folder();
28 1
        $folder->setId((string) Uuid::uuid4());
29 1
        $folder->setName($resource->getShortName());
30
31 1
        return $folder;
32
    }
33
}
34