Events   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCheckSchemaEventNameFor() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\Event\ResponseSchemaCheck;
6
7
use Spiechu\SymfonyCommonsBundle\Utils\AssertUtils;
8
9
class Events
10
{
11
    /**
12
     * @Event("Spiechu\SymfonyCommonsBundle\Event\ResponseSchemaCheck\CheckResult")
13
     */
14
    public const CHECK_RESULT = 'spiechu_symfony_commons.event.response_schema_check.check_result';
15
16
    protected const CHECK_SCHEMA_EVENT_NAME_PATTERN = 'spiechu_symfony_commons.event.response_schema_check.check_schema_%s';
17
18
    /**
19
     * @param string $format
20
     *
21
     * @return string
22
     */
23 16
    public static function getCheckSchemaEventNameFor(string $format): string
24
    {
25 16
        \assert(
26 16
            AssertUtils::isNotEmpty($format),
27 16
            '$format is empty'
28
        );
29
30 16
        return sprintf(static::CHECK_SCHEMA_EVENT_NAME_PATTERN, strtolower($format));
31
    }
32
}
33