Passed
Push — master ( 0571fd...48a8f0 )
by Blizzz
19:19 queued 08:57
created
apps/twofactor_backupcodes/composer/composer/autoload_static.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -6,49 +6,49 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitTwoFactorBackupCodes
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\TwoFactorBackupCodes\\' => 25,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\TwoFactorBackupCodes\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'OCA\\TwoFactorBackupCodes\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php',
25
-        'OCA\\TwoFactorBackupCodes\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
26
-        'OCA\\TwoFactorBackupCodes\\BackgroundJob\\CheckBackupCodes' => __DIR__ . '/..' . '/../lib/BackgroundJob/CheckBackupCodes.php',
27
-        'OCA\\TwoFactorBackupCodes\\BackgroundJob\\RememberBackupCodesJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/RememberBackupCodesJob.php',
28
-        'OCA\\TwoFactorBackupCodes\\Controller\\SettingsController' => __DIR__ . '/..' . '/../lib/Controller/SettingsController.php',
29
-        'OCA\\TwoFactorBackupCodes\\Db\\BackupCode' => __DIR__ . '/..' . '/../lib/Db/BackupCode.php',
30
-        'OCA\\TwoFactorBackupCodes\\Db\\BackupCodeMapper' => __DIR__ . '/..' . '/../lib/Db/BackupCodeMapper.php',
31
-        'OCA\\TwoFactorBackupCodes\\Event\\CodesGenerated' => __DIR__ . '/..' . '/../lib/Event/CodesGenerated.php',
32
-        'OCA\\TwoFactorBackupCodes\\Listener\\ActivityPublisher' => __DIR__ . '/..' . '/../lib/Listener/ActivityPublisher.php',
33
-        'OCA\\TwoFactorBackupCodes\\Listener\\ClearNotifications' => __DIR__ . '/..' . '/../lib/Listener/ClearNotifications.php',
34
-        'OCA\\TwoFactorBackupCodes\\Listener\\ProviderDisabled' => __DIR__ . '/..' . '/../lib/Listener/ProviderDisabled.php',
35
-        'OCA\\TwoFactorBackupCodes\\Listener\\ProviderEnabled' => __DIR__ . '/..' . '/../lib/Listener/ProviderEnabled.php',
36
-        'OCA\\TwoFactorBackupCodes\\Listener\\RegistryUpdater' => __DIR__ . '/..' . '/../lib/Listener/RegistryUpdater.php',
37
-        'OCA\\TwoFactorBackupCodes\\Migration\\CheckBackupCodes' => __DIR__ . '/..' . '/../lib/Migration/CheckBackupCodes.php',
38
-        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170607104347' => __DIR__ . '/..' . '/../lib/Migration/Version1002Date20170607104347.php',
39
-        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170607113030' => __DIR__ . '/..' . '/../lib/Migration/Version1002Date20170607113030.php',
40
-        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170919123342' => __DIR__ . '/..' . '/../lib/Migration/Version1002Date20170919123342.php',
41
-        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170926101419' => __DIR__ . '/..' . '/../lib/Migration/Version1002Date20170926101419.php',
42
-        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20180821043638' => __DIR__ . '/..' . '/../lib/Migration/Version1002Date20180821043638.php',
43
-        'OCA\\TwoFactorBackupCodes\\Notifications\\Notifier' => __DIR__ . '/..' . '/../lib/Notifications/Notifier.php',
44
-        'OCA\\TwoFactorBackupCodes\\Provider\\BackupCodesProvider' => __DIR__ . '/..' . '/../lib/Provider/BackupCodesProvider.php',
45
-        'OCA\\TwoFactorBackupCodes\\Service\\BackupCodeStorage' => __DIR__ . '/..' . '/../lib/Service/BackupCodeStorage.php',
46
-        'OCA\\TwoFactorBackupCodes\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php',
23
+    public static $classMap = array(
24
+        'OCA\\TwoFactorBackupCodes\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php',
25
+        'OCA\\TwoFactorBackupCodes\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
26
+        'OCA\\TwoFactorBackupCodes\\BackgroundJob\\CheckBackupCodes' => __DIR__.'/..'.'/../lib/BackgroundJob/CheckBackupCodes.php',
27
+        'OCA\\TwoFactorBackupCodes\\BackgroundJob\\RememberBackupCodesJob' => __DIR__.'/..'.'/../lib/BackgroundJob/RememberBackupCodesJob.php',
28
+        'OCA\\TwoFactorBackupCodes\\Controller\\SettingsController' => __DIR__.'/..'.'/../lib/Controller/SettingsController.php',
29
+        'OCA\\TwoFactorBackupCodes\\Db\\BackupCode' => __DIR__.'/..'.'/../lib/Db/BackupCode.php',
30
+        'OCA\\TwoFactorBackupCodes\\Db\\BackupCodeMapper' => __DIR__.'/..'.'/../lib/Db/BackupCodeMapper.php',
31
+        'OCA\\TwoFactorBackupCodes\\Event\\CodesGenerated' => __DIR__.'/..'.'/../lib/Event/CodesGenerated.php',
32
+        'OCA\\TwoFactorBackupCodes\\Listener\\ActivityPublisher' => __DIR__.'/..'.'/../lib/Listener/ActivityPublisher.php',
33
+        'OCA\\TwoFactorBackupCodes\\Listener\\ClearNotifications' => __DIR__.'/..'.'/../lib/Listener/ClearNotifications.php',
34
+        'OCA\\TwoFactorBackupCodes\\Listener\\ProviderDisabled' => __DIR__.'/..'.'/../lib/Listener/ProviderDisabled.php',
35
+        'OCA\\TwoFactorBackupCodes\\Listener\\ProviderEnabled' => __DIR__.'/..'.'/../lib/Listener/ProviderEnabled.php',
36
+        'OCA\\TwoFactorBackupCodes\\Listener\\RegistryUpdater' => __DIR__.'/..'.'/../lib/Listener/RegistryUpdater.php',
37
+        'OCA\\TwoFactorBackupCodes\\Migration\\CheckBackupCodes' => __DIR__.'/..'.'/../lib/Migration/CheckBackupCodes.php',
38
+        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170607104347' => __DIR__.'/..'.'/../lib/Migration/Version1002Date20170607104347.php',
39
+        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170607113030' => __DIR__.'/..'.'/../lib/Migration/Version1002Date20170607113030.php',
40
+        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170919123342' => __DIR__.'/..'.'/../lib/Migration/Version1002Date20170919123342.php',
41
+        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20170926101419' => __DIR__.'/..'.'/../lib/Migration/Version1002Date20170926101419.php',
42
+        'OCA\\TwoFactorBackupCodes\\Migration\\Version1002Date20180821043638' => __DIR__.'/..'.'/../lib/Migration/Version1002Date20180821043638.php',
43
+        'OCA\\TwoFactorBackupCodes\\Notifications\\Notifier' => __DIR__.'/..'.'/../lib/Notifications/Notifier.php',
44
+        'OCA\\TwoFactorBackupCodes\\Provider\\BackupCodesProvider' => __DIR__.'/..'.'/../lib/Provider/BackupCodesProvider.php',
45
+        'OCA\\TwoFactorBackupCodes\\Service\\BackupCodeStorage' => __DIR__.'/..'.'/../lib/Service/BackupCodeStorage.php',
46
+        'OCA\\TwoFactorBackupCodes\\Settings\\Personal' => __DIR__.'/..'.'/../lib/Settings/Personal.php',
47 47
     );
48 48
 
49 49
     public static function getInitializer(ClassLoader $loader)
50 50
     {
51
-        return \Closure::bind(function () use ($loader) {
51
+        return \Closure::bind(function() use ($loader) {
52 52
             $loader->prefixLengthsPsr4 = ComposerStaticInitTwoFactorBackupCodes::$prefixLengthsPsr4;
53 53
             $loader->prefixDirsPsr4 = ComposerStaticInitTwoFactorBackupCodes::$prefixDirsPsr4;
54 54
             $loader->classMap = ComposerStaticInitTwoFactorBackupCodes::$classMap;
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.
lib/private/Preview/MSOfficeDoc.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/private/Preview/ProviderV2.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	/**
44 44
 	 * @return string Regex with the mimetypes that are supported by this provider
45 45
 	 */
46
-	abstract public function getMimeType(): string ;
46
+	abstract public function getMimeType(): string;
47 47
 
48 48
 	/**
49 49
 	 * Check if a preview can be generated for $path
Please login to merge, or discard this patch.
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -32,79 +32,79 @@
 block discarded – undo
32 32
 use OCP\Preview\IProviderV2;
33 33
 
34 34
 abstract class ProviderV2 implements IProviderV2 {
35
-	private $options;
36
-
37
-	private $tmpFiles = [];
38
-
39
-	/**
40
-	 * Constructor
41
-	 *
42
-	 * @param array $options
43
-	 */
44
-	public function __construct(array $options = []) {
45
-		$this->options = $options;
46
-	}
47
-
48
-	/**
49
-	 * @return string Regex with the mimetypes that are supported by this provider
50
-	 */
51
-	abstract public function getMimeType(): string ;
52
-
53
-	/**
54
-	 * Check if a preview can be generated for $path
55
-	 *
56
-	 * @param FileInfo $file
57
-	 * @return bool
58
-	 */
59
-	public function isAvailable(FileInfo $file): bool {
60
-		return true;
61
-	}
62
-
63
-	/**
64
-	 * get thumbnail for file at path $path
65
-	 *
66
-	 * @param File $file
67
-	 * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
68
-	 * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
69
-	 * @return null|\OCP\IImage false if no preview was generated
70
-	 * @since 17.0.0
71
-	 */
72
-	abstract public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage;
73
-
74
-	/**
75
-	 * Get a path to either the local file or temporary file
76
-	 *
77
-	 * @param File $file
78
-	 * @param int $maxSize maximum size for temporary files
79
-	 * @return string
80
-	 */
81
-	protected function getLocalFile(File $file, int $maxSize = null): string {
82
-		$useTempFile = $file->isEncrypted() || !$file->getStorage()->isLocal();
83
-		if ($useTempFile) {
84
-			$absPath = \OC::$server->getTempManager()->getTemporaryFile();
85
-
86
-			$content = $file->fopen('r');
87
-
88
-			if ($maxSize) {
89
-				$content = stream_get_contents($content, $maxSize);
90
-			}
91
-
92
-			file_put_contents($absPath, $content);
93
-			$this->tmpFiles[] = $absPath;
94
-			return $absPath;
95
-		} else {
96
-			return $file->getStorage()->getLocalFile($file->getInternalPath());
97
-		}
98
-	}
99
-
100
-	/**
101
-	 * Clean any generated temporary files
102
-	 */
103
-	protected function cleanTmpFiles() {
104
-		foreach ($this->tmpFiles as $tmpFile) {
105
-			unlink($tmpFile);
106
-		}
107
-
108
-		$this->tmpFiles = [];
109
-	}
35
+    private $options;
36
+
37
+    private $tmpFiles = [];
38
+
39
+    /**
40
+     * Constructor
41
+     *
42
+     * @param array $options
43
+     */
44
+    public function __construct(array $options = []) {
45
+        $this->options = $options;
46
+    }
47
+
48
+    /**
49
+     * @return string Regex with the mimetypes that are supported by this provider
50
+     */
51
+    abstract public function getMimeType(): string ;
52
+
53
+    /**
54
+     * Check if a preview can be generated for $path
55
+     *
56
+     * @param FileInfo $file
57
+     * @return bool
58
+     */
59
+    public function isAvailable(FileInfo $file): bool {
60
+        return true;
61
+    }
62
+
63
+    /**
64
+     * get thumbnail for file at path $path
65
+     *
66
+     * @param File $file
67
+     * @param int $maxX The maximum X size of the thumbnail. It can be smaller depending on the shape of the image
68
+     * @param int $maxY The maximum Y size of the thumbnail. It can be smaller depending on the shape of the image
69
+     * @return null|\OCP\IImage false if no preview was generated
70
+     * @since 17.0.0
71
+     */
72
+    abstract public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage;
73
+
74
+    /**
75
+     * Get a path to either the local file or temporary file
76
+     *
77
+     * @param File $file
78
+     * @param int $maxSize maximum size for temporary files
79
+     * @return string
80
+     */
81
+    protected function getLocalFile(File $file, int $maxSize = null): string {
82
+        $useTempFile = $file->isEncrypted() || !$file->getStorage()->isLocal();
83
+        if ($useTempFile) {
84
+            $absPath = \OC::$server->getTempManager()->getTemporaryFile();
85
+
86
+            $content = $file->fopen('r');
87
+
88
+            if ($maxSize) {
89
+                $content = stream_get_contents($content, $maxSize);
90
+            }
91
+
92
+            file_put_contents($absPath, $content);
93
+            $this->tmpFiles[] = $absPath;
94
+            return $absPath;
95
+        } else {
96
+            return $file->getStorage()->getLocalFile($file->getInternalPath());
97
+        }
98
+    }
99
+
100
+    /**
101
+     * Clean any generated temporary files
102
+     */
103
+    protected function cleanTmpFiles() {
104
+        foreach ($this->tmpFiles as $tmpFile) {
105
+            unlink($tmpFile);
106
+        }
107
+
108
+        $this->tmpFiles = [];
109
+    }
110 110
 }
Please login to merge, or discard this patch.
lib/private/Preview/PDF.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@
 block discarded – undo
25 25
 
26 26
 //.pdf
27 27
 class PDF extends Bitmap {
28
-	/**
29
-	 * {@inheritDoc}
30
-	 */
31
-	public function getMimeType(): string {
32
-		return '/application\/pdf/';
33
-	}
28
+    /**
29
+     * {@inheritDoc}
30
+     */
31
+    public function getMimeType(): string {
32
+        return '/application\/pdf/';
33
+    }
34 34
 }
Please login to merge, or discard this patch.
lib/private/Preview/Photoshop.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@
 block discarded – undo
25 25
 
26 26
 //.psd
27 27
 class Photoshop extends Bitmap {
28
-	/**
29
-	 * {@inheritDoc}
30
-	 */
31
-	public function getMimeType(): string {
32
-		return '/application\/x-photoshop/';
33
-	}
28
+    /**
29
+     * {@inheritDoc}
30
+     */
31
+    public function getMimeType(): string {
32
+        return '/application\/x-photoshop/';
33
+    }
34 34
 }
Please login to merge, or discard this patch.
lib/private/Preview/Font.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@
 block discarded – undo
24 24
 
25 25
 // .otf, .ttf and .pfb
26 26
 class Font extends Bitmap {
27
-	/**
28
-	 * {@inheritDoc}
29
-	 */
30
-	public function getMimeType(): string {
31
-		return '/application\/(?:font-sfnt|x-font$)/';
32
-	}
27
+    /**
28
+     * {@inheritDoc}
29
+     */
30
+    public function getMimeType(): string {
31
+        return '/application\/(?:font-sfnt|x-font$)/';
32
+    }
33 33
 }
Please login to merge, or discard this patch.
lib/private/Preview/StarOffice.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.