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

Commit 7db92e2

Browse files
committed
Documentation cleanup, return value fix for Data::clear()
1 parent d5454b8 commit 7db92e2

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

Config/ConfigInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
interface ConfigInterface extends DataInterface
2323
{
2424
/**
25-
* add named property to config object
25+
* Add named property to config object
2626
* and insert config as array
2727
*
2828
* @param string $name name of property

Config/ConfigTimer.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
final class ConfigTimer extends ConfigAbstract implements ConfigInterface
1919
{
2020
/**
21-
* convert config date strings to \DateTime objects or \DateIntervals
21+
* Convert config date strings to \DateTime objects or \DateIntervals.
2222
*
2323
* @param string $file config file
2424
*/
@@ -28,20 +28,16 @@ public function setConfig($file)
2828

2929
// iterate conf and check if there are dates/datetimes/times and so on, for conversion
3030
foreach ($config as $timerKey => $timers) {
31-
3231
switch ($timerKey) {
3332
case 'timers':
3433
foreach ($timers as $timerSubKey => $params) {
35-
3634
foreach ($params as $paramKey => $paramVal) {
3735
switch ($paramKey) {
3836
case 'interval':
3937
// check the contents of interval
4038
foreach ($paramVal as $intervalKey => $interval) {
41-
4239
// convert all sub elements
4340
foreach ($interval as $key => $intervalValue) {
44-
4541
// just a date, no time - one element
4642
switch (count($interval)) {
4743
case 1:
@@ -59,21 +55,17 @@ public function setConfig($file)
5955
$data;
6056
break;
6157
}
62-
6358
}
6459
}
6560
break;
6661
default:
6762
break;
6863
}
6964
}
70-
7165
}
72-
7366
break;
7467
case 'holidays':
7568
foreach ($timers as $timerSubKey => $params) {
76-
7769
foreach ($params as $paramKey => $paramValue) {
7870
$config[$timerKey][$timerSubKey] = array(
7971
new \DateTime($paramValue),

Data/Data.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ class Data implements DataInterface
2727

2828
/**
2929
* Clears the data(!) content of the object.
30+
*
31+
* @return $this
3032
*/
3133
public function clear()
3234
{
3335
$this->data = array();
36+
37+
return $this;
3438
}
3539

3640
/**

Data/DataInterface.php

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
interface DataInterface
1919
{
2020
/**
21-
* remove all data from object
21+
* Remove all data from internal array.
22+
*
23+
* @return $this
2224
*/
2325
public function clear();
2426

2527
/**
26-
* generic set method for multidimensional storage
28+
* Generic set method for multidimensional storage.
29+
*
2730
* $this->set( $key1, $key2, $key3, ..., $mixVal )
2831
*
2932
* @throws \InvalidArgumentException
@@ -32,54 +35,58 @@ public function clear();
3235
public function set();
3336

3437
/**
35-
* set list of key/value pairs via one dimensional array
38+
* Add array content by iteration to interal array.
3639
*
37-
* @param array $param
40+
* @param array $param
41+
* @return $this
3842
* @throws \InvalidArgumentException
3943
*/
4044
public function setByArray(array $param);
4145

4246
/**
43-
* adds given object's properties to self
47+
* Adds given object's properties to interal array.
4448
*
45-
* @param object $param
49+
* @param object $param
50+
* @return $this
4651
* @throws \InvalidArgumentException
4752
*/
4853
public function setByObject($param);
4954

5055
/**
51-
* fill datastore by json string
56+
* Fill datastore by json string.
5257
*
5358
* @param string $json
5459
* @return mixed
5560
*/
5661
public function setByJson($json);
5762

5863
/**
59-
* multidimensional getter
60-
* find a key structure in a multidimensional array and return the value
61-
* params are stackable -> get( $k1, $k2, $k3, ... )
64+
* Multidimensional getter.
65+
*
66+
* Find a key structure in a multidimensional array and return the value
67+
* params are stackable -> get( $k1, $k2, $k3, ... ).
6268
*
6369
* @return bool|mixed
6470
*/
6571
public function get();
6672

6773
/**
68-
* remove key from container
74+
* Remove key from internal storage.
6975
*
7076
* @param string $key
77+
* @return $this
7178
*/
7279
public function remove($key);
7380

7481
/**
75-
* gets key index
82+
* Get all firstlevel keys of interal array.
7683
*
7784
* @return array keylist
7885
*/
7986
public function getKeys();
8087

8188
/**
82-
* return count of all firstlevel elements
89+
* Return count of all firstlevel elements.
8390
*
8491
* @return int
8592
*/

0 commit comments

Comments
 (0)