Skip to content
This repository was archived by the owner on Dec 6, 2019. It is now read-only.

Commit 6ab7966

Browse files
author
Nabeel Shahzad
committed
fix array short syntax for php 5.3
1 parent 9df97c5 commit 6ab7966

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
#
3+
#
4+
5+
.PHONY: install-cs
6+
install-cs:
7+
composer global require "squizlabs/php_codesniffer=*"
8+
composer global require "wimg/php-compatibility=*"
9+
phpcs --config-set installed_paths ~/.composer/vendor/wimg/php-compatibility
10+
11+
.PHONY: run-cs
12+
run-cs-53:
13+
phpcs -p . --standard=PHPCompatibility --warning-severity=0 --runtime-set testVersion 5.3
14+
15+
run-cs-70:
16+
phpcs -p . --standard=PHPCompatibility --warning-severity=0 --runtime-set testVersion 7.0-

core/classes/CodonData.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ public function firephp()
6262
include_once CORE_PATH.DS.'lib'.DS.'firebug'.DS.'FirePHP.class.php';
6363

6464
$instance = FirePHP::getInstance(true);
65-
return call_user_func_array([$instance, 'fb'], func_get_args());
65+
return call_user_func_array(array($instance, 'fb'), func_get_args());
6666
}
6767
}

core/classes/CodonWebService.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
class CodonWebService
4141
{
4242

43-
public $options = [];
44-
public $errors = [];
43+
public $options = array();
44+
public $errors = array();
4545

4646
protected $type = 'curl';
4747
protected $curl = null;
@@ -61,14 +61,14 @@ public function __construct()
6161
}
6262

6363
$this->setType('curl');
64-
$this->setOptions([
64+
$this->setOptions(array(
6565
CURLOPT_FOLLOWLOCATION => true,
6666
CURLOPT_RETURNTRANSFER => true,
6767
CURLOPT_AUTOREFERER => true,
6868
CURLOPT_CONNECTTIMEOUT => 30,
6969
CURLOPT_HEADER => false,
7070
CURLOPT_FOLLOWLOCATION => true,
71-
]);
71+
));
7272
}
7373

7474
public function __destruct()
@@ -146,7 +146,7 @@ public function getSSL($url, $params, $type = 'get')
146146
* @param array $params Associative array of key=value
147147
* @return string
148148
*/
149-
public function get($url, $params = [])
149+
public function get($url, $params = array())
150150
{
151151
# Builds the parameters list
152152
if (is_array($params)) {
@@ -182,7 +182,7 @@ public function get($url, $params = [])
182182
* @param array $params Associative array of key=value
183183
* @return bool
184184
*/
185-
public function post($url, $params = [])
185+
public function post($url, $params = array())
186186
{
187187
if (!$this->curl) {
188188
$this->error('cURL not initialized');

install/Installer.class.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static function CheckServer()
2525
{
2626
$noerror = true;
2727
$version = phpversion();
28-
$wf = [];
28+
$wf = array();
2929

3030
// These needa be writable
3131
$wf[] = 'core/pages';
@@ -217,20 +217,20 @@ public static function SiteSetup()
217217
}
218218

219219
// Add an initial airport/hub, because I love KJFK so much
220-
$data = [
220+
$data = array(
221221
'icao' => 'KJFK',
222222
'name' => 'Kennedy International',
223223
'country' => 'USA',
224224
'lat' => '40.6398',
225225
'lng' => '-73.7787',
226226
'hub' => false,
227227
'fuelprice' => 0,
228-
];
228+
);
229229

230230
$ret = OperationsData::AddAirport($data);
231231

232232
// Add the user
233-
$data = [
233+
$data = array(
234234
'firstname' => $_POST['firstname'],
235235
'lastname' => $_POST['lastname'],
236236
'email' => $_POST['email'],
@@ -240,11 +240,10 @@ public static function SiteSetup()
240240
'location' => 'US',
241241
'hub' => 'KJFK',
242242
'confirm' => true,
243-
];
243+
);
244244

245245
if (!RegistrationData::AddUser($data)) {
246246
self::$error = DB::$error;
247-
248247
return false;
249248
}
250249

0 commit comments

Comments
 (0)