Skip to content

Commit a61c4c1

Browse files
committed
[#.0.x] - fixed getSpecial() for stable version
1 parent 5b3df77 commit a61c4c1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

phalcon/Support/Version.zep

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Version
8585
*/
8686
protected final function getSpecial(int special) -> string
8787
{
88-
string suffix = "";
88+
var suffix;
8989

9090
switch special {
9191
case 1:
@@ -97,6 +97,9 @@ class Version
9797
case 3:
9898
let suffix = "RC";
9999
break;
100+
default:
101+
let suffix = "";
102+
break;
100103
}
101104

102105
return suffix;

tests/unit/Support/Version/GetPartCest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ public function supportVersionGetPart(UnitTester $I)
5757
$actual = $version->getPart(Version::VERSION_MINOR);
5858
$I->assertSame($expected, $actual);
5959

60-
$expected = $this->numberToSpecial($id[5]);
60+
$expected = $this->numberToSpecial((string) $id[5]);
6161
$actual = $version->getPart(Version::VERSION_SPECIAL);
6262
$I->assertSame($expected, $actual);
6363

64-
$special = $this->numberToSpecial($id[5]);
64+
$special = $this->numberToSpecial((string) $id[6]);
6565
$expected = (string) (($special) ? $id[6] : 0);
6666
$actual = $version->getPart(Version::VERSION_SPECIAL_NUMBER);
6767
$I->assertSame($expected, $actual);

0 commit comments

Comments
 (0)