Completed
Push — master ( 90ccc1...22512f )
by Kamil
35:43
created

MetadataController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A customizeAction() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Bundle\MetadataBundle\Controller;
13
14
use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
15
use Symfony\Component\HttpFoundation\Request;
16
use Symfony\Component\HttpFoundation\Response;
17
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
18
19
/**
20
 * @author Kamil Kokot <[email protected]>
21
 */
22
class MetadataController extends ResourceController
23
{
24
    /**
25
     * @param Request $request
26
     *
27
     * @return Response
28
     */
29
    public function customizeAction(Request $request)
30
    {
31
        try {
32
            return $this->updateAction($request);
33
        } catch (NotFoundHttpException $exception) {
34
            return $this->createAction($request);
35
        }
36
    }
37
}
38