| 1 | <?php |
||
| 14 | class Version |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * The major version number. |
||
| 18 | * |
||
| 19 | * @var int |
||
| 20 | */ |
||
| 21 | protected $major = 0; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * The minor version number. |
||
| 25 | * |
||
| 26 | * @var int |
||
| 27 | */ |
||
| 28 | protected $minor = 0; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The patch number. |
||
| 32 | * |
||
| 33 | * @var int |
||
| 34 | */ |
||
| 35 | protected $patch = 0; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * The pre-release version number. |
||
| 39 | * |
||
| 40 | * @var array |
||
| 41 | */ |
||
| 42 | protected $preRelease = []; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * The build metadata identifiers. |
||
| 46 | * |
||
| 47 | * @var array |
||
| 48 | */ |
||
| 49 | protected $buildMetadata = []; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get major. |
||
| 53 | * |
||
| 54 | * @return int |
||
| 55 | */ |
||
| 56 | 8 | public function getMajor() |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Get minor. |
||
| 63 | * |
||
| 64 | * @return int |
||
| 65 | */ |
||
| 66 | 8 | public function getMinor() |
|
| 70 | |||
| 71 | /** |
||
| 72 | * Get patch. |
||
| 73 | * |
||
| 74 | * @return int |
||
| 75 | */ |
||
| 76 | 8 | public function getPatch() |
|
| 80 | |||
| 81 | /** |
||
| 82 | * Get preRelease. |
||
| 83 | * |
||
| 84 | * @return array |
||
| 85 | */ |
||
| 86 | 6 | public function getPreRelease() |
|
| 90 | |||
| 91 | /** |
||
| 92 | * Get buildMetadata. |
||
| 93 | * |
||
| 94 | * @return array |
||
| 95 | */ |
||
| 96 | public function getBuildMetadata() |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Map the given array onto the version's properties. |
||
| 103 | * |
||
| 104 | * @param array $attributes |
||
| 105 | * |
||
| 106 | * @return $this |
||
| 107 | */ |
||
| 108 | 8 | public function map(array $attributes) |
|
| 116 | |||
| 117 | /** |
||
| 118 | * Checks if the version number is stable. |
||
| 119 | * |
||
| 120 | * @return bool |
||
| 121 | */ |
||
| 122 | public function isStable() |
||
| 126 | } |
||
| 127 |