@@ -53,7 +53,7 @@ |
||
53 | 53 | $providers = $this->registry->getProviderStates($event->getUser()); |
54 | 54 | |
55 | 55 | // Loop over all providers. If all are disabled we remove the job |
56 | - $state = array_reduce($providers, function (bool $carry, bool $enabled) { |
|
56 | + $state = array_reduce($providers, function(bool $carry, bool $enabled) { |
|
57 | 57 | return $carry || $enabled; |
58 | 58 | }, false); |
59 | 59 |
@@ -18,26 +18,26 @@ |
||
18 | 18 | /** @template-implements IEventListener<TwoFactorProviderForUserUnregistered> */ |
19 | 19 | class ProviderDisabled implements IEventListener { |
20 | 20 | |
21 | - public function __construct( |
|
22 | - private IRegistry $registry, |
|
23 | - private IJobList $jobList, |
|
24 | - ) { |
|
25 | - } |
|
26 | - |
|
27 | - public function handle(Event $event): void { |
|
28 | - if (!($event instanceof TwoFactorProviderForUserUnregistered)) { |
|
29 | - return; |
|
30 | - } |
|
31 | - |
|
32 | - $providers = $this->registry->getProviderStates($event->getUser()); |
|
33 | - |
|
34 | - // Loop over all providers. If all are disabled we remove the job |
|
35 | - $state = array_reduce($providers, function (bool $carry, bool $enabled) { |
|
36 | - return $carry || $enabled; |
|
37 | - }, false); |
|
38 | - |
|
39 | - if ($state === false) { |
|
40 | - $this->jobList->remove(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]); |
|
41 | - } |
|
42 | - } |
|
21 | + public function __construct( |
|
22 | + private IRegistry $registry, |
|
23 | + private IJobList $jobList, |
|
24 | + ) { |
|
25 | + } |
|
26 | + |
|
27 | + public function handle(Event $event): void { |
|
28 | + if (!($event instanceof TwoFactorProviderForUserUnregistered)) { |
|
29 | + return; |
|
30 | + } |
|
31 | + |
|
32 | + $providers = $this->registry->getProviderStates($event->getUser()); |
|
33 | + |
|
34 | + // Loop over all providers. If all are disabled we remove the job |
|
35 | + $state = array_reduce($providers, function (bool $carry, bool $enabled) { |
|
36 | + return $carry || $enabled; |
|
37 | + }, false); |
|
38 | + |
|
39 | + if ($state === false) { |
|
40 | + $this->jobList->remove(RememberBackupCodesJob::class, ['uid' => $event->getUser()->getUID()]); |
|
41 | + } |
|
42 | + } |
|
43 | 43 | } |
@@ -30,31 +30,31 @@ |
||
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 | } |
@@ -29,29 +29,29 @@ |
||
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 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | |
24 | 24 | //.doc, .dot |
25 | 25 | class MSOfficeDoc extends Office { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/application\/msword/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/application\/msword/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | |
24 | 24 | //.sxw, .stw, .sxc, .stc, .sxd, .std, .sxi, .sti, .sxg, .sxm |
25 | 25 | class StarOffice extends Office { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/application\/vnd.sun.xml.*/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/application\/vnd.sun.xml.*/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | |
24 | 24 | //.docx, .dotx, .xlsx, .xltx, .pptx, .potx, .ppsx |
25 | 25 | class MSOffice2007 extends Office { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/application\/vnd.openxmlformats-officedocument.*/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/application\/vnd.openxmlformats-officedocument.*/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | namespace OC\Preview; |
24 | 24 | |
25 | 25 | class BMP extends Image { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/image\/bmp/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/image\/bmp/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | namespace OC\Preview; |
24 | 24 | |
25 | 25 | class GIF extends Image { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/image\/gif/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/image\/gif/'; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | namespace OC\Preview; |
24 | 24 | |
25 | 25 | class XBitmap extends Image { |
26 | - /** |
|
27 | - * {@inheritDoc} |
|
28 | - */ |
|
29 | - public function getMimeType(): string { |
|
30 | - return '/image\/x-xbitmap/'; |
|
31 | - } |
|
26 | + /** |
|
27 | + * {@inheritDoc} |
|
28 | + */ |
|
29 | + public function getMimeType(): string { |
|
30 | + return '/image\/x-xbitmap/'; |
|
31 | + } |
|
32 | 32 | } |