From 57209591a3bf5e8ff8e2e487c8ab2792e56479fe Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 18 Jan 2015 23:31:56 +0000 Subject: [PATCH] CS fixes --- src/SftpAdapter.php | 8 ++--- tests/SftpAdapterTests.php | 72 +++++++++++++++++++------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/SftpAdapter.php b/src/SftpAdapter.php index accc7b8..6be3de0 100644 --- a/src/SftpAdapter.php +++ b/src/SftpAdapter.php @@ -201,10 +201,10 @@ protected function normalizeListingObject($path, array $object) $permissions = $this->normalizePermissions($object['permissions']); return [ - 'path' => $path, - 'size' => $object['size'], - 'timestamp' => $object['mtime'], - 'type' => ($object['type'] === 1 ? 'file' : 'dir'), + 'path' => $path, + 'size' => $object['size'], + 'timestamp' => $object['mtime'], + 'type' => ($object['type'] === 1 ? 'file' : 'dir'), 'visibility' => $permissions & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE, ]; } diff --git a/tests/SftpAdapterTests.php b/tests/SftpAdapterTests.php index 51bf6d9..b368962 100644 --- a/tests/SftpAdapterTests.php +++ b/tests/SftpAdapterTests.php @@ -1,8 +1,8 @@ shouldReceive('stat')->andReturn([ - 'type' => NET_SFTP_TYPE_DIRECTORY, - 'mtime' => time(), - 'size' => 20, + 'type' => NET_SFTP_TYPE_DIRECTORY, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ]); @@ -71,9 +71,9 @@ public function testDelete($filesystem, $adapter, $mock) { $mock->shouldReceive('delete')->andReturn(true, false); $mock->shouldReceive('stat')->andReturn([ - 'type' => 1, - 'mtime' => time(), - 'size' => 20, + 'type' => 1, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ]); $this->assertTrue($filesystem->delete('something')); @@ -87,9 +87,9 @@ public function testUpdate(FilesystemInterface $filesystem, $adapter, $mock) { $mock->shouldReceive('put')->andReturn(true, false); $mock->shouldReceive('stat')->andReturn([ - 'type' => NET_SFTP_TYPE_DIRECTORY, - 'mtime' => time(), - 'size' => 20, + 'type' => NET_SFTP_TYPE_DIRECTORY, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ]); $this->assertTrue($filesystem->update('something', 'something')); @@ -122,9 +122,9 @@ public function testSetVisibilityInvalid($filesystem, $adapter, $mock) public function testRename($filesystem, $adapter, $mock) { $mock->shouldReceive('stat')->andReturn([ - 'type' => NET_SFTP_TYPE_DIRECTORY, - 'mtime' => time(), - 'size' => 20, + 'type' => NET_SFTP_TYPE_DIRECTORY, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ], false); $mock->shouldReceive('rename')->andReturn(true); @@ -148,19 +148,19 @@ public function testDeleteDir($filesystem, $adapter, $mock) public function testListContents($filesystem, $adapter, $mock) { $mock->shouldReceive('rawlist')->andReturn(false, [ - '.' => [], + '.' => [], 'dirname' => [ - 'type' => NET_SFTP_TYPE_DIRECTORY, - 'mtime' => time(), - 'size' => 20, + 'type' => NET_SFTP_TYPE_DIRECTORY, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ], ], [ - '..' => [], + '..' => [], 'dirname' => [ - 'type' => 1, - 'mtime' => time(), - 'size' => 20, + 'type' => 1, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ], ]); @@ -190,9 +190,9 @@ public function methodProvider() public function testMetaMethods($filesystem, $adapter, $mock, $method, $type) { $mock->shouldReceive('stat')->andReturn([ - 'type' => NET_SFTP_TYPE_DIRECTORY, - 'mtime' => time(), - 'size' => 20, + 'type' => NET_SFTP_TYPE_DIRECTORY, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ]); $result = $filesystem->{$method}(uniqid().'object.ext'); @@ -205,9 +205,9 @@ public function testMetaMethods($filesystem, $adapter, $mock, $method, $type) public function testGetVisibility($filesystem, $adapter, $mock) { $mock->shouldReceive('stat')->andReturn([ - 'type' => NET_SFTP_TYPE_DIRECTORY, - 'mtime' => time(), - 'size' => 20, + 'type' => NET_SFTP_TYPE_DIRECTORY, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ]); $result = $adapter->getVisibility(uniqid().'object.ext'); @@ -223,9 +223,9 @@ public function testGetVisibility($filesystem, $adapter, $mock) public function testGetTimestamp($filesystem, $adapter, $mock) { $mock->shouldReceive('stat')->andReturn([ - 'type' => NET_SFTP_TYPE_DIRECTORY, - 'mtime' => $time = time(), - 'size' => 20, + 'type' => NET_SFTP_TYPE_DIRECTORY, + 'mtime' => $time = time(), + 'size' => 20, 'permissions' => 0777, ]); $result = $adapter->getTimestamp('object.ext'); @@ -251,9 +251,9 @@ public function testCreateDir($filesystem, $adapter, $mock) public function testRead($filesystem, $adapter, $mock) { $mock->shouldReceive('stat')->andReturn([ - 'type' => 1, - 'mtime' => time(), - 'size' => 20, + 'type' => 1, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ]); $mock->shouldReceive('get')->andReturn('file contents', false); @@ -269,9 +269,9 @@ public function testRead($filesystem, $adapter, $mock) public function testGetMimetype($filesystem, $adapter, $mock) { $mock->shouldReceive('stat')->andReturn([ - 'type' => 1, - 'mtime' => time(), - 'size' => 20, + 'type' => 1, + 'mtime' => time(), + 'size' => 20, 'permissions' => 0777, ]);