Skip to content

Commit beb3f4b

Browse files
committed
Issue #9 Use ArrayHelper for temp file options
1 parent c54ef78 commit beb3f4b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ExcelFile.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use Yii;
55
use yii\base\Object;
6+
use yii\helpers\ArrayHelper;
67
use mikehaertl\tmp\File;
78

89
/**
@@ -60,9 +61,9 @@ public function getWorkbook()
6061
public function getTmpFile()
6162
{
6263
if ($this->_tmpFile === null) {
63-
$suffix = isset($this->fileOptions['suffix']) ? $this->fileOptions['suffix'] : null;
64-
$prefix = isset($this->fileOptions['prefix']) ? $this->fileOptions['prefix'] : null;
65-
$directory = isset($this->fileOptions['directory']) ? $this->fileOptions['directory'] : null;
64+
$suffix = ArrayHelper::getValue($this->fileOptions, 'suffix');
65+
$prefix = ArrayHelper::getValue($this->fileOptions, 'prefix');
66+
$directory = ArrayHelper::getValue($this->fileOptions, 'directory');
6667
$this->_tmpFile = new File('', $suffix, $prefix, $directory);
6768
}
6869
return $this->_tmpFile;

0 commit comments

Comments
 (0)