Skip to content
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

Refactor instantiator #2

Merged
merged 1 commit into from
Jun 17, 2020
Merged

Refactor instantiator #2

merged 1 commit into from
Jun 17, 2020

Conversation

kbond
Copy link
Member

@kbond kbond commented Jun 15, 2020

  • by default, use symfony/property-access to set values and disallow extra properties (this is now a hard dependency)
  • attribute keys can be prefixed with optional: to ignore
  • attribute keys can be prefixed with force: to "force set" their value to properties directly (even non-public properties)
  • add option to disable constructor:
    (new Instantiator())->withoutConstructor()
  • add option to always allow extra attributes:
    (new Instantiator())->allowExtraAttributes()
  • add option to always "force set" attributes:
    (new Instantiator())->alwaysForceProperties()
  • can combine the different options:
    (new Instantiator())
        ->withoutConstructor()
        ->allowExtraAttributes()
        ->alwaysForceProperties()

- by default, use symfony/property-access to set values and disallow extra properties
- attribute keys can be prefixed with "optional:" to ignore
- attribute keys can be prefixed with "force:" to "force set" their value to properties directly
- add option to disable constructor
- add option to always allow extra attributes
- add option to always "force set" attributes
@kbond kbond changed the title [BC BREAK] refactor instantiator: Refactor instantiator Jun 15, 2020
@kbond kbond mentioned this pull request Jun 15, 2020
24 tasks
@kbond kbond merged commit 7b5d2b5 into refactor Jun 17, 2020
@kbond kbond deleted the refactor-instantiator branch June 17, 2020 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant