Completed
Push — master ( afaf42...8ac772 )
by Raffael
20:10 queued 16:21
created

Validator::validate()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 10
cp 0
rs 9.8666
c 0
b 0
f 0
cc 3
nc 3
nop 1
crap 12
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * balloon
7
 *
8
 * @copyright   Copryright (c) 2012-2018 gyselroth GmbH (https://gyselroth.com)
9
 * @license     GPL-3.0 https://opensource.org/licenses/GPL-3.0
10
 */
11
12
namespace Balloon\Filesystem\Storage\Adapter\Smb;
13
14
use InvalidArgumentException;
15
16
class Validator
17
{
18
    /**
19
     * Validate options.
20
     */
21
    public static function validate(array $options): array
22
    {
23
        if (!isset($options['host'])) {
24
            throw new InvalidArgumentException('host is required for smb');
25
        }
26
27
        if (!isset($options['share'])) {
28
            throw new InvalidArgumentException('share name is required for smb');
29
        }
30
31
        return $options;
32
    }
33
}
34