Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ class PhpFormatter implements FormatterInterface

/**
* Format deployment configuration.
*
* If $comments is present, each item will be added
* as comment to the corresponding section
*
* {@inheritdoc}
* @inheritdoc
*/
public function format($data, array $comments = [])
{
Expand Down Expand Up @@ -71,6 +72,8 @@ private function formatData($data, $comments = [], $prefix = ' ')
}

/**
* Format generated config files using the short array syntax.
*
* If variable to export is an array, format with the php >= 5.4 short array syntax. Otherwise use
* default var_export functionality.
*
Expand All @@ -80,7 +83,9 @@ private function formatData($data, $comments = [], $prefix = ' ')
*/
private function varExportShort($var, int $depth = 0)
{
if (!is_array($var)) {
if (null === $var) {
return 'null';
} elseif (!is_array($var)) {
return var_export($var, true);
}

Expand Down