return parameter for debug method #244

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
@sethunath
Contributor

sethunath commented Jan 14, 2013

Added $return as 4th parameter to specify whether to return the debug text or print it. It works similar to print_r function

return parameter for debug method
Added $return as 4th parameter to specify whether to return the debug text or print it. It works similar to print_r function
@doctrinebot

This comment has been minimized.

Show comment Hide comment
@doctrinebot

doctrinebot Jan 14, 2013

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DCOM-162

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DCOM-162

lib/Doctrine/Common/Util/Debug.php
- echo ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump);
-
+ $dumpText = ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump);
+ if($return){

This comment has been minimized.

Show comment Hide comment
@Ocramius

Ocramius Jan 14, 2013

Member

Missing newline before this line.
Also, should be if ($return) {

@Ocramius

Ocramius Jan 14, 2013

Member

Missing newline before this line.
Also, should be if ($return) {

lib/Doctrine/Common/Util/Debug.php
+ ini_set('html_errors', 'Off');
+ return $dumpText;
+ }
+ echo $dumpText;

This comment has been minimized.

Show comment Hide comment
@Ocramius

Ocramius Jan 14, 2013

Member

Missing newline before this line

@Ocramius

Ocramius Jan 14, 2013

Member

Missing newline before this line

lib/Doctrine/Common/Util/Debug.php
+ $dumpText = ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump);
+ if($return){
+ ini_set('html_errors', 'Off');
+ return $dumpText;

This comment has been minimized.

Show comment Hide comment
@Ocramius

Ocramius Jan 14, 2013

Member

Missing newline before this line

@Ocramius

Ocramius Jan 14, 2013

Member

Missing newline before this line

lib/Doctrine/Common/Util/Debug.php
-
+ $dumpText = ($stripTags ? strip_tags(html_entity_decode($dump)) : $dump);
+ if($return){
+ ini_set('html_errors', 'Off');

This comment has been minimized.

Show comment Hide comment
@Ocramius

Ocramius Jan 14, 2013

Member

You can avoid this duplication by moving this to line 66 and removing the instance at line 71

@Ocramius

Ocramius Jan 14, 2013

Member

You can avoid this duplication by moving this to line 66 and removing the instance at line 71

@Ocramius

This comment has been minimized.

Show comment Hide comment
@Ocramius

Ocramius Dec 3, 2013

Member

Created a cleaned up version at #306

Member

Ocramius commented Dec 3, 2013

Created a cleaned up version at #306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment