spaces to tab fix

This commit is contained in:
Raffael Sahli 2018-08-24 16:37:47 +02:00
commit 8511544198
4 changed files with 53 additions and 53 deletions

View file

@ -52,7 +52,7 @@ interface IShare {
/** /**
* Open a writable stream to a remote file * 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 * @param string $target
* @return resource a write only stream to upload a remote file * @return resource a write only stream to upload a remote file
@ -62,7 +62,7 @@ interface IShare {
*/ */
public function write($target); public function write($target);
/** /**
* Open a writable stream to a remote file and set the cursor to the end of the file * Open a writable stream to a remote file and set the cursor to the end of the file
* *
* @param string $target * @param string $target

View file

@ -250,7 +250,7 @@ class NativeShare extends AbstractShare {
/** /**
* Open a writeable stream to a remote file * 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 * @param string $source
* @return resource a writeable stream * @return resource a writeable stream
@ -264,20 +264,20 @@ class NativeShare extends AbstractShare {
return NativeWriteStream::wrap($this->getState(), $handle, 'w', $url); return NativeWriteStream::wrap($this->getState(), $handle, 'w', $url);
} }
/** /**
* Open a writeable stream and set the cursor to the end of the stream * Open a writeable stream and set the cursor to the end of the stream
* *
* @param string $source * @param string $source
* @return resource a writeable stream * @return resource a writeable stream
* *
* @throws \Icewind\SMB\Exception\NotFoundException * @throws \Icewind\SMB\Exception\NotFoundException
* @throws \Icewind\SMB\Exception\InvalidTypeException * @throws \Icewind\SMB\Exception\InvalidTypeException
*/ */
public function append($source) { public function append($source) {
$url = $this->buildUrl($source); $url = $this->buildUrl($source);
$handle = $this->getState()->open($url, "a"); $handle = $this->getState()->open($url, "a");
return NativeWriteStream::wrap($this->getState(), $handle, "a", $url); return NativeWriteStream::wrap($this->getState(), $handle, "a", $url);
} }
/** /**
* Get extended attributes for the path * 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 string $path
* @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL * @param int $mode a combination of FileInfo::MODE_READONLY, FileInfo::MODE_ARCHIVE, FileInfo::MODE_SYSTEM and FileInfo::MODE_HIDDEN, FileInfo::NORMAL
* @return mixed * @return mixed
@ -319,9 +319,9 @@ class NativeShare extends AbstractShare {
} }
/** /**
* Start smb notify listener * Start smb notify listener
* Note: This is a blocking call * Note: This is a blocking call
* *
* @param string $path * @param string $path
* @return INotifyHandler * @return INotifyHandler
*/ */

View file

@ -331,24 +331,24 @@ class Share extends AbstractShare {
}); });
} }
/** /**
* Append to stream * Append to stream
* Note: smbclient does not support it so we use php-libsmbclient * Note: smbclient does not support it so we use php-libsmbclient
* *
* @param string $target * @param string $target
* *
* @throws \Icewind\SMB\Exception\DependencyException * @throws \Icewind\SMB\Exception\DependencyException
* @throws \Icewind\SMB\Exception\NotFoundException * @throws \Icewind\SMB\Exception\NotFoundException
* @throws \Icewind\SMB\Exception\InvalidTypeException * @throws \Icewind\SMB\Exception\InvalidTypeException
*/ */
public function append($target) { public function append($target) {
if (!NativeServer::available($this->server->getSystem())) { if (!NativeServer::available($this->server->getSystem())) {
throw new DependencyException('php-libsmbclient not installed'); throw new DependencyException('php-libsmbclient not installed');
} }
$share = new NativeShare($this->server, $this->getName()); $share = new NativeShare($this->server, $this->getName());
return $share->append($target); return $share->append($target);
} }
/** /**
* @param string $path * @param string $path

View file

@ -474,20 +474,20 @@ abstract class AbstractShareTest extends TestCase {
unlink($tmpFile1); unlink($tmpFile1);
} }
public function testAppendStream() { public function testAppendStream() {
$fh = $this->share->append($this->root . '/' . $name); $fh = $this->share->append($this->root . '/' . $name);
fwrite($fh, 'foo'); fwrite($fh, 'foo');
fclose($fh); fclose($fh);
$fh = $this->share->append($this->root . '/' . $name); $fh = $this->share->append($this->root . '/' . $name);
fwrite($fh, 'bar'); fwrite($fh, 'bar');
fclose($fh); fclose($fh);
$tmpFile1 = tempnam('/tmp', 'smb_test_'); $tmpFile1 = tempnam('/tmp', 'smb_test_');
$this->assertEquals('foobar', file_get_contents($tmpFile1)); $this->assertEquals('foobar', file_get_contents($tmpFile1));
$this->share->del($this->root . '/' . $name); $this->share->del($this->root . '/' . $name);
unlink($tmpFile1); unlink($tmpFile1);
} }
/** /**
* @dataProvider invalidPathProvider * @dataProvider invalidPathProvider