Passed
Push — develop ( 355f63...51016a )
by Mathieu
02:23
created

ExportFormats::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Neimheadh\SonataAnnotationBundle\Annotation\Sonata;
6
7
use Attribute;
8
use Neimheadh\SonataAnnotationBundle\Annotation\AbstractAnnotation;
9
use Neimheadh\SonataAnnotationBundle\Annotation\ArrayAnnotationTrait;
10
use ReflectionException;
11
12
/**
13
 * Export formats annotation.
14
 *
15
 * @Annotation
16
 * @Target("CLASS")
17
 *
18
 * @author Marko Kunic <[email protected]>
19
 * @author Mathieu Wambre <[email protected]>
20
 */
21
#[Attribute(Attribute::TARGET_CLASS)]
22
final class ExportFormats extends AbstractAnnotation
23
{
24
25
    use ArrayAnnotationTrait;
26
27
    /**
28
     * Exported formats.
29
     *
30
     * @var array
31
     */
32
    private array $formats = [];
0 ignored issues
show
introduced by
The private property $formats is not used, and could be removed.
Loading history...
33
34
    /**
35
     * @param array|string|null $formats Exported formats or annotation
36
     *                                   parameters.
37
     *
38
     * @throws ReflectionException
39
     */
40
    public function __construct(
41
        $formats = []
42
    ) {
43
        $this->setArrayProperty('formats', $formats);
44
    }
45
46
}
47