ValidationResponseFactory::createValidation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 7
nc 1
nop 1
crap 1
1
<?php
2
3
namespace TonicForHealth\PagerDutyClient\Validation;
4
5
/**
6
 * Class ValidationFactory.
7
 */
8
class ValidationResponseFactory
9
{
10
    /**
11
     * @param string $resourceName
12
     *
13
     * @return ValidationResponseInterface
14
     */
15 4
    public static function createValidation($resourceName)
16
    {
17 4
        $className = sprintf(
18 4
            '\%s\%s\%sValidationResponse',
19 4
            __NAMESPACE__,
20
            $resourceName,
21
            $resourceName
22
        );
23
24 4
        return new $className();
25
    }
26
}
27