aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /lib/private/Preview
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Preview')
-rw-r--r--lib/private/Preview/Bitmap.php2
-rw-r--r--lib/private/Preview/Bundled.php2
-rw-r--r--lib/private/Preview/HEIC.php1
-rw-r--r--lib/private/Preview/Image.php1
-rw-r--r--lib/private/Preview/MP3.php4
-rw-r--r--lib/private/Preview/MarkDown.php1
-rw-r--r--lib/private/Preview/Office.php1
-rw-r--r--lib/private/Preview/ProviderV1Adapter.php1
-rw-r--r--lib/private/Preview/TXT.php6
9 files changed, 5 insertions, 14 deletions
diff --git a/lib/private/Preview/Bitmap.php b/lib/private/Preview/Bitmap.php
index fccb176c737..7322e07ab34 100644
--- a/lib/private/Preview/Bitmap.php
+++ b/lib/private/Preview/Bitmap.php
@@ -43,7 +43,6 @@ abstract class Bitmap extends ProviderV2 {
* {@inheritDoc}
*/
public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage {
-
$tmpPath = $this->getLocalFile($file);
// Creates \Imagick object from bitmap or vector file
@@ -117,5 +116,4 @@ abstract class Bitmap extends ProviderV2 {
return $bp;
}
-
}
diff --git a/lib/private/Preview/Bundled.php b/lib/private/Preview/Bundled.php
index afd286d895b..4e89682dc6c 100644
--- a/lib/private/Preview/Bundled.php
+++ b/lib/private/Preview/Bundled.php
@@ -31,7 +31,6 @@ use OCP\IImage;
* Extracts a preview from files that embed them in an ZIP archive
*/
abstract class Bundled extends ProviderV2 {
-
protected function extractThumbnail(File $file, $path): ?IImage {
$sourceTmp = \OC::$server->getTempManager()->getTemporaryFile();
$targetTmp = \OC::$server->getTempManager()->getTemporaryFile();
@@ -52,5 +51,4 @@ abstract class Bundled extends ProviderV2 {
return null;
}
}
-
}
diff --git a/lib/private/Preview/HEIC.php b/lib/private/Preview/HEIC.php
index 166e1cc3074..c2b9b541ad3 100644
--- a/lib/private/Preview/HEIC.php
+++ b/lib/private/Preview/HEIC.php
@@ -141,5 +141,4 @@ class HEIC extends ProviderV2 {
return $bp;
}
-
}
diff --git a/lib/private/Preview/Image.php b/lib/private/Preview/Image.php
index 3180ee853ec..eea471a2356 100644
--- a/lib/private/Preview/Image.php
+++ b/lib/private/Preview/Image.php
@@ -61,5 +61,4 @@ abstract class Image extends ProviderV2 {
}
return null;
}
-
}
diff --git a/lib/private/Preview/MP3.php b/lib/private/Preview/MP3.php
index db06733a892..0986cf8c5c3 100644
--- a/lib/private/Preview/MP3.php
+++ b/lib/private/Preview/MP3.php
@@ -51,11 +51,11 @@ class MP3 extends ProviderV2 {
$tags = $getID3->analyze($tmpPath);
$this->cleanTmpFiles();
$picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null;
- if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) {
+ if (is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) {
$picture = $tags['id3v2']['PIC'][0]['data'];
}
- if(!is_null($picture)) {
+ if (!is_null($picture)) {
$image = new \OC_Image();
$image->loadFromData($picture);
diff --git a/lib/private/Preview/MarkDown.php b/lib/private/Preview/MarkDown.php
index 0cf096148e5..91e276eb170 100644
--- a/lib/private/Preview/MarkDown.php
+++ b/lib/private/Preview/MarkDown.php
@@ -31,5 +31,4 @@ class MarkDown extends TXT {
public function getMimeType(): string {
return '/text\/(x-)?markdown/';
}
-
}
diff --git a/lib/private/Preview/Office.php b/lib/private/Preview/Office.php
index bdf8c528135..6719aeace8f 100644
--- a/lib/private/Preview/Office.php
+++ b/lib/private/Preview/Office.php
@@ -86,7 +86,6 @@ abstract class Office extends ProviderV2 {
return $image;
}
return null;
-
}
private function initCmd() {
diff --git a/lib/private/Preview/ProviderV1Adapter.php b/lib/private/Preview/ProviderV1Adapter.php
index 645905517cb..f09b0f47583 100644
--- a/lib/private/Preview/ProviderV1Adapter.php
+++ b/lib/private/Preview/ProviderV1Adapter.php
@@ -61,5 +61,4 @@ class ProviderV1Adapter implements IProviderV2 {
return [$view, $path];
}
-
}
diff --git a/lib/private/Preview/TXT.php b/lib/private/Preview/TXT.php
index 3090446ac4d..d116726c683 100644
--- a/lib/private/Preview/TXT.php
+++ b/lib/private/Preview/TXT.php
@@ -61,7 +61,7 @@ class TXT extends ProviderV2 {
$content = stream_get_contents($content,3000);
//don't create previews of empty text files
- if(trim($content) === '') {
+ if (trim($content) === '') {
return null;
}
@@ -81,7 +81,7 @@ class TXT extends ProviderV2 {
$canUseTTF = function_exists('imagettftext');
- foreach($lines as $index => $line) {
+ foreach ($lines as $index => $line) {
$index = $index + 1;
$x = (int) 1;
@@ -94,7 +94,7 @@ class TXT extends ProviderV2 {
imagestring($image, 1, $x, $y, $line, $textColor);
}
- if(($index * $lineSize) >= $maxY) {
+ if (($index * $lineSize) >= $maxY) {
break;
}
}