Completed
Push — master ( 57b1db...16daf9 )
by Mike
03:22
created

Metadata   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 65
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getVersion() 0 4 1
A getFlav() 0 4 1
A getSource() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace Sugarcrm\UpgradeSpec\Context;
4
5
use Sugarcrm\UpgradeSpec\Version\Version;
6
7
class Metadata
8
{
9
    /**
10
     * @var string
11
     */
12
    private $version;
13
14
    /**
15
     * @var string
16
     */
17
    private $flav;
18
19
    /**
20
     * @var string
21
     */
22
    private $source;
23
24
    /**
25
     * Metadata constructor.
26
     *
27
     * @param $version
28
     * @param $flav
29
     * @param string $source
30
     */
31
    public function __construct(Version $version, $flav, $source)
32
    {
33
        $this->version = $version;
0 ignored issues
show
Documentation Bug introduced by
It seems like $version of type object<Sugarcrm\UpgradeSpec\Version\Version> is incompatible with the declared type string of property $version.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
34
        $this->flav = $flav;
35
        $this->source = $source;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getVersion()
42
    {
43
        return $this->version;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getFlav()
50
    {
51
        return $this->flav;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getSource()
58
    {
59
        return $this->source;
60
    }
61
62
    /**
63
     * Returns Context string representation.
64
     *
65
     * @return string
66
     */
67
    public function __toString()
68
    {
69
        return sprintf('%s(%s)', $this->version, $this->flav);
70
    }
71
}
72