OptimisticLockTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEditVersion() 0 4 1
A setEditVersion() 0 6 1
1
<?php
2
/*
3
 * This file is part of the StfalconApiBundle.
4
 *
5
 * (c) Stfalcon LLC <stfalcon.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace StfalconStudio\ApiBundle\DTO;
14
15
use Symfony\Component\Validator\Constraints as Assert;
16
17
/**
18
 * OptimisticLockTrait.
19
 */
20
trait OptimisticLockTrait
21
{
22
    /**
23
     * @var int
24
     *
25
     * @Assert\NotBlank()
26
     * @Assert\Type("int")
27
     * @Assert\GreaterThan(0)
28
     */
29
    private $editVersion;
30
31
    /**
32
     * @return int
33
     */
34
    public function getEditVersion(): int
35
    {
36
        return $this->editVersion;
37
    }
38
39
    /**
40
     * @param int $editVersion
41
     *
42
     * @return self
43
     */
44
    public function setEditVersion(int $editVersion): self
45
    {
46
        $this->editVersion = $editVersion;
47
48
        return $this;
49
    }
50
}
51