Skip to content

Commit 4b7486a

Browse files
author
Larry Lewis
committed
As requested set to spaces rather han tabs
1 parent 784531b commit 4b7486a

File tree

1 file changed

+97
-97
lines changed

1 file changed

+97
-97
lines changed

src/Version/Stability.php

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -7,109 +7,109 @@
77
class Stability
88
{
99

10-
const REGEX = '[-|_|\.]{0,1}([R|r][C|c]|pl|a|alpha|[B|b][E|e][T|t][A|a]|b|B|patch|stable|p)\.{0,1}(\d*)';
10+
const REGEX = '[-|_|\.]{0,1}([R|r][C|c]|pl|a|alpha|[B|b][E|e][T|t][A|a]|b|B|patch|stable|p)\.{0,1}(\d*)';
1111

12-
/**
13-
* @var string
14-
*/
15-
private $stability;
12+
/**
13+
* @var string
14+
*/
15+
private $stability;
1616

17-
/**
18-
* @var int
19-
*/
20-
private $number;
17+
/**
18+
* @var int
19+
*/
20+
private $number;
2121

22-
public function __construct( $stability = 'stable', $number = null )
23-
{
24-
if( strlen( $stability ) == 0 )
25-
{
26-
$stability = 'stable';
27-
}
28-
$stability = strtolower( $stability );
29-
switch( $stability )
30-
{
31-
case 'rc':
32-
$stability = 'RC';
33-
break;
34-
case 'patch':
35-
case 'pl':
36-
case 'p':
37-
$stability = 'patch';
38-
break;
39-
case 'beta':
40-
case 'b':
41-
$stability = 'beta';
42-
break;
43-
case 'alpha':
44-
case 'a':
45-
$stability = 'alpha';
46-
break;
47-
case 'dev':
48-
case 'd':
49-
$stability = 'dev';
50-
break;
51-
}
52-
$this->stability = $stability;
53-
$this->number = $number;
54-
}
22+
public function __construct( $stability = 'stable', $number = null )
23+
{
24+
if( strlen( $stability ) == 0 )
25+
{
26+
$stability = 'stable';
27+
}
28+
$stability = strtolower( $stability );
29+
switch( $stability )
30+
{
31+
case 'rc':
32+
$stability = 'RC';
33+
break;
34+
case 'patch':
35+
case 'pl':
36+
case 'p':
37+
$stability = 'patch';
38+
break;
39+
case 'beta':
40+
case 'b':
41+
$stability = 'beta';
42+
break;
43+
case 'alpha':
44+
case 'a':
45+
$stability = 'alpha';
46+
break;
47+
case 'dev':
48+
case 'd':
49+
$stability = 'dev';
50+
break;
51+
}
52+
$this->stability = $stability;
53+
$this->number = $number;
54+
}
5555

56-
public function __toString()
57-
{
58-
return $this->stability . $this->number;
59-
}
56+
public function __toString()
57+
{
58+
return $this->stability . $this->number;
59+
}
6060

61-
public function isStable()
62-
{
63-
return $this->stability == 'stable';
64-
}
61+
public function isStable()
62+
{
63+
return $this->stability == 'stable';
64+
}
6565

66-
/**
67-
* @return string
68-
*/
69-
public function getStability()
70-
{
71-
return $this->stability;
72-
}
66+
/**
67+
* @return string
68+
*/
69+
public function getStability()
70+
{
71+
return $this->stability;
72+
}
7373

74-
public function compare( Stability $stability )
75-
{
76-
if( $this->toInt( $this->stability ) > $this->toInt( $stability->stability ) )
77-
{
78-
return 1;
79-
}
80-
if( $this->toInt( $this->stability ) < $this->toInt( $stability->stability ) )
81-
{
82-
return -1;
83-
}
84-
if( $this->number > $stability->number )
85-
{
86-
return 1;
87-
}
88-
if( $this->number < $stability->number )
89-
{
90-
return -1;
91-
}
92-
return 0;
93-
}
74+
public function compare( Stability $stability )
75+
{
76+
if( $this->toInt( $this->stability ) > $this->toInt( $stability->stability ) )
77+
{
78+
return 1;
79+
}
80+
if( $this->toInt( $this->stability ) < $this->toInt( $stability->stability ) )
81+
{
82+
return -1;
83+
}
84+
if( $this->number > $stability->number )
85+
{
86+
return 1;
87+
}
88+
if( $this->number < $stability->number )
89+
{
90+
return -1;
91+
}
92+
return 0;
93+
}
9494

95-
private function toInt( $stability )
96-
{
97-
switch( $stability )
98-
{
99-
case 'dev':
100-
return 1;
101-
case 'alpha':
102-
return 2;
103-
case 'beta':
104-
return 3;
105-
case 'RC':
106-
return 4;
107-
case 'stable':
108-
return 5;
109-
case 'patch':
110-
return 6;
111-
default:
112-
throw new InvalidArgumentException( 'Invalid stability: ' . $stability );
113-
}
114-
}
95+
private function toInt( $stability )
96+
{
97+
switch( $stability )
98+
{
99+
case 'dev':
100+
return 1;
101+
case 'alpha':
102+
return 2;
103+
case 'beta':
104+
return 3;
105+
case 'RC':
106+
return 4;
107+
case 'stable':
108+
return 5;
109+
case 'patch':
110+
return 6;
111+
default:
112+
throw new InvalidArgumentException( 'Invalid stability: ' . $stability );
113+
}
114+
}
115115
}

0 commit comments

Comments
 (0)