File tree 1 file changed +13
-5
lines changed
src/PHPFUI/InstaDoc/Section
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ protected function getContent(string $accessType) : \PHPFUI\Table
350
350
}
351
351
352
352
$ table ->addNextRowAttribute ('class ' , $ this ->getRowClasses ($ property ));
353
- $ table ->addRow ([$ this ->getProperty ($ property )]);
353
+ $ table ->addRow ([$ this ->getProperty ($ property, $ this -> reflection )]);
354
354
}
355
355
}
356
356
}
@@ -427,7 +427,7 @@ protected function getNameScope(\ReflectionProperty|\ReflectionMethod|\Reflectio
427
427
return '' ;
428
428
}
429
429
430
- protected function getProperty (\ReflectionProperty $ property ) : string
430
+ protected function getProperty (\ReflectionProperty $ property, \ ReflectionClass $ class ) : string
431
431
{
432
432
$ property ->setAccessible (true );
433
433
$ docBlock = $ this ->getDocBlock ($ property );
@@ -448,13 +448,21 @@ protected function getProperty(\ReflectionProperty $property) : string
448
448
449
449
if ($ property ->isStatic ())
450
450
{
451
- $ value = $ property ->getValue ();
452
-
453
- if ($ value )
451
+ if ($ property ->hasDefaultValue ())
454
452
{
453
+ $ value = $ property ->getValue ();
455
454
$ info .= ' = ' . $ this ->getValueString ($ value );
456
455
}
457
456
}
457
+ else
458
+ {
459
+ $ defaults = $ class ->getDefaultProperties ();
460
+
461
+ if (\array_key_exists ($ property ->getName (), $ defaults ))
462
+ {
463
+ $ info .= ' = ' . $ this ->getValueString ($ defaults [$ property ->getName ()]);
464
+ }
465
+ }
458
466
459
467
$ info .= $ this ->getComments ($ docBlock );
460
468
You can’t perform that action at this time.
0 commit comments