Passed
Push — master ( 078203...c81798 )
by Joas
14:40 queued 14s
created
apps/files_versions/lib/Versions/Version.php 1 patch
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -26,88 +26,88 @@
 block discarded – undo
26 26
 use OCP\IUser;
27 27
 
28 28
 class Version implements IVersion {
29
-	/** @var int */
30
-	private $timestamp;
31
-
32
-	/** @var int|string */
33
-	private $revisionId;
34
-
35
-	/** @var string */
36
-	private $name;
37
-
38
-	/** @var int */
39
-	private $size;
40
-
41
-	/** @var string */
42
-	private $mimetype;
43
-
44
-	/** @var string */
45
-	private $path;
46
-
47
-	/** @var FileInfo */
48
-	private $sourceFileInfo;
49
-
50
-	/** @var IVersionBackend */
51
-	private $backend;
52
-
53
-	/** @var IUser */
54
-	private $user;
55
-
56
-	public function __construct(
57
-		int $timestamp,
58
-		$revisionId,
59
-		string $name,
60
-		int $size,
61
-		string $mimetype,
62
-		string $path,
63
-		FileInfo $sourceFileInfo,
64
-		IVersionBackend $backend,
65
-		IUser $user
66
-	) {
67
-		$this->timestamp = $timestamp;
68
-		$this->revisionId = $revisionId;
69
-		$this->name = $name;
70
-		$this->size = $size;
71
-		$this->mimetype = $mimetype;
72
-		$this->path = $path;
73
-		$this->sourceFileInfo = $sourceFileInfo;
74
-		$this->backend = $backend;
75
-		$this->user = $user;
76
-	}
77
-
78
-	public function getBackend(): IVersionBackend {
79
-		return $this->backend;
80
-	}
81
-
82
-	public function getSourceFile(): FileInfo {
83
-		return $this->sourceFileInfo;
84
-	}
85
-
86
-	public function getRevisionId() {
87
-		return $this->revisionId;
88
-	}
89
-
90
-	public function getTimestamp(): int {
91
-		return $this->timestamp;
92
-	}
93
-
94
-	public function getSize(): int {
95
-		return $this->size;
96
-	}
97
-
98
-	public function getSourceFileName(): string {
99
-		return $this->name;
100
-	}
101
-
102
-	public function getMimeType(): string {
103
-		return $this->mimetype;
104
-	}
105
-
106
-	public function getVersionPath(): string {
107
-		return $this->path;
108
-	}
109
-
110
-	public function getUser(): IUser {
111
-		return $this->user;
112
-	}
29
+    /** @var int */
30
+    private $timestamp;
31
+
32
+    /** @var int|string */
33
+    private $revisionId;
34
+
35
+    /** @var string */
36
+    private $name;
37
+
38
+    /** @var int */
39
+    private $size;
40
+
41
+    /** @var string */
42
+    private $mimetype;
43
+
44
+    /** @var string */
45
+    private $path;
46
+
47
+    /** @var FileInfo */
48
+    private $sourceFileInfo;
49
+
50
+    /** @var IVersionBackend */
51
+    private $backend;
52
+
53
+    /** @var IUser */
54
+    private $user;
55
+
56
+    public function __construct(
57
+        int $timestamp,
58
+        $revisionId,
59
+        string $name,
60
+        int $size,
61
+        string $mimetype,
62
+        string $path,
63
+        FileInfo $sourceFileInfo,
64
+        IVersionBackend $backend,
65
+        IUser $user
66
+    ) {
67
+        $this->timestamp = $timestamp;
68
+        $this->revisionId = $revisionId;
69
+        $this->name = $name;
70
+        $this->size = $size;
71
+        $this->mimetype = $mimetype;
72
+        $this->path = $path;
73
+        $this->sourceFileInfo = $sourceFileInfo;
74
+        $this->backend = $backend;
75
+        $this->user = $user;
76
+    }
77
+
78
+    public function getBackend(): IVersionBackend {
79
+        return $this->backend;
80
+    }
81
+
82
+    public function getSourceFile(): FileInfo {
83
+        return $this->sourceFileInfo;
84
+    }
85
+
86
+    public function getRevisionId() {
87
+        return $this->revisionId;
88
+    }
89
+
90
+    public function getTimestamp(): int {
91
+        return $this->timestamp;
92
+    }
93
+
94
+    public function getSize(): int {
95
+        return $this->size;
96
+    }
97
+
98
+    public function getSourceFileName(): string {
99
+        return $this->name;
100
+    }
101
+
102
+    public function getMimeType(): string {
103
+        return $this->mimetype;
104
+    }
105
+
106
+    public function getVersionPath(): string {
107
+        return $this->path;
108
+    }
109
+
110
+    public function getUser(): IUser {
111
+        return $this->user;
112
+    }
113 113
 }
Please login to merge, or discard this patch.
apps/files_versions/lib/Versions/IVersion.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -29,71 +29,71 @@
 block discarded – undo
29 29
  * @since 15.0.0
30 30
  */
31 31
 interface IVersion {
32
-	/**
33
-	 * @return IVersionBackend
34
-	 * @since 15.0.0
35
-	 */
36
-	public function getBackend(): IVersionBackend;
32
+    /**
33
+     * @return IVersionBackend
34
+     * @since 15.0.0
35
+     */
36
+    public function getBackend(): IVersionBackend;
37 37
 
38
-	/**
39
-	 * Get the file info of the source file
40
-	 *
41
-	 * @return FileInfo
42
-	 * @since 15.0.0
43
-	 */
44
-	public function getSourceFile(): FileInfo;
38
+    /**
39
+     * Get the file info of the source file
40
+     *
41
+     * @return FileInfo
42
+     * @since 15.0.0
43
+     */
44
+    public function getSourceFile(): FileInfo;
45 45
 
46
-	/**
47
-	 * Get the id of the revision for the file
48
-	 *
49
-	 * @return int|string
50
-	 * @since 15.0.0
51
-	 */
52
-	public function getRevisionId();
46
+    /**
47
+     * Get the id of the revision for the file
48
+     *
49
+     * @return int|string
50
+     * @since 15.0.0
51
+     */
52
+    public function getRevisionId();
53 53
 
54
-	/**
55
-	 * Get the timestamp this version was created
56
-	 *
57
-	 * @return int
58
-	 * @since 15.0.0
59
-	 */
60
-	public function getTimestamp(): int;
54
+    /**
55
+     * Get the timestamp this version was created
56
+     *
57
+     * @return int
58
+     * @since 15.0.0
59
+     */
60
+    public function getTimestamp(): int;
61 61
 
62
-	/**
63
-	 * Get the size of this version
64
-	 *
65
-	 * @return int
66
-	 * @since 15.0.0
67
-	 */
68
-	public function getSize(): int;
62
+    /**
63
+     * Get the size of this version
64
+     *
65
+     * @return int
66
+     * @since 15.0.0
67
+     */
68
+    public function getSize(): int;
69 69
 
70
-	/**
71
-	 * Get the name of the source file at the time of making this version
72
-	 *
73
-	 * @return string
74
-	 * @since 15.0.0
75
-	 */
76
-	public function getSourceFileName(): string;
70
+    /**
71
+     * Get the name of the source file at the time of making this version
72
+     *
73
+     * @return string
74
+     * @since 15.0.0
75
+     */
76
+    public function getSourceFileName(): string;
77 77
 
78
-	/**
79
-	 * Get the mimetype of this version
80
-	 *
81
-	 * @return string
82
-	 * @since 15.0.0
83
-	 */
84
-	public function getMimeType(): string;
78
+    /**
79
+     * Get the mimetype of this version
80
+     *
81
+     * @return string
82
+     * @since 15.0.0
83
+     */
84
+    public function getMimeType(): string;
85 85
 
86
-	/**
87
-	 * Get the path of this version
88
-	 *
89
-	 * @return string
90
-	 * @since 15.0.0
91
-	 */
92
-	public function getVersionPath(): string;
86
+    /**
87
+     * Get the path of this version
88
+     *
89
+     * @return string
90
+     * @since 15.0.0
91
+     */
92
+    public function getVersionPath(): string;
93 93
 
94
-	/**
95
-	 * @return IUser
96
-	 * @since 15.0.0
97
-	 */
98
-	public function getUser(): IUser;
94
+    /**
95
+     * @return IUser
96
+     * @since 15.0.0
97
+     */
98
+    public function getUser(): IUser;
99 99
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Listener/ProviderDisabled.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,33 +35,33 @@
 block discarded – undo
35 35
 
36 36
 class ProviderDisabled implements IEventListener {
37 37
 
38
-	/** @var IRegistry */
39
-	private $registry;
38
+    /** @var IRegistry */
39
+    private $registry;
40 40
 
41
-	/** @var IJobList */
42
-	private $jobList;
41
+    /** @var IJobList */
42
+    private $jobList;
43 43
 
44
-	public function __construct(IRegistry $registry,
45
-								IJobList $jobList) {
46
-		$this->registry = $registry;
47
-		$this->jobList = $jobList;
48
-	}
44
+    public function __construct(IRegistry $registry,
45
+                                IJobList $jobList) {
46
+        $this->registry = $registry;
47
+        $this->jobList = $jobList;
48
+    }
49 49
 
50
-	public function handle(Event $event): void {
51
-		if (!($event instanceof RegistryEvent)) {
52
-			return;
53
-		}
50
+    public function handle(Event $event): void {
51
+        if (!($event instanceof RegistryEvent)) {
52
+            return;
53
+        }
54 54
 
55
-		$providers = $this->registry->getProviderStates($event->getUser());
55
+        $providers = $this->registry->getProviderStates($event->getUser());
56 56
 
57
-		// Loop over all providers. If all are disabled we remove the job
58
-		$state = array_reduce($providers, function (bool $carry, bool $enabled) {
59
-			return $carry || $enabled;
60
-		}, false);
57
+        // Loop over all providers. If all are disabled we remove the job
58
+        $state = array_reduce($providers, function (bool $carry, bool $enabled) {
59
+            return $carry || $enabled;
60
+        }, false);
61 61
 
62
-		if ($state === false) {
63
-			$this->jobList->remove(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]);
64
-		}
65
-	}
62
+        if ($state === false) {
63
+            $this->jobList->remove(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]);
64
+        }
65
+    }
66 66
 
67 67
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Listener/ProviderEnabled.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -33,30 +33,30 @@
 block discarded – undo
33 33
 
34 34
 class ProviderEnabled implements IEventListener {
35 35
 
36
-	/** @var IRegistry */
37
-	private $registry;
38
-
39
-	/** @var IJobList */
40
-	private $jobList;
41
-
42
-	public function __construct(IRegistry $registry,
43
-								IJobList $jobList) {
44
-		$this->registry = $registry;
45
-		$this->jobList = $jobList;
46
-	}
47
-
48
-	public function handle(Event $event): void {
49
-		if (!($event instanceof RegistryEvent)) {
50
-			return;
51
-		}
52
-
53
-		$providers = $this->registry->getProviderStates($event->getUser());
54
-		if (isset($providers['backup_codes']) && $providers['backup_codes'] === true) {
55
-			// Backup codes already generated nothing to do here
56
-			return;
57
-		}
58
-
59
-		$this->jobList->add(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]);
60
-	}
36
+    /** @var IRegistry */
37
+    private $registry;
38
+
39
+    /** @var IJobList */
40
+    private $jobList;
41
+
42
+    public function __construct(IRegistry $registry,
43
+                                IJobList $jobList) {
44
+        $this->registry = $registry;
45
+        $this->jobList = $jobList;
46
+    }
47
+
48
+    public function handle(Event $event): void {
49
+        if (!($event instanceof RegistryEvent)) {
50
+            return;
51
+        }
52
+
53
+        $providers = $this->registry->getProviderStates($event->getUser());
54
+        if (isset($providers['backup_codes']) && $providers['backup_codes'] === true) {
55
+            // Backup codes already generated nothing to do here
56
+            return;
57
+        }
58
+
59
+        $this->jobList->add(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]);
60
+    }
61 61
 
62 62
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Listener/ClearNotifications.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -33,22 +33,22 @@
 block discarded – undo
33 33
 
34 34
 class ClearNotifications implements IEventListener {
35 35
 
36
-	/** @var IManager */
37
-	private $manager;
38
-
39
-	public function __construct(IManager $manager) {
40
-		$this->manager = $manager;
41
-	}
42
-
43
-	public function handle(Event $event): void {
44
-		if (!($event instanceof CodesGenerated)) {
45
-			return;
46
-		}
47
-
48
-		$notification = $this->manager->createNotification();
49
-		$notification->setApp('twofactor_backupcodes')
50
-			->setUser($event->getUser()->getUID())
51
-			->setObject('create', 'codes');
52
-		$this->manager->markProcessed($notification);
53
-	}
36
+    /** @var IManager */
37
+    private $manager;
38
+
39
+    public function __construct(IManager $manager) {
40
+        $this->manager = $manager;
41
+    }
42
+
43
+    public function handle(Event $event): void {
44
+        if (!($event instanceof CodesGenerated)) {
45
+            return;
46
+        }
47
+
48
+        $notification = $this->manager->createNotification();
49
+        $notification->setApp('twofactor_backupcodes')
50
+            ->setUser($event->getUser()->getUID())
51
+            ->setObject('create', 'codes');
52
+        $this->manager->markProcessed($notification);
53
+    }
54 54
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Listener/ActivityPublisher.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -33,36 +33,36 @@
 block discarded – undo
33 33
 
34 34
 class ActivityPublisher implements IEventListener {
35 35
 
36
-	/** @var IManager */
37
-	private $activityManager;
36
+    /** @var IManager */
37
+    private $activityManager;
38 38
 
39
-	/** @var ILogger */
40
-	private $logger;
39
+    /** @var ILogger */
40
+    private $logger;
41 41
 
42
-	public function __construct(IManager $activityManager,
43
-								ILogger $logger) {
44
-		$this->activityManager = $activityManager;
45
-		$this->logger = $logger;
46
-	}
42
+    public function __construct(IManager $activityManager,
43
+                                ILogger $logger) {
44
+        $this->activityManager = $activityManager;
45
+        $this->logger = $logger;
46
+    }
47 47
 
48
-	/**
49
-	 * Push an event to the user's activity stream
50
-	 */
51
-	public function handle(Event $event): void {
52
-		if ($event instanceof CodesGenerated) {
53
-			$activity = $this->activityManager->generateEvent();
54
-			$activity->setApp('twofactor_backupcodes')
55
-				->setType('security')
56
-				->setAuthor($event->getUser()->getUID())
57
-				->setAffectedUser($event->getUser()->getUID())
58
-				->setSubject('codes_generated');
59
-			try {
60
-				$this->activityManager->publish($activity);
61
-			} catch (BadMethodCallException $e) {
62
-				$this->logger->warning('could not publish backup code creation activity', ['app' => 'twofactor_backupcodes']);
63
-				$this->logger->logException($e, ['app' => 'twofactor_backupcodes']);
64
-			}
65
-		}
66
-	}
48
+    /**
49
+     * Push an event to the user's activity stream
50
+     */
51
+    public function handle(Event $event): void {
52
+        if ($event instanceof CodesGenerated) {
53
+            $activity = $this->activityManager->generateEvent();
54
+            $activity->setApp('twofactor_backupcodes')
55
+                ->setType('security')
56
+                ->setAuthor($event->getUser()->getUID())
57
+                ->setAffectedUser($event->getUser()->getUID())
58
+                ->setSubject('codes_generated');
59
+            try {
60
+                $this->activityManager->publish($activity);
61
+            } catch (BadMethodCallException $e) {
62
+                $this->logger->warning('could not publish backup code creation activity', ['app' => 'twofactor_backupcodes']);
63
+                $this->logger->logException($e, ['app' => 'twofactor_backupcodes']);
64
+            }
65
+        }
66
+    }
67 67
 
68 68
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Listener/RegistryUpdater.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -32,21 +32,21 @@
 block discarded – undo
32 32
 
33 33
 class RegistryUpdater implements IEventListener {
34 34
 
35
-	/** @var IRegistry */
36
-	private $registry;
37
-
38
-	/** @var BackupCodesProvider */
39
-	private $provider;
40
-
41
-	public function __construct(IRegistry $registry, BackupCodesProvider $provider) {
42
-		$this->registry = $registry;
43
-		$this->provider = $provider;
44
-	}
45
-
46
-	public function handle(Event $event): void {
47
-		if ($event instanceof CodesGenerated) {
48
-			$this->registry->enableProviderFor($this->provider, $event->getUser());
49
-		}
50
-	}
35
+    /** @var IRegistry */
36
+    private $registry;
37
+
38
+    /** @var BackupCodesProvider */
39
+    private $provider;
40
+
41
+    public function __construct(IRegistry $registry, BackupCodesProvider $provider) {
42
+        $this->registry = $registry;
43
+        $this->provider = $provider;
44
+    }
45
+
46
+    public function handle(Event $event): void {
47
+        if ($event instanceof CodesGenerated) {
48
+            $this->registry->enableProviderFor($this->provider, $event->getUser());
49
+        }
50
+    }
51 51
 
52 52
 }
Please login to merge, or discard this patch.
lib/public/Preview/IProvider.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,31 +30,31 @@
 block discarded – undo
30 30
  * @deprecated 17.0.0 use IProviderV2 instead
31 31
  */
32 32
 interface IProvider {
33
-	/**
34
-	 * @return string Regex with the mimetypes that are supported by this provider
35
-	 * @since 8.1.0
36
-	 */
37
-	public function getMimeType();
33
+    /**
34
+     * @return string Regex with the mimetypes that are supported by this provider
35
+     * @since 8.1.0
36
+     */
37
+    public function getMimeType();
38 38
 
39
-	/**
40
-	 * Check if a preview can be generated for $path
41
-	 *
42
-	 * @param \OCP\Files\FileInfo $file
43
-	 * @return bool
44
-	 * @since 8.1.0
45
-	 */
46
-	public function isAvailable(\OCP\Files\FileInfo $file);
39
+    /**
40
+     * Check if a preview can be generated for $path
41
+     *
42
+     * @param \OCP\Files\FileInfo $file
43
+     * @return bool
44
+     * @since 8.1.0
45
+     */
46
+    public function isAvailable(\OCP\Files\FileInfo $file);
47 47
 
48
-	/**
49
-	 * get thumbnail for file at path $path
50
-	 *
51
-	 * @param string $path Path of file
52
-	 * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
53
-	 * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
54
-	 * @param bool $scalingup Disable/Enable upscaling of previews
55
-	 * @param \OC\Files\View $fileview fileview object of user folder
56
-	 * @return bool|\OCP\IImage false if no preview was generated
57
-	 * @since 8.1.0
58
-	 */
59
-	public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview);
48
+    /**
49
+     * get thumbnail for file at path $path
50
+     *
51
+     * @param string $path Path of file
52
+     * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
53
+     * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
54
+     * @param bool $scalingup Disable/Enable upscaling of previews
55
+     * @param \OC\Files\View $fileview fileview object of user folder
56
+     * @return bool|\OCP\IImage false if no preview was generated
57
+     * @since 8.1.0
58
+     */
59
+    public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview);
60 60
 }
Please login to merge, or discard this patch.
lib/public/Preview/IProviderV2.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -29,29 +29,29 @@
 block discarded – undo
29 29
  * @since 17.0.0
30 30
  */
31 31
 interface IProviderV2 {
32
-	/**
33
-	 * @return string Regex with the mimetypes that are supported by this provider
34
-	 * @since 17.0.0
35
-	 */
36
-	public function getMimeType(): string;
32
+    /**
33
+     * @return string Regex with the mimetypes that are supported by this provider
34
+     * @since 17.0.0
35
+     */
36
+    public function getMimeType(): string;
37 37
 
38
-	/**
39
-	 * Check if a preview can be generated for $path
40
-	 *
41
-	 * @param FileInfo $file
42
-	 * @return bool
43
-	 * @since 17.0.0
44
-	 */
45
-	public function isAvailable(FileInfo $file): bool;
38
+    /**
39
+     * Check if a preview can be generated for $path
40
+     *
41
+     * @param FileInfo $file
42
+     * @return bool
43
+     * @since 17.0.0
44
+     */
45
+    public function isAvailable(FileInfo $file): bool;
46 46
 
47
-	/**
48
-	 * get thumbnail for file at path $path
49
-	 *
50
-	 * @param File $file
51
-	 * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
52
-	 * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
53
-	 * @return null|\OCP\IImage null if no preview was generated
54
-	 * @since 17.0.0
55
-	 */
56
-	public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage;
47
+    /**
48
+     * get thumbnail for file at path $path
49
+     *
50
+     * @param File $file
51
+     * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
52
+     * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
53
+     * @return null|\OCP\IImage null if no preview was generated
54
+     * @since 17.0.0
55
+     */
56
+    public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage;
57 57
 }
Please login to merge, or discard this patch.