Completed
Push — master ( 8253ba...a023d2 )
by Daniel
16:49 queued 05:23
created

FeatureStacked::createItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Component\Feature\Stacked;
4
5
use ApiPlatform\Core\Annotation\ApiResource;
6
use Doctrine\ORM\Mapping as ORM;
7
use Silverback\ApiComponentBundle\Entity\Component\Feature\AbstractFeature;
8
use Silverback\ApiComponentBundle\Entity\Component\Feature\FeatureItemInterface;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
11
/**
12
 * Class FeatureStacked
13
 * @package Silverback\ApiComponentBundle\Entity\Component\FeatureMedia
14
 * @author Daniel West <[email protected]>
15
 * @ApiResource(shortName="component/feature_stacked")
16
 * @ORM\Entity()
17
 */
18
class FeatureStacked extends AbstractFeature
19
{
20
    /**
21
     * @Groups({"component", "content"})
22
     * @var bool
23
     */
24
    protected $reverse = false;
25
26
    /**
27
     * @return FeatureItemInterface
28
     */
29
    public function createItem(): FeatureItemInterface
30
    {
31
        return new FeatureStackedItem();
32
    }
33
34
    /**
35
     * @return bool
36
     */
37
    public function isReverse(): bool
38
    {
39
        return $this->reverse;
40
    }
41
42
    /**
43
     * @param bool $reverse
44
     */
45
    public function setReverse(bool $reverse): void
46
    {
47
        $this->reverse = $reverse;
48
    }
49
}
50