Completed
Pull Request — master (#6194)
by Vincent
05:04
created

Exporter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 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\AdminBundle\Export;
15
16
use Sonata\CoreBundle\Exporter\Exporter as CoreExporter;
17
use Sonata\Exporter\Exporter as BaseExporter;
18
19
if (class_exists(CoreExporter::class)) {
20
    /**
21
     * NEXT_MAJOR: remove this class.
22
     *
23
     * @deprecated since sonata-project/admin-bundle 3.14, to be removed in 4.0.
24
     */
25
    class Exporter extends CoreExporter
26
    {
27
        public function __construct()
28
        {
29
            @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...
30
                'The %s\Exporter class is deprecated since version 3.14 and will be removed in 4.0.'
31
                .' Use \Sonata\Exporter\Exporter instead',
32
                __NAMESPACE__
33
            ), E_USER_DEPRECATED);
34
        }
35
    }
36
} else {
37
    class_alias(
38
        BaseExporter::class,
39
        __NAMESPACE__.'\Exporter'
40
    );
41
}
42