acquia / acquia-sdk-php

The Acquia SDK for PHP allows developers to build applications on top of Acquia services.
MIT License
25 stars 20 forks source link

Only call Acquia\Common\Json::prettyPrint() when native options are not available #4

Closed cpliakas closed 10 years ago

cpliakas commented 10 years ago

As a follow-up to https://github.com/cpliakas/acquia-sdk-php/pull/17, we should explore adding logic that only calls Acquia\Common\Json::prettyPrint() when the native options are not present. The method is smart enough not to pretty print JSON that is already formatted through the if (strpos($json, $newline)) { condition, however Acquia\Common\Json::encode() could be optimized to eliminate a method call when the native options are present.

This is more-or-less a micro-optimization.