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

ExportAssociationField   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 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\AssociationFieldInterface;
9
use Neimheadh\SonataAnnotationBundle\Annotation\AssociationFieldTrait;
10
11
/**
12
 * Export association field annotation.
13
 *
14
 * Allow you to configure the export for the annotated field having an
15
 * association field..
16
 *
17
 * @Annotation
18
 * @Target({"PROPERTY"})
19
 *
20
 * @author Marko Kunic <[email protected]>
21
 * @author Mathieu Wambre <[email protected]>
22
 */
23
#[Attribute(Attribute::TARGET_PROPERTY)]
24
final class ExportAssociationField extends ExportField implements
25
    AssociationFieldInterface
26
{
27
28
    use AssociationFieldTrait;
29
30
    /**
31
     * {@inheritDoc}
32
     *
33
     * @param string|null $field Field name.
34
     */
35
    public function __construct(
36
        $label = null,
37
        string $field = null
38
    ) {
39
        $this->field = $field;
40
        parent::__construct($label);
41
    }
42
43
}
44