Completed
Pull Request — master (#6209)
by Jordi Sala
03:47 queued 54s
created

PostCategoryAdmin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getParentAssociationMapping() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\AdminBundle\Tests\Fixtures\Admin;
15
16
use Sonata\AdminBundle\Admin\AbstractAdmin;
17
18
class PostCategoryAdmin extends AbstractAdmin
19
{
20
    public function getParentAssociationMapping(): ?string
21
    {
22
        if ($this->getParent() instanceof PostAdmin) {
23
            return 'posts';
24
        }
25
26
        return null;
27
    }
28
}
29