Completed
Push — master ( b64fc1...5651bd )
by Raffael
16:20 queued 08:39
created

Validator::validate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * tubee
7
 *
8
 * @copyright   Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com)
9
 * @license     GPL-3.0 https://opensource.org/licenses/GPL-3.0
10
 */
11
12
namespace Tubee\Job;
13
14
use Tubee\Helper;
15
16
class Validator
17
{
18
    /**
19
     * Validate resource.
20
     */
21
    public static function validate(array $resource): array
22
    {
23
        if (isset($resource['data']['filter'])) {
24
            Helper::jsonDecode(stripslashes($resource['data']['filter']), true);
25
        }
26
27
        return $resource;
28
    }
29
}
30