Utils   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A escapeArgs() 0 4 1
A fetchKeys() 0 4 1
1
<?php
2
3
namespace ExiftoolReader;
4
5
use Symfony\Component\Process\ProcessUtils;
6
7
/**
8
 * Class Utils
9
 */
10
class Utils
11
{
12
    /**
13
     * Escape shell arguments.
14
     *
15
     * @param string $args
16
     * @return string
17
     */
18
    public function escapeArgs($args)
19
    {
20
        return ProcessUtils::escapeArgument($args);
21
    }
22
23
    /**
24
     * Fetch array values by provided keys.
25
     * If no value for one of provided keys - key will be skipped.
26
     *
27
     * @param array $array
28
     * @param array $keys
29
     * @return array
30
     */
31
    public function fetchKeys(array $array, array $keys)
32
    {
33
        return array_intersect_key($array, array_flip($keys));
34
    }
35
}