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

Commit e5f0127

Browse files
committed
Documentation cleanup, exception message cleanup
1 parent 7db92e2 commit e5f0127

File tree

5 files changed

+40
-30
lines changed

5 files changed

+40
-30
lines changed

Config/Config.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class Config
2727
);
2828

2929
/**
30-
* get object of specific class
30+
* Get object of specific class.
3131
*
3232
* @param array $param config file name
3333
* @param string $class name of class without
@@ -45,17 +45,22 @@ public static function factory(array $param, $class = 'ConfigDefault')
4545

4646
// allow config names without ending
4747
if (empty($param['file'])) {
48-
throw new \InvalidArgumentException('config filename missing in param array!');
48+
throw new \InvalidArgumentException(
49+
'Config::factory() - config filename missing in param array!'
50+
);
4951
}
5052

5153
return new $class($param);
5254
} else {
53-
throw new \ErrorException('could not instantiate ' . $class . ' - not in self::$whitelist');
55+
throw new \ErrorException(
56+
'Config::factory() - could not instantiate ' .
57+
$class . ' - not in self::$whitelist'
58+
);
5459
}
5560
}
5661

5762
/**
58-
* fordbid instantiation
63+
* Fordbid instantiation.
5964
*
6065
* @codeCoverageIgnore
6166
*/
@@ -64,7 +69,7 @@ private function __construct()
6469
}
6570

6671
/**
67-
* forbid cloning
72+
* Forbid cloning.
6873
*
6974
* @codeCoverageIgnore
7075
*/

Config/ConfigAbstract.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class ConfigAbstract extends Data
2929
protected $filecheck = true;
3030

3131
/**
32-
* default constructor
32+
* Default constructor.
3333
*
3434
* @param array $param
3535
*/
@@ -43,8 +43,8 @@ public function __construct(array $param)
4343
}
4444

4545
/**
46-
* add named property to config object
47-
* and insert config as array
46+
* Add named property to config object
47+
* and insert config as array.
4848
*
4949
* @param string $name name of property
5050
* @param string $file string $file absolute filepath/filename.ending
@@ -55,22 +55,24 @@ public function addConfig($name, $file)
5555
}
5656

5757
/**
58-
* read config file via YAML parser
58+
* Read config file via YAML parser.
5959
*
6060
* @param string $file absolute filepath/filename.ending
61-
* @return array config array
61+
* @return array config array
6262
*/
6363
public function readConfig($file)
6464
{
6565
if ($this->filecheck && !is_file($file)) {
66-
throw new \InvalidArgumentException('Given config file ' . $file . ' does not exist!');
66+
throw new \InvalidArgumentException(
67+
'Config::Abstract() - Given config file ' . $file . ' does not exist!'
68+
);
6769
}
6870

6971
return Yaml::parse($file);
7072
}
7173

7274
/**
73-
* add config to data storage
75+
* Add config to data storage.
7476
*
7577
* @param string $file absolute filepath/filename.ending
7678
*/

Config/ConfigEnv.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ConfigEnv extends ConfigAbstract implements ConfigInterface
2525
private $defaultEnv = 'prod';
2626

2727
/**
28-
* default constructor
28+
* Default constructor.
2929
*
3030
* @param array $param
3131
*/
@@ -43,8 +43,9 @@ public function __construct(array $param)
4343
}
4444

4545
/**
46-
* merge environments based on defaults array
47-
* merge order is prod -> lesser environment
46+
* Merge environments based on defaults array.
47+
*
48+
* Merge order is prod -> lesser environment.
4849
*
4950
* @param array $param
5051
*/

Config/ConfigInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@ interface ConfigInterface extends DataInterface
2323
{
2424
/**
2525
* Add named property to config object
26-
* and insert config as array
26+
* and insert config as array.
2727
*
2828
* @param string $name name of property
2929
* @param string $file string $file absolute filepath/filename.ending
3030
*/
3131
public function addconfig($name, $file);
3232

3333
/**
34-
* add config to data storage
34+
* Add config to data storage.
3535
*
3636
* @param string $file absolute filepath/filename.ending
3737
*/
3838
public function setConfig($file);
3939

4040
/**
41-
* read config file via YAML parser
41+
* Read config file via YAML parser.
4242
*
4343
* @param string $file absolute filepath/filename.ending
4444
* @return array config array

Tests/Data/DataTest.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public function testSetException(Data $data)
8181
*
8282
* @depends testSet
8383
* @covers \Asm\Data\Data::get
84+
* @covers \Asm\Data\Data::searchArray
8485
* @param Data $data
8586
* @return Data
8687
*/
@@ -160,13 +161,13 @@ public function testSetByArrayException(Data $data)
160161

161162
/**
162163
* @depends testConstruct
163-
* @covers \Asm\Data\Data::setByObject
164+
* @covers \Asm\Data\Data::setByObject
164165
* @param Data $data
165166
* @return Data
166167
*/
167168
public function testSetByObject(Data $data)
168169
{
169-
$objParam = new \stdClass();
170+
$objParam = new \stdClass();
170171
$objParam->testProperty1 = 'test_property_value_1';
171172
$objParam->testProperty2 = 'test_property_value_2';
172173
$objParam->testProperty3 = array('subkeyPropertyTest' => 'property_value');
@@ -202,7 +203,7 @@ public function testSetByObjectException(Data $data)
202203

203204
/**
204205
* @depends testConstruct
205-
* @covers \Asm\Data\Data::setByJson
206+
* @covers \Asm\Data\Data::setByJson
206207
* @param Data $data
207208
* @return Data
208209
*/
@@ -227,7 +228,7 @@ public function testSetByJson(Data $data)
227228

228229
/**
229230
* @depends testSetByArray
230-
* @covers \Asm\Data\Data::getKeys
231+
* @covers \Asm\Data\Data::getKeys
231232
* @param Data $data
232233
*/
233234
public function testGetKeys(Data $data)
@@ -239,7 +240,7 @@ public function testGetKeys(Data $data)
239240

240241
/**
241242
* @depends testSetByArray
242-
* @covers \Asm\Data\Data::remove
243+
* @covers \Asm\Data\Data::remove
243244
* @param Data $data
244245
*/
245246
public function testRemove(Data $data)
@@ -252,7 +253,7 @@ public function testRemove(Data $data)
252253

253254
/**
254255
* @depends testSetByArray
255-
* @covers \Asm\Data\Data::toArray
256+
* @covers \Asm\Data\Data::toArray
256257
* @param Data $data
257258
*/
258259
public function testToArray(Data $data)
@@ -263,7 +264,7 @@ public function testToArray(Data $data)
263264

264265
/**
265266
* @depends testSetByArray
266-
* @covers \Asm\Data\Data::toJson
267+
* @covers \Asm\Data\Data::toJson
267268
* @param Data $data
268269
*/
269270
public function testToJson(Data $data)
@@ -276,7 +277,7 @@ public function testToJson(Data $data)
276277

277278
/**
278279
* @depends testSetByArray
279-
* @covers \Asm\Data\Data::count
280+
* @covers \Asm\Data\Data::count
280281
* @param Data $data
281282
*/
282283
public function testCount(Data $data)
@@ -287,7 +288,8 @@ public function testCount(Data $data)
287288

288289
/**
289290
* @depends testSetByArray
290-
* @covers \Asm\Data\Data::findInArray
291+
* @covers \Asm\Data\Data::findInArray
292+
* @covers \Asm\Data\Data::searchArray
291293
* @param Data $data
292294
*/
293295
public function testFindInArray(Data $data)
@@ -310,9 +312,9 @@ public function testNormalize()
310312

311313
/**
312314
* @depends testSetByArray
313-
* @covers \Asm\Data\Data::setByArray
314-
* @covers \Asm\Data\Data::clear
315-
* @covers \Asm\Data\Data::toArray
315+
* @covers \Asm\Data\Data::setByArray
316+
* @covers \Asm\Data\Data::clear
317+
* @covers \Asm\Data\Data::toArray
316318
* @param Data $data
317319
*/
318320
public function testClear(Data $data)

0 commit comments

Comments
 (0)