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

LastRecalculation::setVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
cc 1
nc 1
nop 1
rs 10
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
}