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

StringUtils::assertNotEmpty()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 4
cp 0.75
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 1
crap 2.0625
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\Utils;
6
7
class StringUtils
8
{
9
    /**
10
     * @throws \InvalidArgumentException
11
     */
12 1
    public static function assertNotEmpty(string $string): void
13
    {
14 1
        if ('' === $string) {
15
            throw new \InvalidArgumentException('Empty string provided');
16
        }
17 1
    }
18
}
19