protected function decodeJsonObject($output) {
    // Remove anything before the first '{'.
    $output = preg_replace('/^[^\{]*/', '', $output);
    // Remove anything after the last '}'.
    $output = preg_replace('/[^\}]*$/s', '', $output);
    return json_decode($output);
  }
protected function decodeJsonObject($output) {
    // Remove anything before the first '{'.
    $output = preg_replace('/^[^\{]*/', '', $output);
    // Remove anything after the last '}'.
    $output = preg_replace('/[^\}]*$/s', '', $output);
    return json_decode($output);
  }
protected function decodeJsonObject ( $ output ) { // Remove anything before the first '{'. $ output = preg_replace ( '/^[^\{]*/' , '' , $ output ) ; // Remove anything after the last '}'. $ output = preg_replace ( '/[^\}]*$/s' , '' , $ output ) ; return json_decode ( $ output ) ; }
Decodes JSON object returned by Drush.

It will clean up any junk that may have appeared before or after the
JSON object. This can happen with remote Drush aliases.

@param string $output
The output from Drush.

@return object
The decoded JSON object.
Decodes JSON object returned by Drush .