Completed
Pull Request — master (#80)
by John
02:58
created

PetObjectController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

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
use KleijnWeb\SwaggerBundle\Tests\Functional\PetStore\Model\Resources\Tag;
13
use Symfony\Component\HttpFoundation\Request;
14
15
/**
16
 * @author John Kleijn <[email protected]>
17
 */
18
class PetObjectController
19
{
20
    /**
21
     * @param Pet $body
22
     *
23
     * @return array
24
     */
25
    public function addPet(Pet $body)
26
    {
27
        $body->setId(rand());
28
        $body->getCategory()->setId(rand());
29
30
        foreach ($body->getTags() as $tag) {
31
            $tag->setId(rand());
32
        };
33
34
        return $body;
35
    }
36
}
37