This repository was archived by the owner on Oct 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 15 files changed +61
-62
lines changed
Expand file tree Collapse file tree 15 files changed +61
-62
lines changed Original file line number Diff line number Diff line change 11language : php
22
33php :
4- - 5.3
54 - 5.4
65 - 5.5
76 - 7
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 )));
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ]);
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments