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

HydratedPetController::addPet()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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