Passed
Branch master (df2ee3)
by Dawid
07:19 queued 02:10
created

Events::getCheckSchemaEventNameFor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\Event\ResponseSchemaCheck;
6
7
use Spiechu\SymfonyCommonsBundle\Utils\StringUtils;
8
9
final 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
    private const CHECK_SCHEMA_EVENT_NAME_PATTERN = 'spiechu_symfony_commons.event.response_schema_check.check_schema_%s';
17
18 1
    public static function getCheckSchemaEventNameFor(string $format): string
19
    {
20 1
        StringUtils::assertNotEmpty($format);
21
22 1
        return sprintf(self::CHECK_SCHEMA_EVENT_NAME_PATTERN, strtolower($format));
23
    }
24
}
25