MappingConfigValidator::validate()   A
last analyzed

Complexity

Conditions 3
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 3
eloc 5
nc 1
nop 1
crap 3
1
<?php
2
3
namespace DRKP\ZF3Doctrine;
4
5
/**
6
 * Class MappingConfigValidator
7
 * @package DRKP\ZF3Doctrine
8
 */
9
class MappingConfigValidator
10
{
11
    /**
12
     * @param array $mappings
13
     * @return bool
14
     */
15
    public static function validate(array $mappings)
16
    {
17 9
        return 0 === count(array_filter($mappings, function ($mapping) {
18 9
            return !array_key_exists('path', $mapping) ||
19 7
            !array_key_exists('namespace', $mapping) ||
20 9
            !array_key_exists('type', $mapping);
21 9
        }));
22
    }
23
}
24