Completed
Push — master ( ad3b69...02c092 )
by John
09:08 queued 05:48
created

HydratedPetController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A addPet() 0 11 2
1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of the KleijnWeb\SwaggerBundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\SwaggerBundle\Tests\Functional\PetStore\Controller;
10
11
use KleijnWeb\SwaggerBundle\Tests\Functional\PetStore\Model\Resources\Pet;
12
13
/**
14
 * @author John Kleijn <[email protected]>
15
 */
16
class HydratedPetController
17
{
18
    /**
19
     * @param Pet $body
20
     *
21
     * @return Pet
22
     */
23
    public function addPet(Pet $body): Pet
24
    {
25
        $body->setId(rand());
26
        $body->getCategory()->setId(rand());
27
28
        foreach ($body->getTags() as $tag) {
29
            $tag->setId(rand());
30
        };
31
32
        return $body;
33
    }
34
}
35