@@ -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 | } |
@@ -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 | } |
@@ -23,10 +23,10 @@ |
||
| 23 | 23 | namespace OC\Preview; |
| 24 | 24 | |
| 25 | 25 | class PNG extends Image { |
| 26 | - /** |
|
| 27 | - * {@inheritDoc} |
|
| 28 | - */ |
|
| 29 | - public function getMimeType(): string { |
|
| 30 | - return '/image\/png/'; |
|
| 31 | - } |
|
| 26 | + /** |
|
| 27 | + * {@inheritDoc} |
|
| 28 | + */ |
|
| 29 | + public function getMimeType(): string { |
|
| 30 | + return '/image\/png/'; |
|
| 31 | + } |
|
| 32 | 32 | } |