Completed
Push — 3.x-dev-kit ( 4fe8f1 )
by
unknown
11:30 queued 08:33
created

AbstractTypeGuesser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getParentMetadataForProperty() 0 9 2
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[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
12
namespace Sonata\DoctrineORMAdminBundle\Guesser;
13
14
use Doctrine\ORM\Mapping\MappingException;
15
use Sonata\AdminBundle\Guesser\TypeGuesserInterface;
16
use Sonata\AdminBundle\Model\ModelManagerInterface;
17
18
abstract class AbstractTypeGuesser implements TypeGuesserInterface
19
{
20
    /**
21
     * @param string                $baseClass
22
     * @param string                $propertyFullName
23
     * @param ModelManagerInterface $modelManager
24
     *
25
     * @return array|null
26
     */
27
    protected function getParentMetadataForProperty($baseClass, $propertyFullName, ModelManagerInterface $modelManager)
28
    {
29
        try {
30
            return $modelManager->getParentMetadataForProperty($baseClass, $propertyFullName);
31
        } catch (MappingException $e) {
32
            // no metadata not found.
33
            return;
34
        }
35
    }
36
}
37