From c9f597308ef908b81a743aa99b5d1fa0a314dfd5 Mon Sep 17 00:00:00 2001 From: wapplay Date: Sun, 21 Oct 2018 19:30:45 +0300 Subject: [PATCH] cs fix --- src/PhpZip/Model/Entry/ZipNewFileEntry.php | 10 +++++----- src/PhpZip/ZipFile.php | 8 ++++---- tests/PhpZip/Issue24Test.php | 14 +++++++------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/PhpZip/Model/Entry/ZipNewFileEntry.php b/src/PhpZip/Model/Entry/ZipNewFileEntry.php index f8d1cd0..3c1335c 100644 --- a/src/PhpZip/Model/Entry/ZipNewFileEntry.php +++ b/src/PhpZip/Model/Entry/ZipNewFileEntry.php @@ -25,14 +25,14 @@ class ZipNewFileEntry extends ZipAbstractEntry public function __construct($file) { parent::__construct(); - if ($file === null){ + if ($file === null) { throw new InvalidArgumentException("file is null"); } $file = (string)$file; - if (!is_file($file)){ + if (!is_file($file)) { throw new ZipException("File $file does not exist."); } - if (!is_readable($file)){ + if (!is_readable($file)) { throw new ZipException("The '$file' file could not be read. Check permissions."); } $this->file = $file; @@ -45,9 +45,9 @@ class ZipNewFileEntry extends ZipAbstractEntry */ public function getEntryContent() { - if (!is_file($this->file)){ + if (!is_file($this->file)) { throw new RuntimeException("File {$this->file} does not exist."); } return file_get_contents($this->file); } -} \ No newline at end of file +} diff --git a/src/PhpZip/ZipFile.php b/src/PhpZip/ZipFile.php index 68dcc2f..5dce7f5 100644 --- a/src/PhpZip/ZipFile.php +++ b/src/PhpZip/ZipFile.php @@ -562,7 +562,7 @@ class ZipFile implements ZipFileInterface throw new InvalidArgumentException('The input directory is not specified'); } if (!is_dir($inputDir)) { - throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); + throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); } $inputDir = rtrim($inputDir, '/\\') . DIRECTORY_SEPARATOR; @@ -594,7 +594,7 @@ class ZipFile implements ZipFileInterface throw new InvalidArgumentException('The input directory is not specified'); } if (!is_dir($inputDir)) { - throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); + throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); } $inputDir = rtrim($inputDir, '/\\') . DIRECTORY_SEPARATOR; @@ -713,7 +713,7 @@ class ZipFile implements ZipFileInterface throw new InvalidArgumentException('The input directory is not specified'); } if (!is_dir($inputDir)) { - throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); + throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); } $globPattern = (string)$globPattern; if (empty($globPattern)) { @@ -813,7 +813,7 @@ class ZipFile implements ZipFileInterface throw new InvalidArgumentException('The input directory is not specified'); } if (!is_dir($inputDir)) { - throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); + throw new InvalidArgumentException(sprintf('The "%s" directory does not exist.', $inputDir)); } $inputDir = rtrim($inputDir, '/\\') . DIRECTORY_SEPARATOR; diff --git a/tests/PhpZip/Issue24Test.php b/tests/PhpZip/Issue24Test.php index ddf040e..e3ed10c 100644 --- a/tests/PhpZip/Issue24Test.php +++ b/tests/PhpZip/Issue24Test.php @@ -53,7 +53,7 @@ class DummyFileSystemStream */ private $fp; - function stream_open($path, $mode, $options, &$opened_path) + public function stream_open($path, $mode, $options, &$opened_path) { // echo "DummyFileSystemStream->stream_open($path, $mode, $options)" . PHP_EOL; @@ -64,7 +64,7 @@ class DummyFileSystemStream return true; } - function stream_read($count) + public function stream_read($count) { // echo "DummyFileSystemStream->stream_read($count)" . PHP_EOL; $position = ftell($this->fp); @@ -77,28 +77,28 @@ class DummyFileSystemStream return $ret; } - function stream_tell() + public function stream_tell() { // echo "DummyFileSystemStream->stream_tell()" . PHP_EOL; return ftell($this->fp); } - function stream_eof() + public function stream_eof() { // echo "DummyFileSystemStream->stream_eof()" . PHP_EOL; $isfeof = feof($this->fp); return $isfeof; } - function stream_seek($offset, $whence) + public function stream_seek($offset, $whence) { // echo "DummyFileSystemStream->stream_seek($offset, $whence)" . PHP_EOL; fseek($this->fp, $offset, $whence); } - function stream_stat() + public function stream_stat() { // echo "DummyFileSystemStream->stream_stat()" . PHP_EOL; return fstat($this->fp); } -} \ No newline at end of file +}