Skip to content

Fix recursive reference resolving #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 30, 2023
Merged

Conversation

wol-soft
Copy link
Owner

Compare #65

Add onResolved callback to properties to execute further post-processing of the property only after the property has been created completely. Otherwise, the property might redirect to null causing the generation process to crash.

Compositions for example use generated properties to enrich the base model the composition belongs to. This process must be delayed until the properties are completely set up (an incomplete property might occur due to recursion). Consequently now the composition uses a callback mechanism to delay the process until all recursions are resolved.
@coveralls
Copy link

coveralls commented Mar 13, 2023

Pull Request Test Coverage Report for Build 4564420247

  • 284 of 288 (98.61%) changed or added relevant lines in 39 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 98.72%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/PropertyProcessor/Property/MultiTypeProcessor.php 35 36 97.22%
src/Model/Schema.php 10 13 76.92%
Totals Coverage Status
Change from base Build 4014311194: 0.005%
Covered Lines: 2777
Relevant Lines: 2813

💛 - Coveralls

Add onResolved callback to validators to execute further post-processing of the validator and properties holding the validator only after the validator has been created completely. This is required as a validator might hold a nested property to execute the validation. This nested property might be a PropertyProxy due to recursion which might cause a crash of the generation process if the property hasn't been created completely before post-processing the property and the validator.
@wol-soft wol-soft merged commit b3deda8 into master Mar 30, 2023
@wol-soft wol-soft deleted the 65-recursive-reference-resolving branch March 30, 2023 12:48
wol-soft added a commit that referenced this pull request Mar 31, 2023
Validators which render a separate method and are transferred to a parent schema will render the method to the origin schema. Consequently, a call to the validator in the parent schema will cause a "call to undefined method" error. To fix the issue the validator scope gets updated at render time to make sure the method is rendered to the correct class.
wol-soft added a commit that referenced this pull request Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

...PropertyProxy::getProperty(): Return value must be of type ...PropertyInterface, null returned in
2 participants