@@ -30,7 +30,7 @@ final class ComponentReflection extends \ReflectionClass
3030
3131 /**
3232 * Returns array of class properties that are public and have attribute #[Persistent] or #[Parameter].
33- * @return array<string, array{def: mixed, type: string, since: ?string}>
33+ * @return array<string, array{def: mixed, type: string, since? : ?string, hasDefault: boolean }>
3434 */
3535 public function getParameters (): array
3636 {
@@ -48,16 +48,20 @@ public function getParameters(): array
4848 self ::parseAnnotation ($ prop , 'persistent ' )
4949 || $ prop ->getAttributes (Attributes \Persistent::class)
5050 ) {
51- $ params [$ prop ->getName ()] = [
52- 'def ' => $ prop ->getDefaultValue (),
51+ $ param = [
5352 'type ' => ParameterConverter::getType ($ prop ),
5453 'since ' => $ isPresenter ? Reflection::getPropertyDeclaringClass ($ prop )->getName () : null ,
5554 ];
5655 } elseif ($ prop ->getAttributes (Attributes \Parameter::class)) {
57- $ params [ $ prop -> getName ()] = [
56+ $ param = [
5857 'type ' => (string ) ($ prop ->getType () ?? 'mixed ' ),
5958 ];
59+ } else {
60+ continue ;
6061 }
62+ $ param ['def ' ] = $ prop ->getDefaultValue ();
63+ $ param ['hasDefault ' ] = $ prop ->hasDefaultValue ();
64+ $ params [$ prop ->getName ()] = $ param ;
6165 }
6266
6367 if ($ this ->getParentClass ()->isSubclassOf (Component::class)) {
@@ -77,7 +81,7 @@ public function getParameters(): array
7781
7882 /**
7983 * Returns array of persistent properties. They are public and have attribute #[Persistent].
80- * @return array<string, array{def: mixed, type: string, since: string}>
84+ * @return array<string, array{def: mixed, type: string, since: ? string, hasDefault: bool }>
8185 */
8286 public function getPersistentParams (): array
8387 {
0 commit comments