Completed
Pull Request — master (#44)
by Angelo
02:08
created

stripNameAndValidate.php ➔ stripNameAndValidate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Moka\Stub\Helper;
5
6
use Moka\Exception\InvalidArgumentException;
7
8
/**
9
 * @param string $name
10
 * @return string
11
 * @throws InvalidArgumentException
12
 */
13
function stripNameAndValidate(string $name): string
14
{
15 94
    $name = stripName($name);
16
17 94
    validateName($name);
18
19
    return $name;
20
}