Completed
Pull Request — master (#80)
by John
07:39 queued 04:25
created

CustomLogRefBuilder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 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\Response\Error;
10
11
use Symfony\Component\HttpFoundation\Request;
12
13
/**
14
 * @author John Kleijn <[email protected]>
15
 */
16
interface LogRefBuilder
17
{
18
    /**
19
     * @param Request    $request
20
     * @param \Exception $exception
21
     *
22
     * @return string
23
     */
24
    public function create(Request $request, \Exception $exception): string;
25
}
26
27
 class CustomLogRefBuilder implements LogRefBuilder
0 ignored issues
show
Coding Style Compatibility introduced by
Each interface must be in a file by itself

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
28
 {
29
     public function create(Request $request, \Exception $exception): string
30
     {
31
         return uniqid("{$request->headers->get('x-request-id')}_{$exception->getCode()}_");
32
     }
33
 }