Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer 2015-12-08 15:01:20 +00:00 committed by Thomas Müller
parent 7094ed05ad
commit ffc49a24f0
14 changed files with 40 additions and 16 deletions

View File

@ -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]);

View File

@ -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');
}

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -24,7 +24,6 @@ use Test\TestCase;
use OCP\IConfig;
use OCP\IUserManager;
use OCA\Files\BackgroundJob\ScanFiles;
use OCP\ILogger;
/**
* Class ScanFilesTest

View File

@ -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

View File

@ -185,6 +185,9 @@ abstract class StoragesService {
*/
abstract public function getVisibilityType();
/**
* @return integer
*/
protected function getType() {
return DBConfigService::MOUNT_TYPE_ADMIN;
}

View File

@ -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');
}

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -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
*/

View File

@ -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();