Completed
Push — master ( d16560...9c731f )
by Dawid
28:16 queued 14:09
created

StringUtils::assertNotEmpty()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

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