From 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 21:45:27 +0200 Subject: more scrutinizer issue improvements --- inc/Tar.class.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/Tar.class.php') diff --git a/inc/Tar.class.php b/inc/Tar.class.php index 903f7f35c..8c7d33fc1 100644 --- a/inc/Tar.class.php +++ b/inc/Tar.class.php @@ -536,6 +536,7 @@ class Tar { $header = @unpack("a100filename/a8perm/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix", $block); if(!$header) return false; + $return = array(); $return['checksum'] = OctDec(trim($header['checksum'])); if($return['checksum'] != $chks) return false; -- cgit v1.2.3 From 42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 11:30:27 +0200 Subject: Many PHPDocs, some unused and dyn declared vars many PHPDocs some unused variables some dynamically declared variables declared --- inc/Tar.class.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'inc/Tar.class.php') diff --git a/inc/Tar.class.php b/inc/Tar.class.php index 8c7d33fc1..05831df58 100644 --- a/inc/Tar.class.php +++ b/inc/Tar.class.php @@ -105,6 +105,9 @@ class Tar { * * The archive is closed afer reading the contents, because rewinding is not possible in bzip2 streams. * Reopen the file with open() again if you want to do additional operations + * + * @return array + * @throws TarIOException */ public function contents() { if($this->closed || !$this->file) throw new TarIOException('Can not read from a closed archive'); @@ -270,6 +273,7 @@ class Tar { * Add a file to the current TAR archive using an existing file in the filesystem * * @todo handle directory adding + * * @param string $file the original file * @param string $name the name to use for the file in the archive * @throws TarIOException @@ -377,6 +381,10 @@ class Tar { * Returns the created in-memory archive data * * This implicitly calls close() on the Archive + * + * @param int $comptype + * @param int $complevel + * @return mixed|string */ public function getArchive($comptype = Tar::COMPRESS_AUTO, $complevel = 9) { $this->close(); @@ -395,7 +403,7 @@ class Tar { * Note: It more memory effective to specify the filename in the create() function and * let the library work on the new file directly. * - * @param $file + * @param string $file * @param int $comptype * @param int $complevel * @throws TarIOException @@ -571,7 +579,7 @@ class Tar { /** * Cleans up a path and removes relative parts, also strips leading slashes * - * @param string $p_dir + * @param string $path * @return string */ public function cleanPath($path) { @@ -591,7 +599,7 @@ class Tar { /** * Checks if the given compression type is available and throws an exception if not * - * @param $comptype + * @param int $comptype * @throws TarIllegalCompressionException */ protected function compressioncheck($comptype) { -- cgit v1.2.3 From e3710957c6b7e12293805a15d0624be7c7054092 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 17:05:40 +0200 Subject: more phpdocs and minor check --- inc/Tar.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/Tar.class.php') diff --git a/inc/Tar.class.php b/inc/Tar.class.php index 05831df58..04246846e 100644 --- a/inc/Tar.class.php +++ b/inc/Tar.class.php @@ -530,7 +530,7 @@ class Tar { * Decode the given tar file header * * @param string $block a 512 byte block containign the header data - * @return array|bool + * @return array|false */ protected function parseHeader($block) { if(!$block || strlen($block) != 512) return false; -- cgit v1.2.3 From 7e8500eea1e53b1de0e0f70400664afa442cd08d Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 2 Oct 2014 14:55:24 +0200 Subject: PHPDocs and some improvements --- inc/Tar.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'inc/Tar.class.php') diff --git a/inc/Tar.class.php b/inc/Tar.class.php index 04246846e..0dc7dace2 100644 --- a/inc/Tar.class.php +++ b/inc/Tar.class.php @@ -53,6 +53,7 @@ class Tar { protected $file = ''; protected $comptype = Tar::COMPRESS_AUTO; + /** @var resource|int */ protected $fh; protected $memory = ''; protected $closed = true; @@ -530,7 +531,7 @@ class Tar { * Decode the given tar file header * * @param string $block a 512 byte block containign the header data - * @return array|false + * @return false|array */ protected function parseHeader($block) { if(!$block || strlen($block) != 512) return false; @@ -633,8 +634,14 @@ class Tar { } } +/** + * Class TarIOException + */ class TarIOException extends Exception { } +/** + * Class TarIllegalCompressionException + */ class TarIllegalCompressionException extends Exception { } -- cgit v1.2.3 From 0b55591d7a88c7a2447c650dd998caf8103c8344 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 31 Jul 2015 13:00:01 +0200 Subject: deprecation of Archive libs --- inc/Tar.class.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/Tar.class.php') diff --git a/inc/Tar.class.php b/inc/Tar.class.php index 0dc7dace2..57c280d79 100644 --- a/inc/Tar.class.php +++ b/inc/Tar.class.php @@ -43,6 +43,7 @@ * @author Andreas Gohr * @author Bouchon (Maxg) * @license GPL 2 + * @deprecated 2015-05-15 - use splitbrain\PHPArchive\Tar instead */ class Tar { -- cgit v1.2.3