Skip to content

Commit 9e31125

Browse files
author
Steeven Andrian
committed
code comments
1 parent e69a591 commit 9e31125

File tree

9 files changed

+122
-11
lines changed

9 files changed

+122
-11
lines changed

src/DataStructures/SplArrayObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* O2System Standard PHP Libraries ArrayObject
2020
*
21-
* @package O2System\Core\SPL
21+
* @package O2System\Spl\DataStructures
2222
*/
2323
class SplArrayObject extends \ArrayObject
2424
{

src/Info/SplClassInfo.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ public function getParameter()
8686

8787
// ------------------------------------------------------------------------
8888

89+
/**
90+
* SplClassInfo::getReflection
91+
*
92+
* @return \ReflectionClass
93+
* @throws \ReflectionException
94+
*/
8995
public function getReflection()
9096
{
9197
if (empty($this->name)) {
@@ -99,6 +105,8 @@ public function getReflection()
99105
return $this->reflection;
100106
}
101107

108+
// ------------------------------------------------------------------------
109+
102110
/**
103111
* SplClassInfo::getFileInfo
104112
*

src/Iterators/ArrayIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* O2System Standard PHP Libraries ArrayIterator
2323
*
24-
* @package O2System\Core\SPL
24+
* @package O2System\Spl\Iterators
2525
*/
2626
class ArrayIterator extends \ArrayIterator implements \JsonSerializable
2727
{

src/Patterns/Structural/Provider/AbstractProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
namespace O2System\Spl\Patterns\Structural\Provider;
1515

16+
// ------------------------------------------------------------------------
17+
1618
use O2System\Spl\Iterators\ArrayIterator;
1719

1820
/**

src/Patterns/Structural/Repository/AbstractRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
namespace O2System\Spl\Patterns\Structural\Repository;
1515

16+
// ------------------------------------------------------------------------
17+
1618
use O2System\Spl\Iterators\ArrayIterator;
1719

1820
/**

src/Traits/Collectors/ConfigCollectorTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
namespace O2System\Spl\Traits\Collectors;
1515

1616
// ------------------------------------------------------------------------
17+
1718
use O2System\Kernel\DataStructures\Config;
1819

1920
/**
@@ -30,6 +31,8 @@ trait ConfigCollectorTrait
3031
*/
3132
protected $config = [];
3233

34+
// ------------------------------------------------------------------------
35+
3336
/**
3437
* Add Config
3538
*
@@ -89,7 +92,7 @@ final public function getConfig($key = null, $offset = null)
8992
*
9093
* @access public
9194
*
92-
* @param array|string $key
95+
* @param array|string|int|Config $key
9396
*
9497
* @return static
9598
*/

src/Traits/Collectors/ErrorCollectorTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ public function addErrors(array $errors)
133133
*
134134
* @param int $code Error code.
135135
* @param string $message Error message.
136+
*
137+
* @return static
136138
*/
137139
public function addError($code, $message)
138140
{
@@ -141,5 +143,7 @@ public function addError($code, $message)
141143
} else {
142144
$this->errors[ $code ] = $message;
143145
}
146+
147+
return $this;
144148
}
145149
}

src/Traits/Collectors/FileExtensionCollectorTrait.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,50 @@
2222
*/
2323
trait FileExtensionCollectorTrait
2424
{
25+
/**
26+
* FileExtensionCollectorTrait::$fileExtensions
27+
*
28+
* @var array
29+
*/
2530
protected $fileExtensions = [];
2631

32+
// ------------------------------------------------------------------------
33+
34+
/**
35+
* FileExtensionCollectorTrait::getFileExtensions
36+
*
37+
* @return array
38+
*/
2739
public function getFileExtensions()
2840
{
2941
return $this->fileExtensions;
3042
}
3143

44+
// ------------------------------------------------------------------------
45+
46+
/**
47+
* FileExtensionCollectorTrait::setFileExtensions
48+
*
49+
* @param array $fileExtensions
50+
*
51+
* @return static
52+
*/
3253
public function setFileExtensions(array $fileExtensions)
3354
{
3455
$this->fileExtensions = $fileExtensions;
3556

3657
return $this;
3758
}
3859

60+
// ------------------------------------------------------------------------
61+
62+
/**
63+
* FileExtensionCollectorTrait::addFileExtension
64+
*
65+
* @param array $fileExtensions
66+
*
67+
* @return static
68+
*/
3969
public function addFileExtensions(array $fileExtensions)
4070
{
4171
foreach ($fileExtensions as $fileExtension) {
@@ -45,6 +75,15 @@ public function addFileExtensions(array $fileExtensions)
4575
return $this;
4676
}
4777

78+
// ------------------------------------------------------------------------
79+
80+
/**
81+
* FileExtensionCollectorTrait::addFileExtension
82+
*
83+
* @param string $fileExtension
84+
*
85+
* @return static
86+
*/
4887
public function addFileExtension($fileExtension)
4988
{
5089
$fileExtension = '.' . trim($fileExtension, '.');

src/Traits/Collectors/FilePathCollectorTrait.php

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,37 @@
1616
// ------------------------------------------------------------------------
1717

1818
/**
19-
* Class PathCollectorTrait
19+
* Class FilePathCollectorTrait
2020
*
2121
* @package O2System\Spl\Traits\Collectors
2222
*/
2323
trait FilePathCollectorTrait
2424
{
2525
/**
26-
* Sub Path
26+
* FilePathCollectorTrait::$fileDirName
2727
*
2828
* @type string|null
2929
*/
3030
protected $fileDirName = null;
3131

32-
// ------------------------------------------------------------------------
33-
3432
/**
33+
* FilePathCollectorTrait::$filePaths
34+
*
3535
* List of Paths
3636
*
3737
* @type array
3838
*/
3939
protected $filePaths = [];
4040

41+
// ------------------------------------------------------------------------
42+
43+
/**
44+
* FilePathCollectorTrait::setFileDirName
45+
*
46+
* @param $fileDirName
47+
*
48+
* @return static
49+
*/
4150
public function setFileDirName($fileDirName)
4251
{
4352
$this->fileDirName = $fileDirName;
@@ -47,24 +56,45 @@ public function setFileDirName($fileDirName)
4756

4857
// ------------------------------------------------------------------------
4958

59+
/**
60+
* FilePathCollectorTrait::removeFilePath
61+
*
62+
* @param string $filePath
63+
*
64+
* @return static
65+
*/
5066
public function removeFilePath($filePath)
5167
{
5268
if (false !== ($key = array_search($filePath, $this->filePaths))) {
53-
unset($this->filePaths[ $key ]);
69+
unset($this->filePaths[$key]);
5470
}
5571

5672
return $this;
5773
}
5874

5975
// ------------------------------------------------------------------------
6076

77+
/**
78+
* FilePathCollectorTrait::getFilePaths
79+
*
80+
* @param bool $reverse
81+
*
82+
* @return array
83+
*/
6184
public function getFilePaths($reverse = false)
6285
{
6386
return ($reverse === true ? array_reverse($this->filePaths) : $this->filePaths);
6487
}
6588

6689
// ------------------------------------------------------------------------
6790

91+
/**
92+
* FilePathCollectorTrait::setFilePaths
93+
*
94+
* @param array $filePaths
95+
*
96+
* @return static
97+
*/
6898
public function setFilePaths(array $filePaths)
6999
{
70100
$this->filePaths = [];
@@ -75,6 +105,13 @@ public function setFilePaths(array $filePaths)
75105

76106
// ------------------------------------------------------------------------
77107

108+
/**
109+
* FilePathCollectorTrait::addFilePaths
110+
*
111+
* @param array $filePaths
112+
*
113+
* @return static
114+
*/
78115
public function addFilePaths(array $filePaths)
79116
{
80117
foreach ($filePaths as $filePath) {
@@ -86,6 +123,14 @@ public function addFilePaths(array $filePaths)
86123

87124
// ------------------------------------------------------------------------
88125

126+
/**
127+
* FilePathCollectorTrait::addFilePath
128+
*
129+
* @param string $filePath
130+
* @param string|int|null $offset
131+
*
132+
* @return static
133+
*/
89134
public function addFilePath($filePath, $offset = null)
90135
{
91136
$filePath = rtrim(
@@ -105,12 +150,20 @@ public function addFilePath($filePath, $offset = null)
105150
}
106151

107152
// ------------------------------------------------------------------------
108-
153+
154+
/**
155+
* FilePathCollectorTrait::pushFilePath
156+
*
157+
* @param string $filePath
158+
* @param string|int|null $offset
159+
*
160+
* @return static
161+
*/
109162
public function pushFilePath($filePath, $offset = null)
110163
{
111-
if (is_dir($filePath) AND ! in_array($filePath, $this->filePaths)) {
164+
if (is_dir($filePath) AND !in_array($filePath, $this->filePaths)) {
112165
if (isset($offset)) {
113-
$this->filePaths[ $offset ] = $filePath;
166+
$this->filePaths[$offset] = $filePath;
114167
} else {
115168
$this->filePaths[] = $filePath;
116169
}

0 commit comments

Comments
 (0)