nette / schema

📐 Validating data structures against a given Schema.
https://doc.nette.org/schema
Other
905 stars 26 forks source link

Access the $items property in the Structure class #35

Closed ncou closed 1 month ago

ncou commented 3 years ago

Hi,

Nice piece of code. Do you think there is a way to access the $items property in the Structure::class ? I use this value in 2 cases : 1) Force the castTo('array') for all the structure and sub-structures. 2) I need to enforce the key value used to be only in the range ['a-z0-9_'].

For the moment i do a reflection and i access the private property, but a public function getItems() could be usefull. Or perhaps an "iterator" inside the structure class.

What do you think about this feature, this could add more flexibility using this great library.

Keep up the good work.

dg commented 3 years ago

I will add an API for accessing private values in next version (it is also related to #1).

ncou commented 3 years ago

good news ! thank you for the quick answer.

ncou commented 3 years ago

Hi @dg, do we have an estimated date for this release ? Thanks. Keep up the good work.