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

PHPCRGenerator::generatePath()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 3
nc 4
nop 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\Generator;
15
16
if (!class_exists(PathGenerator::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\PHPCRGenerator class is deprecated since sonata/media-bundle 3.4 and will be removed in 4.0.'
19
        .' Use \Sonata\MediaBundle\Generator\PathGenerator instead.',
20
        __NAMESPACE__
21
    ), E_USER_DEPRECATED);
22
}
23
24
class_alias(PathGenerator::class, PHPCRGenerator::class);
25
26
if (false) {
27
    /**
28
     * @deprecated 3.4 Use Sonata\MediaBundle\Generator\PathGenerator
29
     */
30
    class PHPCRGenerator extends PathGenerator implements GeneratorInterface
31
    {
32
    }
33
}
34