Completed
Push — master ( 3bca0f...4b95a7 )
by Tomáš
05:03 queued 02:28
created

DefinitionValidator   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 15
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B validate() 0 12 5
1
<?php
2
3
/*
4
 * This file is part of Symplify
5
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
6
 */
7
8
namespace Symplify\DefaultAutowire\DependencyInjection\Definition;
9
10
use Symfony\Component\DependencyInjection\Definition;
11
12
final class DefinitionValidator
13
{
14 5
    public function validate(Definition $definition) : bool
15
    {
16 5
        if (!$definition->isPublic() || $definition->isAbstract()) {
17 1
            return false;
18
        }
19
20 5
        if (null === $definition->getClass() || !class_exists($definition->getClass())) {
21 1
            return false;
22
        }
23
24 5
        return true;
25
    }
26
}
27