Skip to content
This repository was archived by the owner on Oct 26, 2024. It is now read-only.

Commit a8fdb46

Browse files
committed
Dropping php 5.3 support, removing old array syntax
1 parent a8b2418 commit a8fdb46

File tree

15 files changed

+61
-62
lines changed

15 files changed

+61
-62
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- 5.3
54
- 5.4
65
- 5.5
76
- 7

Config/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ final class Config
2020
/**
2121
* @var array
2222
*/
23-
private static $whitelist = array(
23+
private static $whitelist = [
2424
'ConfigDefault',
2525
'ConfigEnv',
2626
'ConfigTimer',
27-
);
27+
];
2828

2929
/**
3030
* Get object of specific class.

Config/ConfigEnv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private function mergeEnvironments($param)
5757
);
5858

5959
if (!empty($param['env']) && $this->defaultEnv !== $param['env']) {
60-
$toMerge = $config->get($param['env'], array());
60+
$toMerge = $config->get($param['env'], []);
6161
$merged = array_replace_recursive(
6262
$config->get($this->defaultEnv),
6363
$toMerge

Config/ConfigTimer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ public function setConfig($file)
6868
case 'holidays':
6969
foreach ($timers as $timerSubKey => $params) {
7070
foreach ($params as $paramKey => $paramValue) {
71-
$config[$timerKey][$timerSubKey] = array(
71+
$config[$timerKey][$timerSubKey] = [
7272
new \DateTime($paramValue),
7373
new \DateTime($paramValue . ' 23:59:59'),
74-
);
74+
];
7575
}
7676
}
7777
break;
7878
case 'general_holidays':
79-
$tmpConf = array();
79+
$tmpConf = [];
8080
$year = date('Y');
8181
// get server's easter date for later calculation
8282
$easterDate = new \DateTime(date('Y-m-d', easter_date($year)));

Data/Data.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Data implements DataInterface
2323
*
2424
* @var array
2525
*/
26-
private $data = array();
26+
private $data = [];
2727

2828
/**
2929
* Clears the data(!) content of the object.
@@ -32,7 +32,7 @@ class Data implements DataInterface
3232
*/
3333
public function clear()
3434
{
35-
$this->data = array();
35+
$this->data = [];
3636

3737
return $this;
3838
}
@@ -57,9 +57,9 @@ public function set()
5757
// iterate arguments reversed to build replacement array
5858
foreach (array_reverse($args) as $key) {
5959
if (null == $replace) {
60-
$replace = array($key => $val);
60+
$replace = [$key => $val];
6161
} else {
62-
$replace = array($key => $replace);
62+
$replace = [$key => $replace];
6363
}
6464
}
6565

Data/DataCollection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function rewind()
101101
public function addItem($item, $position = null)
102102
{
103103
if (null === $position) {
104-
$items = $this->get('items', array());
104+
$items = $this->get('items', []);
105105
array_push($items, $item);
106106
$this->set('items', $items);
107107
} else {
@@ -127,7 +127,7 @@ public function getItem($position = 0)
127127
*/
128128
public function count()
129129
{
130-
return count($this->get('items', array()));
130+
return count($this->get('items', []));
131131
}
132132

133133
/**
@@ -139,7 +139,7 @@ public function count()
139139
*/
140140
public function removeItem($position)
141141
{
142-
$items = $this->get('items', array());
142+
$items = $this->get('items', []);
143143

144144
if (isset($items[$position])) {
145145
unset($items[$position]);

Tests/Config/ConfigDefaultTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ class ConfigDefaultTest extends \PHPUnit_Framework_TestCase
2828
public function testFactory()
2929
{
3030
$config = Config::factory(
31-
array(
31+
[
3232
'file' => TestData::getYamlConfigFile(),
3333
'filecheck' => false,
34-
),
34+
],
3535
'ConfigDefault'
3636
);
3737

Tests/Config/ConfigEnvTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public function testFactoryProd()
3030
{
3131
// merged environments config
3232
$config = Config::factory(
33-
array(
33+
[
3434
'file' => TestData::getYamlConfigFile(),
3535
'filecheck' => false,
36-
),
36+
],
3737
'ConfigEnv'
3838
);
3939

@@ -49,12 +49,12 @@ public function testFactoryProd()
4949
public function testFactoryEnv()
5050
{
5151
$config = Config::factory(
52-
array(
52+
[
5353
'file' => TestData::getYamlConfigFile(),
5454
'filecheck' => false,
5555
'defaultEnv' => 'prod',
5656
'env' => 'dev',
57-
),
57+
],
5858
'ConfigEnv'
5959
);
6060

Tests/Config/ConfigFactoryTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class ConfigFactoryTest extends \PHPUnit_Framework_TestCase
2626
public function testFactory()
2727
{
2828
$config = Config::factory(
29-
array(
29+
[
3030
'file' => TestData::getYamlConfigFile(),
3131
'filecheck' => false,
32-
),
32+
],
3333
'ConfigDefault'
3434
);
3535

@@ -43,10 +43,10 @@ public function testFactory()
4343
public function testFactoryErrorException()
4444
{
4545
$config = Config::factory(
46-
array(
46+
[
4747
'file' => TestData::getYamlConfigFile(),
4848
'filecheck' => false,
49-
),
49+
],
5050
'ConfigXXX'
5151
);
5252
}
@@ -58,7 +58,7 @@ public function testFactoryErrorException()
5858
public function testFactoryInvalidArgumentException()
5959
{
6060
$config = Config::factory(
61-
array(),
61+
[],
6262
'ConfigDefault'
6363
);
6464
}

Tests/Config/ConfigTimerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class ConfigTimerTest extends \PHPUnit_Framework_TestCase
2222
public function testFactory()
2323
{
2424
$config = Config::factory(
25-
array(
25+
[
2626
'file' => TestData::getYamlTimerConfigFile(),
2727
'filecheck' => false,
28-
),
28+
],
2929
'ConfigTimer'
3030
);
3131

0 commit comments

Comments
 (0)