-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
@@ -28,6 +28,10 @@ class ValueExporter | |||
public function exportValue($value, $depth = 1, $deep = false) | |||
{ | |||
if (is_object($value)) { | |||
if ($value instanceof \DateTime) { |
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.
can you do if ($value instanceof \DateTime || $value instanceof \DateTimeInterface) {
to support the immutable datetimes of PHP 5.5 ?
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 |
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.
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
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; |
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.
this test should be in the Util
subnamespace to match the tested class
Thanks stof for your inputs. I updated my code, may you have another look? |
👍 |
|
||
class ValueExporterTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
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.
Can you remove this blank line?
…DateTimeInterface to ValueExporter
Thank you for your feedback. Fixed all open issues on the code. |
👍 |
1 similar comment
👍 |
Thank you @scuben. |
…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
This will output the actual value of a DateTime object in the form panel of the web debug toolbar.