Passed
Push — master ( 7b8289...9c209a )
by Christoph
12:20 queued 36s
created
lib/public/Log/IFileBased.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@
 block discarded – undo
31 31
  * @since 14.0.0
32 32
  */
33 33
 interface IFileBased {
34
-	/**
35
-	 * @since 14.0.0
36
-	 */
37
-	public function getLogFilePath():string;
34
+    /**
35
+     * @since 14.0.0
36
+     */
37
+    public function getLogFilePath():string;
38 38
 
39
-	/**
40
-	 * @since 14.0.0
41
-	 */
42
-	public function getEntries(int $limit=50, int $offset=0): array;
39
+    /**
40
+     * @since 14.0.0
41
+     */
42
+    public function getEntries(int $limit=50, int $offset=0): array;
43 43
 }
Please login to merge, or discard this patch.
lib/public/Log/RotationTrait.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -32,40 +32,40 @@
 block discarded – undo
32 32
  */
33 33
 trait RotationTrait {
34 34
 
35
-	/**
36
-	 * @var string
37
-	 * @since 14.0.0
38
-	 */
39
-	protected $filePath;
35
+    /**
36
+     * @var string
37
+     * @since 14.0.0
38
+     */
39
+    protected $filePath;
40 40
 
41
-	/**
42
-	 * @var int
43
-	 * @since 14.0.0
44
-	 */
45
-	protected $maxSize;
41
+    /**
42
+     * @var int
43
+     * @since 14.0.0
44
+     */
45
+    protected $maxSize;
46 46
 
47
-	/**
48
-	 * @return string the resulting new filepath
49
-	 * @since 14.0.0
50
-	 */
51
-	protected function rotate():string {
52
-		$rotatedFile = $this->filePath.'.1';
53
-		rename($this->filePath, $rotatedFile);
54
-		return $rotatedFile;
55
-	}
47
+    /**
48
+     * @return string the resulting new filepath
49
+     * @since 14.0.0
50
+     */
51
+    protected function rotate():string {
52
+        $rotatedFile = $this->filePath.'.1';
53
+        rename($this->filePath, $rotatedFile);
54
+        return $rotatedFile;
55
+    }
56 56
 
57
-	/**
58
-	 * @return bool
59
-	 * @since 14.0.0
60
-	 */
61
-	protected function shouldRotateBySize():bool {
62
-		if ((int)$this->maxSize > 0) {
63
-			$filesize = @filesize($this->filePath);
64
-			if ($filesize >= (int)$this->maxSize) {
65
-				return true;
66
-			}
67
-		}
68
-		return false;
69
-	}
57
+    /**
58
+     * @return bool
59
+     * @since 14.0.0
60
+     */
61
+    protected function shouldRotateBySize():bool {
62
+        if ((int)$this->maxSize > 0) {
63
+            $filesize = @filesize($this->filePath);
64
+            if ($filesize >= (int)$this->maxSize) {
65
+                return true;
66
+            }
67
+        }
68
+        return false;
69
+    }
70 70
 
71 71
 }
Please login to merge, or discard this patch.
apps/dav/lib/Controller/DirectController.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -39,75 +39,75 @@
 block discarded – undo
39 39
 
40 40
 class DirectController extends OCSController {
41 41
 
42
-	/** @var IRootFolder */
43
-	private $rootFolder;
42
+    /** @var IRootFolder */
43
+    private $rootFolder;
44 44
 
45
-	/** @var string */
46
-	private $userId;
45
+    /** @var string */
46
+    private $userId;
47 47
 
48
-	/** @var DirectMapper */
49
-	private $mapper;
48
+    /** @var DirectMapper */
49
+    private $mapper;
50 50
 
51
-	/** @var ISecureRandom */
52
-	private $random;
51
+    /** @var ISecureRandom */
52
+    private $random;
53 53
 
54
-	/** @var ITimeFactory */
55
-	private $timeFactory;
54
+    /** @var ITimeFactory */
55
+    private $timeFactory;
56 56
 
57
-	/** @var IURLGenerator */
58
-	private $urlGenerator;
57
+    /** @var IURLGenerator */
58
+    private $urlGenerator;
59 59
 
60 60
 
61
-	public function __construct(string $appName,
62
-								IRequest $request,
63
-								IRootFolder $rootFolder,
64
-								string $userId,
65
-								DirectMapper $mapper,
66
-								ISecureRandom $random,
67
-								ITimeFactory $timeFactory,
68
-								IURLGenerator $urlGenerator) {
69
-		parent::__construct($appName, $request);
61
+    public function __construct(string $appName,
62
+                                IRequest $request,
63
+                                IRootFolder $rootFolder,
64
+                                string $userId,
65
+                                DirectMapper $mapper,
66
+                                ISecureRandom $random,
67
+                                ITimeFactory $timeFactory,
68
+                                IURLGenerator $urlGenerator) {
69
+        parent::__construct($appName, $request);
70 70
 
71
-		$this->rootFolder = $rootFolder;
72
-		$this->userId = $userId;
73
-		$this->mapper = $mapper;
74
-		$this->random = $random;
75
-		$this->timeFactory = $timeFactory;
76
-		$this->urlGenerator = $urlGenerator;
77
-	}
71
+        $this->rootFolder = $rootFolder;
72
+        $this->userId = $userId;
73
+        $this->mapper = $mapper;
74
+        $this->random = $random;
75
+        $this->timeFactory = $timeFactory;
76
+        $this->urlGenerator = $urlGenerator;
77
+    }
78 78
 
79
-	/**
80
-	 * @NoAdminRequired
81
-	 */
82
-	public function getUrl(int $fileId): DataResponse {
83
-		$userFolder = $this->rootFolder->getUserFolder($this->userId);
79
+    /**
80
+     * @NoAdminRequired
81
+     */
82
+    public function getUrl(int $fileId): DataResponse {
83
+        $userFolder = $this->rootFolder->getUserFolder($this->userId);
84 84
 
85
-		$files = $userFolder->getById($fileId);
85
+        $files = $userFolder->getById($fileId);
86 86
 
87
-		if ($files === []) {
88
-			throw new OCSNotFoundException();
89
-		}
87
+        if ($files === []) {
88
+            throw new OCSNotFoundException();
89
+        }
90 90
 
91
-		$file = array_shift($files);
92
-		if (!($file instanceof File)) {
93
-			throw new OCSBadRequestException('Direct download only works for files');
94
-		}
91
+        $file = array_shift($files);
92
+        if (!($file instanceof File)) {
93
+            throw new OCSBadRequestException('Direct download only works for files');
94
+        }
95 95
 
96
-		//TODO: at some point we should use the directdownlaod function of storages
97
-		$direct = new Direct();
98
-		$direct->setUserId($this->userId);
99
-		$direct->setFileId($fileId);
96
+        //TODO: at some point we should use the directdownlaod function of storages
97
+        $direct = new Direct();
98
+        $direct->setUserId($this->userId);
99
+        $direct->setFileId($fileId);
100 100
 
101
-		$token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
102
-		$direct->setToken($token);
103
-		$direct->setExpiration($this->timeFactory->getTime() + 60 * 60 * 8);
101
+        $token = $this->random->generate(60, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
102
+        $direct->setToken($token);
103
+        $direct->setExpiration($this->timeFactory->getTime() + 60 * 60 * 8);
104 104
 
105
-		$this->mapper->insert($direct);
105
+        $this->mapper->insert($direct);
106 106
 
107
-		$url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/'.$token);
107
+        $url = $this->urlGenerator->getAbsoluteURL('remote.php/direct/'.$token);
108 108
 
109
-		return new DataResponse([
110
-			'url' => $url,
111
-		]);
112
-	}
109
+        return new DataResponse([
110
+            'url' => $url,
111
+        ]);
112
+    }
113 113
 }
Please login to merge, or discard this patch.
apps/dav/lib/Direct/DirectHome.php 1 patch
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -37,82 +37,82 @@
 block discarded – undo
37 37
 
38 38
 class DirectHome implements ICollection {
39 39
 
40
-	/** @var IRootFolder */
41
-	private $rootFolder;
42
-
43
-	/** @var DirectMapper */
44
-	private $mapper;
45
-
46
-	/** @var ITimeFactory */
47
-	private $timeFactory;
48
-
49
-	/** @var Throttler */
50
-	private $throttler;
51
-
52
-	/** @var IRequest */
53
-	private $request;
54
-
55
-	public function __construct(IRootFolder $rootFolder,
56
-								DirectMapper $mapper,
57
-								ITimeFactory $timeFactory,
58
-								Throttler $throttler,
59
-								IRequest $request) {
60
-		$this->rootFolder = $rootFolder;
61
-		$this->mapper = $mapper;
62
-		$this->timeFactory = $timeFactory;
63
-		$this->throttler = $throttler;
64
-		$this->request = $request;
65
-	}
66
-
67
-	public function createFile($name, $data = null) {
68
-		throw new Forbidden();
69
-	}
70
-
71
-	public function createDirectory($name) {
72
-		throw new Forbidden();
73
-	}
74
-
75
-	public function getChild($name): DirectFile {
76
-		try {
77
-			$direct = $this->mapper->getByToken($name);
78
-
79
-			// Expired
80
-			if ($direct->getExpiration() < $this->timeFactory->getTime()) {
81
-				throw new NotFound();
82
-			}
83
-
84
-			return new DirectFile($direct, $this->rootFolder);
85
-		} catch (DoesNotExistException $e) {
86
-			// Since the token space is so huge only throttle on non exsisting token
87
-			$this->throttler->registerAttempt('directlink', $this->request->getRemoteAddress());
88
-			$this->throttler->sleepDelay($this->request->getRemoteAddress(), 'directlink');
89
-
90
-			throw new NotFound();
91
-		}
92
-	}
93
-
94
-	public function getChildren() {
95
-		throw new MethodNotAllowed('Listing members of this collection is disabled');
96
-	}
97
-
98
-	public function childExists($name): bool {
99
-		return false;
100
-	}
101
-
102
-	public function delete() {
103
-		throw new Forbidden();
104
-	}
105
-
106
-	public function getName(): string {
107
-		return 'direct';
108
-	}
109
-
110
-	public function setName($name) {
111
-		throw new Forbidden();
112
-	}
113
-
114
-	public function getLastModified(): int {
115
-		return 0;
116
-	}
40
+    /** @var IRootFolder */
41
+    private $rootFolder;
42
+
43
+    /** @var DirectMapper */
44
+    private $mapper;
45
+
46
+    /** @var ITimeFactory */
47
+    private $timeFactory;
48
+
49
+    /** @var Throttler */
50
+    private $throttler;
51
+
52
+    /** @var IRequest */
53
+    private $request;
54
+
55
+    public function __construct(IRootFolder $rootFolder,
56
+                                DirectMapper $mapper,
57
+                                ITimeFactory $timeFactory,
58
+                                Throttler $throttler,
59
+                                IRequest $request) {
60
+        $this->rootFolder = $rootFolder;
61
+        $this->mapper = $mapper;
62
+        $this->timeFactory = $timeFactory;
63
+        $this->throttler = $throttler;
64
+        $this->request = $request;
65
+    }
66
+
67
+    public function createFile($name, $data = null) {
68
+        throw new Forbidden();
69
+    }
70
+
71
+    public function createDirectory($name) {
72
+        throw new Forbidden();
73
+    }
74
+
75
+    public function getChild($name): DirectFile {
76
+        try {
77
+            $direct = $this->mapper->getByToken($name);
78
+
79
+            // Expired
80
+            if ($direct->getExpiration() < $this->timeFactory->getTime()) {
81
+                throw new NotFound();
82
+            }
83
+
84
+            return new DirectFile($direct, $this->rootFolder);
85
+        } catch (DoesNotExistException $e) {
86
+            // Since the token space is so huge only throttle on non exsisting token
87
+            $this->throttler->registerAttempt('directlink', $this->request->getRemoteAddress());
88
+            $this->throttler->sleepDelay($this->request->getRemoteAddress(), 'directlink');
89
+
90
+            throw new NotFound();
91
+        }
92
+    }
93
+
94
+    public function getChildren() {
95
+        throw new MethodNotAllowed('Listing members of this collection is disabled');
96
+    }
97
+
98
+    public function childExists($name): bool {
99
+        return false;
100
+    }
101
+
102
+    public function delete() {
103
+        throw new Forbidden();
104
+    }
105
+
106
+    public function getName(): string {
107
+        return 'direct';
108
+    }
109
+
110
+    public function setName($name) {
111
+        throw new Forbidden();
112
+    }
113
+
114
+    public function getLastModified(): int {
115
+        return 0;
116
+    }
117 117
 
118 118
 }
Please login to merge, or discard this patch.
lib/private/Repair/NC14/AddPreviewBackgroundCleanupJob.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -30,19 +30,19 @@
 block discarded – undo
30 30
 
31 31
 class AddPreviewBackgroundCleanupJob implements IRepairStep {
32 32
 
33
-	/** @var IJobList */
34
-	private $jobList;
33
+    /** @var IJobList */
34
+    private $jobList;
35 35
 
36
-	public function __construct(IJobList $jobList) {
37
-		$this->jobList = $jobList;
38
-	}
36
+    public function __construct(IJobList $jobList) {
37
+        $this->jobList = $jobList;
38
+    }
39 39
 
40
-	public function getName(): string {
41
-		return 'Add preview background cleanup job';
42
-	}
40
+    public function getName(): string {
41
+        return 'Add preview background cleanup job';
42
+    }
43 43
 
44
-	public function run(IOutput $output) {
45
-		$this->jobList->add(BackgroundCleanupJob::class);
46
-	}
44
+    public function run(IOutput $output) {
45
+        $this->jobList->add(BackgroundCleanupJob::class);
46
+    }
47 47
 
48 48
 }
Please login to merge, or discard this patch.
lib/private/Preview/Watcher.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -36,39 +36,39 @@
 block discarded – undo
36 36
  * Class that will watch filesystem activity and remove previews as needed.
37 37
  */
38 38
 class Watcher {
39
-	/** @var IAppData */
40
-	private $appData;
39
+    /** @var IAppData */
40
+    private $appData;
41 41
 
42
-	/**
43
-	 * Watcher constructor.
44
-	 *
45
-	 * @param IAppData $appData
46
-	 */
47
-	public function __construct(IAppData $appData) {
48
-		$this->appData = $appData;
49
-	}
42
+    /**
43
+     * Watcher constructor.
44
+     *
45
+     * @param IAppData $appData
46
+     */
47
+    public function __construct(IAppData $appData) {
48
+        $this->appData = $appData;
49
+    }
50 50
 
51
-	public function postWrite(Node $node) {
52
-		$this->deleteNode($node);
53
-	}
51
+    public function postWrite(Node $node) {
52
+        $this->deleteNode($node);
53
+    }
54 54
 
55
-	protected function deleteNode(Node $node) {
56
-		// We only handle files
57
-		if ($node instanceof Folder) {
58
-			return;
59
-		}
55
+    protected function deleteNode(Node $node) {
56
+        // We only handle files
57
+        if ($node instanceof Folder) {
58
+            return;
59
+        }
60 60
 
61
-		try {
62
-			$folder = $this->appData->getFolder((string)$node->getId());
63
-			$folder->delete();
64
-		} catch (NotFoundException $e) {
65
-			//Nothing to do
66
-		}
67
-	}
61
+        try {
62
+            $folder = $this->appData->getFolder((string)$node->getId());
63
+            $folder->delete();
64
+        } catch (NotFoundException $e) {
65
+            //Nothing to do
66
+        }
67
+    }
68 68
 
69
-	public function versionRollback(array $data) {
70
-		if (isset($data['node'])) {
71
-			$this->deleteNode($data['node']);
72
-		}
73
-	}
69
+    public function versionRollback(array $data) {
70
+        if (isset($data['node'])) {
71
+            $this->deleteNode($data['node']);
72
+        }
73
+    }
74 74
 }
Please login to merge, or discard this patch.
lib/private/Preview/WatcherConnector.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -29,39 +29,39 @@
 block discarded – undo
29 29
 
30 30
 class WatcherConnector {
31 31
 
32
-	/** @var IRootFolder */
33
-	private $root;
32
+    /** @var IRootFolder */
33
+    private $root;
34 34
 
35
-	/** @var SystemConfig */
36
-	private $config;
35
+    /** @var SystemConfig */
36
+    private $config;
37 37
 
38
-	/**
39
-	 * WatcherConnector constructor.
40
-	 *
41
-	 * @param IRootFolder $root
42
-	 * @param SystemConfig $config
43
-	 */
44
-	public function __construct(IRootFolder $root,
45
-								SystemConfig $config) {
46
-		$this->root = $root;
47
-		$this->config = $config;
48
-	}
38
+    /**
39
+     * WatcherConnector constructor.
40
+     *
41
+     * @param IRootFolder $root
42
+     * @param SystemConfig $config
43
+     */
44
+    public function __construct(IRootFolder $root,
45
+                                SystemConfig $config) {
46
+        $this->root = $root;
47
+        $this->config = $config;
48
+    }
49 49
 
50
-	/**
51
-	 * @return Watcher
52
-	 */
53
-	private function getWatcher(): Watcher {
54
-		return \OC::$server->query(Watcher::class);
55
-	}
50
+    /**
51
+     * @return Watcher
52
+     */
53
+    private function getWatcher(): Watcher {
54
+        return \OC::$server->query(Watcher::class);
55
+    }
56 56
 
57
-	public function connectWatcher() {
58
-		// Do not connect if we are not setup yet!
59
-		if ($this->config->getValue('instanceid', null) !== null) {
60
-			$this->root->listen('\OC\Files', 'postWrite', function (Node $node) {
61
-				$this->getWatcher()->postWrite($node);
62
-			});
57
+    public function connectWatcher() {
58
+        // Do not connect if we are not setup yet!
59
+        if ($this->config->getValue('instanceid', null) !== null) {
60
+            $this->root->listen('\OC\Files', 'postWrite', function (Node $node) {
61
+                $this->getWatcher()->postWrite($node);
62
+            });
63 63
 
64
-			\OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback');
65
-		}
66
-	}
64
+            \OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback');
65
+        }
66
+    }
67 67
 }
Please login to merge, or discard this patch.
lib/public/Group/Backend/ICountDisabledInGroup.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@
 block discarded – undo
29 29
  */
30 30
 interface ICountDisabledInGroup {
31 31
 
32
-	/**
33
-	 * @since 14.0.0
34
-	 */
35
-	public function countDisabledInGroup(string $gid): int;
32
+    /**
33
+     * @since 14.0.0
34
+     */
35
+    public function countDisabledInGroup(string $gid): int;
36 36
 }
Please login to merge, or discard this patch.
core/Migrations/Version14000Date20180516101403.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -29,28 +29,28 @@
 block discarded – undo
29 29
 
30 30
 class Version14000Date20180516101403 extends SimpleMigrationStep {
31 31
 
32
-	/**
33
-	 * @param IOutput $output
34
-	 * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
35
-	 * @param array $options
36
-	 * @return null|ISchemaWrapper
37
-	 */
38
-	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
39
-		/** @var ISchemaWrapper $schema */
40
-		$schema = $schemaClosure();
32
+    /**
33
+     * @param IOutput $output
34
+     * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
35
+     * @param array $options
36
+     * @return null|ISchemaWrapper
37
+     */
38
+    public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
39
+        /** @var ISchemaWrapper $schema */
40
+        $schema = $schemaClosure();
41 41
 
42
-		$table = $schema->getTable('authtoken');
42
+        $table = $schema->getTable('authtoken');
43 43
 
44
-		if (!$table->hasColumn('expires')) {
45
-			$table->addColumn('expires', 'integer', [
46
-				'notnull' => false,
47
-				'length' => 4,
48
-				'default' => null,
49
-				'unsigned' => true,
50
-			]);
44
+        if (!$table->hasColumn('expires')) {
45
+            $table->addColumn('expires', 'integer', [
46
+                'notnull' => false,
47
+                'length' => 4,
48
+                'default' => null,
49
+                'unsigned' => true,
50
+            ]);
51 51
 
52
-			return $schema;
53
-		}
54
-		return null;
55
-	}
52
+            return $schema;
53
+        }
54
+        return null;
55
+    }
56 56
 }
Please login to merge, or discard this patch.