From 851154419885a899500dc4cfaeb75a1869b5ab97 Mon Sep 17 00:00:00 2001 From: Raffael Sahli Date: Fri, 24 Aug 2018 16:37:47 +0200 Subject: [PATCH] spaces to tab fix --- src/IShare.php | 4 ++-- src/Native/NativeShare.php | 40 ++++++++++++++++++------------------- src/Wrapped/Share.php | 32 ++++++++++++++--------------- tests/AbstractShareTest.php | 24 +++++++++++----------- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/IShare.php b/src/IShare.php index 88aa676..92a12b4 100644 --- a/src/IShare.php +++ b/src/IShare.php @@ -52,7 +52,7 @@ interface IShare { /** * Open a writable stream to a remote file - * Note: This method will truncate the file to 0bytes + * Note: This method will truncate the file to 0bytes * * @param string $target * @return resource a write only stream to upload a remote file @@ -62,7 +62,7 @@ interface IShare { */ public function write($target); - /** + /** * Open a writable stream to a remote file and set the cursor to the end of the file * * @param string $target diff --git a/src/Native/NativeShare.php b/src/Native/NativeShare.php index c3abfcf..e980ebf 100644 --- a/src/Native/NativeShare.php +++ b/src/Native/NativeShare.php @@ -250,7 +250,7 @@ class NativeShare extends AbstractShare { /** * Open a writeable stream to a remote file - * Note: This method will truncate the file to 0bytes first + * Note: This method will truncate the file to 0bytes first * * @param string $source * @return resource a writeable stream @@ -264,20 +264,20 @@ class NativeShare extends AbstractShare { return NativeWriteStream::wrap($this->getState(), $handle, 'w', $url); } - /** - * Open a writeable stream and set the cursor to the end of the stream - * - * @param string $source - * @return resource a writeable stream - * - * @throws \Icewind\SMB\Exception\NotFoundException - * @throws \Icewind\SMB\Exception\InvalidTypeException - */ - public function append($source) { - $url = $this->buildUrl($source); - $handle = $this->getState()->open($url, "a"); - return NativeWriteStream::wrap($this->getState(), $handle, "a", $url); - } + /** + * Open a writeable stream and set the cursor to the end of the stream + * + * @param string $source + * @return resource a writeable stream + * + * @throws \Icewind\SMB\Exception\NotFoundException + * @throws \Icewind\SMB\Exception\InvalidTypeException + */ + public function append($source) { + $url = $this->buildUrl($source); + $handle = $this->getState()->open($url, "a"); + return NativeWriteStream::wrap($this->getState(), $handle, "a", $url); + } /** * Get extended attributes for the path @@ -308,8 +308,8 @@ class NativeShare extends AbstractShare { } /** - * Set DOS comaptible node mode - * + * Set DOS comaptible node mode + * * @param string $path * @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL * @return mixed @@ -319,9 +319,9 @@ class NativeShare extends AbstractShare { } /** - * Start smb notify listener - * Note: This is a blocking call - * + * Start smb notify listener + * Note: This is a blocking call + * * @param string $path * @return INotifyHandler */ diff --git a/src/Wrapped/Share.php b/src/Wrapped/Share.php index af1e174..e1e489a 100644 --- a/src/Wrapped/Share.php +++ b/src/Wrapped/Share.php @@ -331,24 +331,24 @@ class Share extends AbstractShare { }); } - /** - * Append to stream - * Note: smbclient does not support it so we use php-libsmbclient - * - * @param string $target - * - * @throws \Icewind\SMB\Exception\DependencyException - * @throws \Icewind\SMB\Exception\NotFoundException - * @throws \Icewind\SMB\Exception\InvalidTypeException + /** + * Append to stream + * Note: smbclient does not support it so we use php-libsmbclient + * + * @param string $target + * + * @throws \Icewind\SMB\Exception\DependencyException + * @throws \Icewind\SMB\Exception\NotFoundException + * @throws \Icewind\SMB\Exception\InvalidTypeException */ - public function append($target) { - if (!NativeServer::available($this->server->getSystem())) { - throw new DependencyException('php-libsmbclient not installed'); - } + public function append($target) { + if (!NativeServer::available($this->server->getSystem())) { + throw new DependencyException('php-libsmbclient not installed'); + } - $share = new NativeShare($this->server, $this->getName()); - return $share->append($target); - } + $share = new NativeShare($this->server, $this->getName()); + return $share->append($target); + } /** * @param string $path diff --git a/tests/AbstractShareTest.php b/tests/AbstractShareTest.php index f1928ca..bff3897 100644 --- a/tests/AbstractShareTest.php +++ b/tests/AbstractShareTest.php @@ -474,20 +474,20 @@ abstract class AbstractShareTest extends TestCase { unlink($tmpFile1); } - public function testAppendStream() { - $fh = $this->share->append($this->root . '/' . $name); - fwrite($fh, 'foo'); - fclose($fh); + public function testAppendStream() { + $fh = $this->share->append($this->root . '/' . $name); + fwrite($fh, 'foo'); + fclose($fh); - $fh = $this->share->append($this->root . '/' . $name); - fwrite($fh, 'bar'); - fclose($fh); + $fh = $this->share->append($this->root . '/' . $name); + fwrite($fh, 'bar'); + fclose($fh); - $tmpFile1 = tempnam('/tmp', 'smb_test_'); - $this->assertEquals('foobar', file_get_contents($tmpFile1)); - $this->share->del($this->root . '/' . $name); - unlink($tmpFile1); - } + $tmpFile1 = tempnam('/tmp', 'smb_test_'); + $this->assertEquals('foobar', file_get_contents($tmpFile1)); + $this->share->del($this->root . '/' . $name); + unlink($tmpFile1); + } /** * @dataProvider invalidPathProvider