Conditions | 6 |
Paths | 5 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
20 | 2 | protected function getProperties($bIncludeProtected = false) { |
|
21 | 2 | $aRet = array(); |
|
22 | 2 | $t = new \ReflectionObject($this); |
|
23 | 2 | $aProperties = $t->getProperties(); |
|
24 | |||
25 | /* @var $oProperty \ReflectionProperty */ |
||
26 | 2 | foreach ($aProperties as $oProperty) { |
|
27 | 2 | $sName = $oProperty->getName(); |
|
28 | |||
29 | 2 | if ($oProperty->isPrivate() || $sName == '_current') { |
|
30 | // skip private properties or IteratorTrait::$_current |
||
31 | 2 | continue; |
|
32 | 2 | } elseif ($oProperty->isProtected()) { |
|
33 | 2 | if ($bIncludeProtected) { |
|
34 | 1 | $oProperty->setAccessible(true); |
|
35 | } else { |
||
36 | 1 | continue; |
|
37 | } |
||
38 | } |
||
39 | 2 | $aRet[$sName] = $oProperty->getValue($this); |
|
40 | } |
||
41 | 2 | return $aRet; |
|
42 | } |
||
43 | |||
45 |