Skip to content

Commit c7c704c

Browse files
authored
ENGCOM-5474: Fix for PHP_CodeSniffer error after app:config:dump #23787
2 parents 72f72dd + c900e88 commit c7c704c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ class PhpFormatter implements FormatterInterface
1818

1919
/**
2020
* Format deployment configuration.
21+
*
2122
* If $comments is present, each item will be added
2223
* as comment to the corresponding section
2324
*
24-
* {@inheritdoc}
25+
* @inheritdoc
2526
*/
2627
public function format($data, array $comments = [])
2728
{
@@ -71,6 +72,8 @@ private function formatData($data, $comments = [], $prefix = ' ')
7172
}
7273

7374
/**
75+
* Format generated config files using the short array syntax.
76+
*
7477
* If variable to export is an array, format with the php >= 5.4 short array syntax. Otherwise use
7578
* default var_export functionality.
7679
*
@@ -80,7 +83,9 @@ private function formatData($data, $comments = [], $prefix = ' ')
8083
*/
8184
private function varExportShort($var, int $depth = 0)
8285
{
83-
if (!is_array($var)) {
86+
if (null === $var) {
87+
return 'null';
88+
} elseif (!is_array($var)) {
8489
return var_export($var, true);
8590
}
8691

0 commit comments

Comments
 (0)