BaseGalleryItemRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateId() 0 4 1
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\MediaBundle\PHPCR;
15
16
use Doctrine\ODM\PHPCR\DocumentRepository;
17
use Doctrine\ODM\PHPCR\Id\RepositoryIdInterface;
18
19
/**
20
 * @final since sonata-project/media-bundle 3.21.0
21
 */
22
class BaseGalleryItemRepository extends DocumentRepository implements RepositoryIdInterface
23
{
24
    /**
25
     * @param mixed $document
26
     * @param mixed $parent
27
     *
28
     * @return string
29
     */
30
    public function generateId($document, $parent = null)
31
    {
32
        return '/cms/gallery-has-media/'.uniqid();
33
    }
34
}
35