From ffc49a24f02639afce362384fc3d6e4a0799d1d7 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 8 Dec 2015 15:01:20 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- .../lib/systemtag/systemtagsbyidcollection.php | 12 ++++++++++++ .../systemtag/systemtagsobjecttypecollection.php | 15 +++++++++++++++ .../tests/unit/systemtag/systemtagmappingnode.php | 4 ---- .../unit/systemtag/systemtagsbyidcollection.php | 1 - .../systemtagsobjectmappingcollection.php | 1 - apps/files/tests/backgroundjob/ScanFilesTest.php | 1 - apps/files_external/lib/personalmount.php | 2 +- apps/files_external/service/storagesservice.php | 3 +++ .../service/userglobalstoragesservice.php | 3 +++ .../tests/service/globalstoragesservicetest.php | 1 - .../features/bootstrap/CapabilitiesContext.php | 2 -- .../middleware/security/securitymiddleware.php | 1 - lib/private/share/mailnotifications.php | 6 +++--- tests/lib/share/MailNotificationsTest.php | 4 +++- 14 files changed, 40 insertions(+), 16 deletions(-) diff --git a/apps/dav/lib/systemtag/systemtagsbyidcollection.php b/apps/dav/lib/systemtag/systemtagsbyidcollection.php index e7b7b6d0ac..79b0aa8fbb 100644 --- a/apps/dav/lib/systemtag/systemtagsbyidcollection.php +++ b/apps/dav/lib/systemtag/systemtagsbyidcollection.php @@ -46,14 +46,23 @@ class SystemTagsByIdCollection implements ICollection { $this->tagManager = $tagManager; } + /** + * @param string $name + */ function createFile($name, $data = null) { throw new Forbidden('Cannot create tags by id'); } + /** + * @param string $name + */ function createDirectory($name) { throw new Forbidden('Permission denied to create collections'); } + /** + * @param string $name + */ function getChild($name) { try { $tags = $this->tagManager->getTagsByIds([$name]); @@ -72,6 +81,9 @@ class SystemTagsByIdCollection implements ICollection { }, $tags); } + /** + * @param string $name + */ function childExists($name) { try { $this->tagManager->getTagsByIds([$name]); diff --git a/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php b/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php index e544073613..543a684c5b 100644 --- a/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php +++ b/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php @@ -61,14 +61,23 @@ class SystemTagsObjectTypeCollection implements ICollection { $this->objectType = $objectType; } + /** + * @param string $name + */ function createFile($name, $data = null) { throw new Forbidden('Permission denied to create nodes'); } + /** + * @param string $name + */ function createDirectory($name) { throw new Forbidden('Permission denied to create collections'); } + /** + * @param string $objectId + */ function getChild($objectId) { return new SystemTagsObjectMappingCollection( $objectId, @@ -83,6 +92,9 @@ class SystemTagsObjectTypeCollection implements ICollection { throw new MethodNotAllowed(); } + /** + * @param string $name + */ function childExists($name) { return true; } @@ -95,6 +107,9 @@ class SystemTagsObjectTypeCollection implements ICollection { return $this->objectType; } + /** + * @param string $name + */ function setName($name) { throw new Forbidden('Permission denied to rename this collection'); } diff --git a/apps/dav/tests/unit/systemtag/systemtagmappingnode.php b/apps/dav/tests/unit/systemtag/systemtagmappingnode.php index 849f7c2fa5..aef62a1acb 100644 --- a/apps/dav/tests/unit/systemtag/systemtagmappingnode.php +++ b/apps/dav/tests/unit/systemtag/systemtagmappingnode.php @@ -9,12 +9,8 @@ namespace OCA\DAV\Tests\Unit\SystemTag; use Sabre\DAV\Exception\NotFound; -use Sabre\DAV\Exception\MethodNotAllowed; -use Sabre\DAV\Exception\Conflict; - use OC\SystemTag\SystemTag; use OCP\SystemTag\TagNotFoundException; -use OCP\SystemTag\TagAlreadyExistsException; class SystemTagMappingNode extends SystemTagNode { diff --git a/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php b/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php index 104ce36603..fa9e42d04f 100644 --- a/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php +++ b/apps/dav/tests/unit/systemtag/systemtagsbyidcollection.php @@ -11,7 +11,6 @@ namespace OCA\DAV\Tests\Unit\SystemTag; use OC\SystemTag\SystemTag; use OCP\SystemTag\TagNotFoundException; -use OCP\SystemTag\TagAlreadyExistsException; class SystemTagsByIdCollection extends \Test\TestCase { diff --git a/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php b/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php index 6e15bb78e7..a9b34f5ae1 100644 --- a/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php +++ b/apps/dav/tests/unit/systemtag/systemtagsobjectmappingcollection.php @@ -11,7 +11,6 @@ namespace OCA\DAV\Tests\Unit\SystemTag; use OC\SystemTag\SystemTag; use OCP\SystemTag\TagNotFoundException; -use OCP\SystemTag\TagAlreadyExistsException; class SystemTagsObjectMappingCollection extends \Test\TestCase { diff --git a/apps/files/tests/backgroundjob/ScanFilesTest.php b/apps/files/tests/backgroundjob/ScanFilesTest.php index 907cad64f9..087696f0cf 100644 --- a/apps/files/tests/backgroundjob/ScanFilesTest.php +++ b/apps/files/tests/backgroundjob/ScanFilesTest.php @@ -24,7 +24,6 @@ use Test\TestCase; use OCP\IConfig; use OCP\IUserManager; use OCA\Files\BackgroundJob\ScanFiles; -use OCP\ILogger; /** * Class ScanFilesTest diff --git a/apps/files_external/lib/personalmount.php b/apps/files_external/lib/personalmount.php index f81dee5be1..34ae516ea5 100644 --- a/apps/files_external/lib/personalmount.php +++ b/apps/files_external/lib/personalmount.php @@ -40,7 +40,7 @@ class PersonalMount extends MountPoint implements MoveableMount { /** * @param UserStoragesService $storagesService * @param int $storageId - * @param string|\OC\Files\Storage\Storage $storage + * @param \OCP\Files\Storage $storage * @param string $mountpoint * @param array $arguments (optional) configuration for the storage backend * @param \OCP\Files\Storage\IStorageFactory $loader diff --git a/apps/files_external/service/storagesservice.php b/apps/files_external/service/storagesservice.php index 9be6498435..97f79c1332 100644 --- a/apps/files_external/service/storagesservice.php +++ b/apps/files_external/service/storagesservice.php @@ -185,6 +185,9 @@ abstract class StoragesService { */ abstract public function getVisibilityType(); + /** + * @return integer + */ protected function getType() { return DBConfigService::MOUNT_TYPE_ADMIN; } diff --git a/apps/files_external/service/userglobalstoragesservice.php b/apps/files_external/service/userglobalstoragesservice.php index cb49f0f672..e58815f8a7 100644 --- a/apps/files_external/service/userglobalstoragesservice.php +++ b/apps/files_external/service/userglobalstoragesservice.php @@ -89,6 +89,9 @@ class UserGlobalStoragesService extends GlobalStoragesService { throw new \DomainException('UserGlobalStoragesService writing disallowed'); } + /** + * @param integer $id + */ public function removeStorage($id) { throw new \DomainException('UserGlobalStoragesService writing disallowed'); } diff --git a/apps/files_external/tests/service/globalstoragesservicetest.php b/apps/files_external/tests/service/globalstoragesservicetest.php index 7c77616563..e620b05a51 100644 --- a/apps/files_external/tests/service/globalstoragesservicetest.php +++ b/apps/files_external/tests/service/globalstoragesservicetest.php @@ -23,7 +23,6 @@ namespace OCA\Files_external\Tests\Service; use \OC\Files\Filesystem; -use OCA\Files_External\Service\DBConfigService; use \OCA\Files_external\Service\GlobalStoragesService; use \OCA\Files_external\NotFoundException; use \OCA\Files_external\Lib\StorageConfig; diff --git a/build/integration/features/bootstrap/CapabilitiesContext.php b/build/integration/features/bootstrap/CapabilitiesContext.php index 4e200bdf42..1b0015dce7 100644 --- a/build/integration/features/bootstrap/CapabilitiesContext.php +++ b/build/integration/features/bootstrap/CapabilitiesContext.php @@ -2,8 +2,6 @@ use Behat\Behat\Context\Context; use Behat\Behat\Context\SnippetAcceptingContext; -use GuzzleHttp\Client; -use GuzzleHttp\Message\ResponseInterface; require __DIR__ . '/../../vendor/autoload.php'; diff --git a/lib/private/appframework/middleware/security/securitymiddleware.php b/lib/private/appframework/middleware/security/securitymiddleware.php index d0b7202a36..725ce689b4 100644 --- a/lib/private/appframework/middleware/security/securitymiddleware.php +++ b/lib/private/appframework/middleware/security/securitymiddleware.php @@ -27,7 +27,6 @@ namespace OC\AppFramework\Middleware\Security; -use OC\AppFramework\Http; use OC\Appframework\Middleware\Security\Exceptions\AppNotEnabledException; use OC\Appframework\Middleware\Security\Exceptions\CrossSiteRequestForgeryException; use OC\Appframework\Middleware\Security\Exceptions\NotAdminException; diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php index 4d282158ba..f071c7f3a3 100644 --- a/lib/private/share/mailnotifications.php +++ b/lib/private/share/mailnotifications.php @@ -170,7 +170,7 @@ class MailNotifications { * @param string $filename the shared file * @param string $link the public link * @param int $expiration expiration date (timestamp) - * @return array $result of failed recipients + * @return string[] $result of failed recipients */ public function sendLinkShareMail($recipient, $filename, $link, $expiration) { $subject = (string)$this->l->t('%s shared »%s« with you', [$this->senderDisplayName, $filename]); @@ -232,8 +232,8 @@ class MailNotifications { } /** - * @param $itemSource - * @param $itemType + * @param string $itemSource + * @param string $itemType * @param IUser $recipient * @return array */ diff --git a/tests/lib/share/MailNotificationsTest.php b/tests/lib/share/MailNotificationsTest.php index 8684886e79..66bec8653f 100644 --- a/tests/lib/share/MailNotificationsTest.php +++ b/tests/lib/share/MailNotificationsTest.php @@ -20,7 +20,6 @@ */ use OC\Share\MailNotifications; -use OCP\IConfig; use OCP\IL10N; use OCP\IUser; use OCP\Mail\IMailer; @@ -234,6 +233,9 @@ class MailNotificationsTest extends \Test\TestCase { } + /** + * @param string $subject + */ protected function setupMailerMock($subject, $to, $exceptionOnSend = true) { $message = $this->getMockBuilder('\OC\Mail\Message') ->disableOriginalConstructor()->getMock();