Completed
Push — master ( 944006...1e86f4 )
by
unknown
02:33 queued 11s
created

DefaultGenerator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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\MediaBundle\Generator;
15
16
if (!class_exists(IdGenerator::class, false)) {
17
    @trigger_error(sprintf(
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
18
        'The %s\DefaultGenerator class is deprecated since sonata/media-bundle 3.4 and will be removed in 4.0.'
19
        .' Use \Sonata\MediaBundle\Generator\IdGenerator instead.',
20
        __NAMESPACE__
21
    ), E_USER_DEPRECATED);
22
}
23
24
class_alias(IdGenerator::class, DefaultGenerator::class);
25
26
if (false) {
27
    /**
28
     * @deprecated 3.4 Use Sonata\MediaBundle\Generator\IdGenerator
29
     */
30
    class DefaultGenerator extends IdGenerator implements GeneratorInterface
31
    {
32
    }
33
}
34