Skip to content

[HttpKernel] added value of DateTime object to ValueExporter #11070

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 1 commit into from
Jun 16, 2014
Merged

[HttpKernel] added value of DateTime object to ValueExporter #11070

merged 1 commit into from
Jun 16, 2014

Conversation

plandolt
Copy link
Contributor

@plandolt plandolt commented Jun 6, 2014

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

This will output the actual value of a DateTime object in the form panel of the web debug toolbar.

  • gather feedback for my change (thank you stof, its my first contribution to oss)
  • finish the code

@@ -28,6 +28,10 @@ class ValueExporter
public function exportValue($value, $depth = 1, $deep = false)
{
if (is_object($value)) {
if ($value instanceof \DateTime) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do if ($value instanceof \DateTime || $value instanceof \DateTimeInterface) { to support the immutable datetimes of PHP 5.5 ?

@stof
Copy link
Member

stof commented Jun 7, 2014

a test should be added, and the PR needs to be rebased as it conflicts with master.

There is no need for a doc PR for this change

@@ -7,6 +7,10 @@ in 2.5 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.5.0...v2.5.1

* 2.6.0

* [HttpKernel] added value of DateTime object to ValueExporter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be in CHANGELOG-2.5 which is an auto-generated file (you should not change it). It should be in the CHANGELOG file of the HttpKernel component

@plandolt plandolt changed the title [WIP] [HttpKernel] added value of DateTime object to ValueExporter [HttpKernel] added value of DateTime object to ValueExporter Jun 10, 2014
@plandolt
Copy link
Contributor Author

Thank you for your input stof. I think the PR is ready to merge. The Travis errors comes form other parts of the framework.

* file that was distributed with this source code.
*/

namespace Symfony\Component\HttpKernel\Tests\DataCollector;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test should be in the Util subnamespace to match the tested class

@plandolt
Copy link
Contributor Author

Thanks stof for your inputs. I updated my code, may you have another look?

@stof
Copy link
Member

stof commented Jun 13, 2014

👍


class ValueExporterTest extends \PHPUnit_Framework_TestCase
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this blank line?

@plandolt
Copy link
Contributor Author

Thank you for your feedback. Fixed all open issues on the code.

@fabpot
Copy link
Member

fabpot commented Jun 16, 2014

👍

1 similar comment
@Tobion
Copy link
Contributor

Tobion commented Jun 16, 2014

👍

@fabpot
Copy link
Member

fabpot commented Jun 16, 2014

Thank you @scuben.

@fabpot fabpot merged commit a1762fb into symfony:master Jun 16, 2014
fabpot added a commit that referenced this pull request Jun 16, 2014
…porter (scuben)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[HttpKernel] added value of DateTime object to ValueExporter

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This will output the actual value of a DateTime object in the form panel of the web debug toolbar.

- [x] gather feedback for my change (thank you stof, its my first contribution to oss)
- [x] finish the code

Commits
-------

a1762fb [HttpKernel] added value of DateTime object and objects implementing DateTimeInterface to ValueExporter
@plandolt plandolt deleted the value-for-datetime-form-panel branch June 17, 2014 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants