diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 09:30:18 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-03-26 16:34:56 +0100 |
commit | b80ebc96748b45fd2e0ba9323308657c4b00b7ec (patch) | |
tree | ec20e0ffa2f86b9b54939a83a785407319f94559 /lib/private/Archive | |
parent | 62403d0932be7d620c7bdadc6b4e13eb496fcd6f (diff) | |
download | nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.tar.gz nextcloud-server-b80ebc96748b45fd2e0ba9323308657c4b00b7ec.zip |
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Archive')
-rw-r--r-- | lib/private/Archive/TAR.php | 20 | ||||
-rw-r--r-- | lib/private/Archive/ZIP.php | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index 20bab49adf8..08c9d23863e 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -52,7 +52,7 @@ class TAR extends Archive { * @param string $source */ public function __construct($source) { - $types = array(null, 'gz', 'bz2'); + $types = [null, 'gz', 'bz2']; $this->path = $source; $this->tar = new \Archive_Tar($source, $types[self::getTarType($source)]); } @@ -103,7 +103,7 @@ class TAR extends Archive { mkdir($folder); } } - $result = $this->tar->addModify(array($tmpBase . $path), '', $tmpBase); + $result = $this->tar->addModify([$tmpBase . $path], '', $tmpBase); rmdir($tmpBase . $path); $this->fileList = false; $this->cachedHeaders = false; @@ -144,9 +144,9 @@ class TAR extends Archive { rename($tmp . $source, $tmp . $dest); $this->tar = null; unlink($this->path); - $types = array(null, 'gz', 'bz'); + $types = [null, 'gz', 'bz']; $this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]); - $this->tar->createModify(array($tmp), '', $tmp . '/'); + $this->tar->createModify([$tmp], '', $tmp . '/'); $this->fileList = false; $this->cachedHeaders = false; return true; @@ -201,7 +201,7 @@ class TAR extends Archive { */ public function getFolder($path) { $files = $this->getFiles(); - $folderContent = array(); + $folderContent = []; $pathLength = strlen($path); foreach ($files as $file) { if ($file[0] == '/') { @@ -232,7 +232,7 @@ class TAR extends Archive { if (!$this->cachedHeaders) { $this->cachedHeaders = $this->tar->listContent(); } - $files = array(); + $files = []; foreach ($this->cachedHeaders as $header) { $files[] = $header['filename']; } @@ -263,9 +263,9 @@ class TAR extends Archive { return false; } if ($this->fileExists('/' . $path)) { - $success = $this->tar->extractList(array('/' . $path), $tmp); + $success = $this->tar->extractList(['/' . $path], $tmp); } else { - $success = $this->tar->extractList(array($path), $tmp); + $success = $this->tar->extractList([$path], $tmp); } if ($success) { rename($tmp . $path, $dest); @@ -329,7 +329,7 @@ class TAR extends Archive { $this->tar = null; unlink($this->path); $this->reopen(); - $this->tar->createModify(array($tmp), '', $tmp); + $this->tar->createModify([$tmp], '', $tmp); return true; } @@ -378,7 +378,7 @@ class TAR extends Archive { $this->tar->_close(); $this->tar = null; } - $types = array(null, 'gz', 'bz'); + $types = [null, 'gz', 'bz']; $this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]); } } diff --git a/lib/private/Archive/ZIP.php b/lib/private/Archive/ZIP.php index 2c3df550f71..cb04b572c03 100644 --- a/lib/private/Archive/ZIP.php +++ b/lib/private/Archive/ZIP.php @@ -113,7 +113,7 @@ class ZIP extends Archive{ */ public function getFolder($path) { $files=$this->getFiles(); - $folderContent=array(); + $folderContent=[]; $pathLength=strlen($path); foreach($files as $file) { if(substr($file, 0, $pathLength)==$path and $file!=$path) { @@ -130,7 +130,7 @@ class ZIP extends Archive{ */ public function getFiles() { $fileCount=$this->zip->numFiles; - $files=array(); + $files=[]; for($i=0;$i<$fileCount;$i++) { $files[]=$this->zip->getNameIndex($i); } |