Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Recursive denormalize using PropertyInfo#16143
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Recursive denormalize using PropertyInfo#16143
Uh oh!
There was an error while loading.Please reload this page.
Conversation
* 2.8: fix test for not configured form action attribute do not render empty form action attributes deprecated lifetime profiler option
* 2.8: [Form] made the tests compatible with 3.0
…pot)This PR was merged into the 3.0-dev branch.Discussion----------[HttpKernel] removed deprecated profiler storages| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aCommits-------2925df5 [HttpKernel] removed deprecated profiler storages
…argument (fabpot)This PR was merged into the 3.0-dev branch.Discussion----------[HttpFoundation] removed the ParameterBag::get() deep argument| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aCommits-------317f7b4 [HttpFoundation] removed the ParameterBag::get() deep argument
* 2.8: [Security] made tests work for 2.8 and 3.0
* 2.8: Use PHPUnit 5.0 for PHP 7 [DomCrawler] always pass base href to subcrawlers
* 2.8: fixed typo
* 2.8: Fix merge Fix appveyor.yml missing ANSICON env var [appveyor] merge test matrix in a single job [travis] Skip testing intermediate PHP versions on pull requestsConflicts:.travis.ymlappveyor.yml
…uterJ)This PR was squashed before being merged into the 3.0-dev branch (closes#15904).Discussion----------[3.0][FrameworkBundle] Removed deprecated features| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Commits-------fc41cf0 [3.0][FrameworkBundle] Removed deprecated features
…terJ)This PR was squashed before being merged into the 3.0-dev branch (closes#15900).Discussion----------[3.0][DoctrineBridge] Removed deprecated features| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Commits-------6dc3cf9 [3.0][DoctrineBridge] Removed deprecated features
…nd Form (fabpot)This PR was merged into the 3.0-dev branch.Discussion----------[Validator] removed deprecated features in Validator and Form| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aCommits-------33f3400 [Form] removed deprecated features582f3a3 [Form] removed deprecated FormType::getName()bfba6ca [Form] removed precision option17cedd3 [Form] removed usage of Validator deprecated features8fd32ba [Validator] remove the API_VERSION2a6b629 [Validator] removed deprecated methods925ecaf [Validator] removed deprecated features in Constraints
Conflicts:UPGRADE-2.8.mdsrc/Symfony/Bridge/Twig/Command/LintCommand.phpsrc/Symfony/Bundle/FrameworkBundle/Resources/config/collectors.xmlsrc/Symfony/Bundle/FrameworkBundle/Resources/config/form_debug.xmlsrc/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/FormPassTest.phpsrc/Symfony/Bundle/FrameworkBundle/composer.jsonsrc/Symfony/Bundle/SecurityBundle/Resources/config/collectors.xmlsrc/Symfony/Bundle/TwigBundle/Command/DebugCommand.phpsrc/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.phpsrc/Symfony/Component/Routing/Loader/YamlFileLoader.php
…ion)This PR was merged into the 3.0-dev branch.Discussion----------[HttpKernel] make RequestStack parameter required| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aContinuation of#14634,#8904Commits-------a2e154d [HttpKernel] make RequestStack parameter required for classes that need it
…ibutes (WouterJ)This PR was merged into the 3.0-dev branch.Discussion----------[WIP][3.0][Form] Removed usage of deprecated form tag attributes| Q | A| ------------- | ---| Bug fix? | yes| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -WIP because it needs some adjustments after#15926 is mergedCommits-------215fdbe Removed alias attribute usages
… (fabpot)This PR was merged into the 3.0-dev branch.Discussion----------[CssSelector] removed the deprecated CssSelector class| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aCommits-------3ffa422 [CssSelector] removed the deprecated CssSelector class
* 3.0: Fix merge [Form] fix BC break introduced with prototype_data option [Ldap] Escape carriage returns in LDAP DNs. Upgrade for 2.8: ContainerAware was deprecated in favour of ContainerAwareTrait [ci skip] simplify debug error_reporting levels given php version > 5.3 Fix wrong method name mapping in UPGRADE-3.0.md Use correct height for clearer [Validator] fixed raising violations to a maximum of one
This PR was merged into the 3.1-dev branch.Discussion----------Fix typo in changelog| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#17084| License | MIT| Doc PR | -Create separate PR as requested in [OptionsResolver PR](#17032)Commits-------6508b3d Fix typo in changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Must type hint thePropertyInfoExtractorInterface instead of the implementation.
dunglas commentedDec 30, 2015
@mihai-stancu I've just reopened the PR because of#16917. The cache will handled directly in the PropertyInfo Component so it's ok to use it directly. I've refactored most of the |
mihai-stancu commentedDec 30, 2015
@dunglas i will rebase this evening, thanks! |
- Refactored PR 14844 "Denormalize with typehinting"- Now using PropertyInfo to extract type information- Updated tests- Updated composer.json
- Refactoring: - Extract method for property denormalization - Guard clauses - Avoid else/elseif - 2 indents per function - CS fix
- Fix logical fault for nullables
mihai-stancu commentedDec 31, 2015
This PR was replaced by#17193 because it should be requested against master instead of 2.8. |
…ct class (dunglas)This PR was squashed before being merged into the 3.1-dev branch (closes#17191).Discussion----------[Serializer] Move the normalization logic in an abstract class| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aAs suggested by@xabbuh, move all the normalization logic for objects in an abstract class.It will ease the maintenance as well as adding new features such as#17113 and#16143.I've introduced a new abstract class to avoid BC breaks in `AbstractNormalizer`. As a (good) side effect, all normalizers now benefits from the caching system introduced in#16547.Commits-------3bec813 [Serializer] Move the normalization logic in an abstract class
This PR was squashed before being merged into the 3.1-dev branch (closes#16917).Discussion----------[PropertyInfo] Cache support| Q | A| ------------- | ---| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#16893| License | MIT| Doc PR | todoReplace#16893 with several advantages:- Less complex patch- Work for all usages of PropertyInfo (even outside of the Serializer)- Avoid a circular reference between Serializer's CallMetadataFactory and PropertyInfo's SerializerExtractor- Allow@mihai-stancu's#16143 to work as-isCommits-------86c20df [PropertyInfo] Cache support
…ursive denormalization and hardening) (mihai-stancu, dunglas)This PR was merged into the 3.1-dev branch.Discussion----------[Serializer] Integrate the PropertyInfo Component (recursive denormalization and hardening)| Q | A| ------------- | ---| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#16143,#17193,#14844| License | MIT| Doc PR | todoIntegrates the PropertyInfo Component in order to:* denormalize a graph of objects recursively (see tests)* harden the hydratation logicThe hardening part is interesting. Considering the following example:```phpclass Foo{ public function setDate(\DateTimeInterface $date) { }}// initialize $normalizer$normalizer->denormalize(['date' => 1234], Foo::class);```Previously, a PHP error was thrown because the type passed to the setter (an int) doesn't match the one checked with the typehint. With the PropertyInfo integration, an `UnexpectedValueExcption` is throw instead.It's especially interesting for web APIs dealing with JSON documents. For instance in API Platform, previously a 500 error was thrown, but thanks to this fix a 400 HTTP code with a descriptive error message will be returned. (/cc@csarrazi@mRoca@blazarecki, it's an alternative tohttps://github.com/dunglas/php-to-json-schema for protecting an API)./cc@mihai-stancuCommits-------5194482 [Serializer] Integrate the PropertyInfo Component6b464b0 Recursive denormalize using PropertyInfo
[2.7][Serializer] Feature using
PropertyInfoto recursively denormalize values before calling the setter.Refactored#14844 "Denormalize with typehinting":