Completed
Push — master ( 898de0...1a66a2 )
by Benedikt
04:39
created

LastRecalculation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 4 1
A setVersion() 0 5 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: benedikt
5
 * Date: 6/28/18
6
 * Time: 2:41 PM
7
 */
8
9
namespace Tfboe\FmLib\Entity\Traits;
10
11
12
use Doctrine\ORM\Mapping as ORM;
13
use Tfboe\FmLib\Entity\Helpers\NumericalId;
14
use Tfboe\FmLib\Entity\Helpers\TimeEntity;
15
16
/**
17
 * Trait LastRecalculation
18
 * @package Tfboe\FmLib\Entity\Traits
19
 */
20
trait LastRecalculation
21
{
22
  use NumericalId;
23
  use TimeEntity;
24
25
//<editor-fold desc="Fields">
26
  /**
27
   * @ORM\Column(type="integer", nullable=false)
28
   * @var int
29
   */
30
  private $version;
31
//</editor-fold desc="Fields">
32
33
//<editor-fold desc="Public Methods">
34
  /**
35
   * @return int
36
   */
37
  public function getVersion(): int
38
  {
39
    return $this->version;
40
  }
41
42
  /**
43
   * @param int $version
44
   * @return $this|LastRecalculation
0 ignored issues
show
Comprehensibility Bug introduced by
The return type LastRecalculation is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
45
   */
46
  public function setVersion(int $version): LastRecalculation
47
  {
48
    $this->version = $version;
49
    return $this;
50
  }
51
//</editor-fold desc="Public Methods">
52
}