Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
mihai-stancu wants to merge650 commits intosymfony:2.8frommihai-stancu:recursive_denormalize_with_property_info
Closed

Recursive denormalize using PropertyInfo#16143

mihai-stancu wants to merge650 commits intosymfony:2.8frommihai-stancu:recursive_denormalize_with_property_info

Conversation

@mihai-stancu
Copy link
Contributor

[2.7][Serializer] Feature usingPropertyInfo to recursively denormalize values before calling the setter.

QA
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsnone
LicenseMIT
Doc PRn/a

Refactored#14844 "Denormalize with typehinting":

  • Now using (optional) PropertyInfo to extract type information
  • Updated tests
  • Updated composer.json

fabpotand others added30 commitsOctober 1, 2015 07:54
* 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
nicolas-grekasand others added9 commitsDecember 18, 2015 17:57
* 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
@dunglasdunglas reopened thisDec 30, 2015
Copy link
Member

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
Copy link
Member

@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 theAbstractNormalizer code in#17113. Can you rebase against this PR?
If you don't have the time to finish it, I can do it and keep your commits to give you full credit.

@dunglasdunglas mentioned this pull requestDec 30, 2015
7 tasks
@mihai-stancu
Copy link
ContributorAuthor

@dunglas i will rebase this evening, thanks!

Mihai Stancuand others added3 commitsDecember 30, 2015 22:07
- 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
Copy link
ContributorAuthor

This PR was replaced by#17193 because it should be requested against master instead of 2.8.

fabpot added a commit that referenced this pull requestJan 4, 2016
…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
fabpot added a commit that referenced this pull requestJan 27, 2016
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
dunglas added a commit that referenced this pull requestApr 19, 2016
…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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

33 participants

@mihai-stancu@dunglas@fabpot@stloyd@nicolas-grekas@gggeek@stof@Tobion@TomasVotruba@linaori@xabbuh@rvanlaak@SoboLAN@tackerm@jakzal@carsonbot@Koc@wouterj@pvandommelen@mpajunen@kbond@blanchonvincent@Seldaek@belka-ew@GrahamCampbell@rande@ogizanagi@webmozart@havvg@GuilhemN@NothingWeAre@voronkovich@EVODelavega

[8]ページ先頭

©2009-2025 Movatter.jp