Skip to content

Commit 5b3150c

Browse files
author
Jonathan Gaillard
committed
Merge pull request #13 from nubs/php-54
Change array syntax to PHP 5.4 syntax.
2 parents ade0c6f + e865b07 commit 5b3150c

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

build.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
require 'vendor/autoload.php';
1212

1313
$phpcsCLI = new PHP_CodeSniffer_CLI();
14-
$phpcsArguments = array('standard' => array('PSR1'), 'files' => array('src', 'tests', 'build.php'), 'warningSeverity' => 0);
14+
$phpcsArguments = ['standard' => ['PSR1'], 'files' => ['src', 'tests', 'build.php'], 'warningSeverity' => 0];
1515
$phpcsViolations = $phpcsCLI->process($phpcsArguments);
1616
if ($phpcsViolations > 0) {
1717
exit(1);
1818
}
1919

2020
$phpunitConfiguration = PHPUnit_Util_Configuration::getInstance(__DIR__ . '/phpunit.xml');
21-
$phpunitArguments = array('coverageHtml' => __DIR__ . '/coverage', 'configuration' => $phpunitConfiguration);
21+
$phpunitArguments = ['coverageHtml' => __DIR__ . '/coverage', 'configuration' => $phpunitConfiguration];
2222
$testRunner = new PHPUnit_TextUI_TestRunner();
2323
$result = $testRunner->doRun($phpunitConfiguration->getTestSuiteConfiguration(), $phpunitArguments);
2424
if (!$result->wasSuccessful()) {

src/Memory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Memory implements Memoize
1111
*
1212
* @var array
1313
*/
14-
private $_cache = array();
14+
private $_cache = [];
1515

1616
/**
1717
* $cacheTime is ignored - this will keep the results around for the lifetime of this instance.

src/Predis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function memoizeCallable($key, $compute, $cacheTime = null)
4444

4545
$result = call_user_func($compute);
4646

47-
$this->_cache($key, json_encode(array('result' => $result)), $cacheTime);
47+
$this->_cache($key, json_encode(['result' => $result]), $cacheTime);
4848

4949
return $result;
5050
}

tests/PredisTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function memoizeCallableWithCachedValue()
1717
$count = 0;
1818
$key = 'foo';
1919
$value = 'bar';
20-
$cachedValue = json_encode(array('result' => $value));
20+
$cachedValue = json_encode(['result' => $value]);
2121
$compute = function() use(&$count, $value) {
2222
$count++;
2323

@@ -69,7 +69,7 @@ public function memoizeCallableWithUncachedKey()
6969
$count = 0;
7070
$key = 'foo';
7171
$value = 'bar';
72-
$cachedValue = json_encode(array('result' => $value));
72+
$cachedValue = json_encode(['result' => $value]);
7373
$cacheTime = 1234;
7474
$compute = function() use(&$count, $value) {
7575
$count++;
@@ -98,7 +98,7 @@ public function memoizeCallableWithUncachedKeyWithExceptionOnSet()
9898
$count = 0;
9999
$key = 'foo';
100100
$value = 'bar';
101-
$cachedValue = json_encode(array('result' => $value));
101+
$cachedValue = json_encode(['result' => $value]);
102102
$compute = function() use(&$count, $value) {
103103
$count++;
104104

@@ -118,6 +118,6 @@ public function memoizeCallableWithUncachedKeyWithExceptionOnSet()
118118

119119
private function _getPredisMock()
120120
{
121-
return $this->getMock('\Predis\Client', array('get', 'set', 'expire'));
121+
return $this->getMock('\Predis\Client', ['get', 'set', 'expire']);
122122
}
123123
}

0 commit comments

Comments
 (0)