3 class Kint_Parsers_ClassStatics extends kintParser
5 protected function _parse( & $variable )
7 if ( !KINT_PHP53 || !is_object( $variable ) ) return false;
9 $extendedValue = array();
11 $reflection = new ReflectionClass( $variable );
12 // first show static values
13 foreach ( $reflection->getProperties( ReflectionProperty::IS_STATIC ) as $property ) {
14 if ( $property->isPrivate() ) {
15 if ( !method_exists( $property, 'setAccessible' ) ) {
18 $property->setAccessible( true );
20 } elseif ( $property->isProtected() ) {
21 $property->setAccessible( true );
22 $access = "protected";
27 $_ = $property->getValue();
28 $output = kintParser::factory( $_, '$' . $property->getName() );
30 $output->access = $access;
31 $output->operator = '::';
32 $extendedValue[] = $output;
35 foreach ( $reflection->getConstants() as $constant => $val ) {
36 $output = kintParser::factory( $val, $constant );
38 $output->access = 'constant';
39 $output->operator = '::';
40 $extendedValue[] = $output;
43 if ( empty( $extendedValue ) ) return false;
45 $this->value = $extendedValue;
46 $this->type = 'Static class properties';
47 $this->size = count( $extendedValue );