Skip to content

Commit

Permalink
remove code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
azine committed Nov 28, 2017
1 parent ab2cfbc commit 4b89821
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Services/AzineEmailTwigExtension.php
Expand Up @@ -178,16 +178,12 @@ public function printVars(array $vars, $allDetails = false, $indent = ""){
$defaultIndent = " ";
ksort($vars);
foreach ($vars as $key => $value){
if (is_array($value)){
if($allDetails) {
$value = "\n" . $this->printVars($value, $allDetails, $indent.$defaultIndent);
} else {
if($allDetails) {
$value = "\n" . $this->printVars((array) $value, $allDetails, $indent.$defaultIndent);
} else {
if (is_array($value)){
$value = "array(".sizeof($value).")";
}
} else if (is_object($value)) {
if($allDetails) {
$value = "\n" . $this->printVars((array) $value, $allDetails, $indent.$defaultIndent);
} else {
} else if (is_object($value)) {
$value = "object(".get_class($value).")";
}
}
Expand Down

0 comments on commit 4b89821

Please sign in to comment.