InputValidator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 14
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateInputParameters() 0 11 3
1
<?php
2
3
/*
4
 * This file is part of gpupo/pipe2
5
 *
6
 * (c) Gilmar Pupo <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * For more information, see
12
 * <https://opensource.gpupo.com/pipe2/>.
13
 */
14
15
namespace Gpupo\Pipe2\Merge\Attributes;
16
17
class InputValidator
18
{
19
    public function validateInputParameters(Array $parameters)
20
    {
21
        foreach (['firstDocument', 'secondDocument'] as $key) {
22
            $filePath = $parameters[$key];
23
            if (!file_exists($filePath)) {
24
                throw new \InvalidArgumentException('Input File '.$filePath.' not found');
25
            }
26
        }
27
28
        return true;
29
    }
30
}
31