Skip to content

Commit 2ed46ad

Browse files
committed
Simplify code by using ternary operator.
1 parent fa0a22d commit 2ed46ad

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/internal/Magento/Framework/Filesystem/DirectoryList.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,8 @@ public function __construct($root, array $config = [])
9696
static::validate($config);
9797
$this->root = $this->normalizePath($root);
9898
$this->directories = static::getDefaultConfig();
99-
$this->directories[self::SYS_TMP] = [self::PATH => realpath(sys_get_temp_dir())];
100-
$uploadTmpDir = ini_get('upload_tmp_dir');
101-
if ($uploadTmpDir) {
102-
$this->directories[self::SYS_TMP] = [self::PATH => realpath($uploadTmpDir)];
103-
}
99+
$sysTmpPath = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();
100+
$this->directories[self::SYS_TMP] = [self::PATH => realpath($sysTmpPath)];
104101

105102
// inject custom values from constructor
106103
foreach ($this->directories as $code => $dir) {

0 commit comments

Comments
 (0)