Skip to content

Commit 0135934

Browse files
committed
Merge pull request #3 from nikkiii/master
Reformat SteamID class and change tabs to spaces in composer.json
2 parents a3185cc + a76050b commit 0135934

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"name": "Alexander Corn",
1212
"email": "[email protected]"
1313
},
14-
{
15-
"name": "Nikki",
16-
"email": "[email protected]"
17-
}
14+
{
15+
"name": "Nikki",
16+
"email": "[email protected]"
17+
}
1818
],
19-
"autoload": {
20-
"psr-4": {
21-
"SteamID\\": "src/"
22-
}
23-
}
19+
"autoload": {
20+
"psr-4": {
21+
"SteamID\\": "src/"
22+
}
23+
}
2424
}

src/SteamID.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ public function __construct($id = null) {
9999
if ($matches[1] <= self::UNIVERSE_PUBLIC) {
100100
$this->universe = self::UNIVERSE_PUBLIC;
101101
} else {
102-
$this->universe = (int)$matches[1];
102+
$this->universe = (int) $matches[1];
103103
}
104104

105105
$this->type = self::TYPE_INDIVIDUAL;
106106
$this->instance = self::INSTANCE_DESKTOP;
107-
$this->accountid = (int)($matches[3] * 2) + $matches[2];
107+
$this->accountid = (int) ($matches[3] * 2) + $matches[2];
108108
} elseif (preg_match('/^\\[([a-zA-Z]):([0-5]):([0-9]+)(:[0-9]+)?\\]$/', $id, $matches)) {
109109
// Steam3 ID
110-
$this->universe = (int)$matches[2];
111-
$this->accountid = (int)$matches[3];
110+
$this->universe = (int) $matches[2];
111+
$this->accountid = (int) $matches[3];
112112

113113
$type_char = $matches[1];
114114

115115
if (!empty($matches[4])) {
116-
$this->instance = (int)substr($matches[4], 1);
116+
$this->instance = (int) substr($matches[4], 1);
117117
} else {
118118
switch ($type_char) {
119119
case 'g':
@@ -144,10 +144,10 @@ public function __construct($id = null) {
144144
if (PHP_INT_SIZE == 4) {
145145
// Wrapper for BigInteger
146146
$bigint = new Math_BigInteger($id);
147-
$this->universe = (int)$bigint->bitwise_rightShift(56)->toString();
148-
$this->type = ((int)$bigint->bitwise_rightShift(52)->toString()) & 0xF;
149-
$this->instance = ((int)$bigint->bitwise_rightShift(32)->toString()) & 0xFFFFF;
150-
$this->accountid = (int)$bigint->bitwise_and(new Math_BigInteger('0xFFFFFFFF', 16))->toString();
147+
$this->universe = (int) $bigint->bitwise_rightShift(56)->toString();
148+
$this->type = ((int) $bigint->bitwise_rightShift(52)->toString()) & 0xF;
149+
$this->instance = ((int) $bigint->bitwise_rightShift(32)->toString()) & 0xFFFFF;
150+
$this->accountid = (int) $bigint->bitwise_and(new Math_BigInteger('0xFFFFFFFF', 16))->toString();
151151
} else {
152152
$this->universe = $id >> 56;
153153
$this->type = ($id >> 52) & 0xF;
@@ -243,7 +243,7 @@ public function getSteamID64() {
243243
* @return string
244244
*/
245245
public function __toString() {
246-
return (string)$this->getSteamID64();
246+
return $this->getSteamID64();
247247
}
248248

249249
/**

0 commit comments

Comments
 (0)