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

CustomLogRefBuilder::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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\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
 }