diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /lib/private/Search | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) | |
download | nextcloud-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/Search')
-rw-r--r-- | lib/private/Search/Provider/File.php | 9 | ||||
-rw-r--r-- | lib/private/Search/Result/File.php | 2 | ||||
-rw-r--r-- | lib/private/Search/Result/Folder.php | 1 |
3 files changed, 4 insertions, 8 deletions
diff --git a/lib/private/Search/Provider/File.php b/lib/private/Search/Provider/File.php index 734878be982..02521460d8c 100644 --- a/lib/private/Search/Provider/File.php +++ b/lib/private/Search/Provider/File.php @@ -54,19 +54,19 @@ class File extends \OCP\Search\Provider { continue; } // create audio result - if($fileData['mimepart'] === 'audio'){ + if ($fileData['mimepart'] === 'audio') { $result = new \OC\Search\Result\Audio($fileData); } // create image result - elseif($fileData['mimepart'] === 'image'){ + elseif ($fileData['mimepart'] === 'image') { $result = new \OC\Search\Result\Image($fileData); } // create folder result - elseif($fileData['mimetype'] === 'httpd/unix-directory'){ + elseif ($fileData['mimetype'] === 'httpd/unix-directory') { $result = new \OC\Search\Result\Folder($fileData); } // or create file result - else{ + else { $result = new \OC\Search\Result\File($fileData); } // add to results @@ -75,5 +75,4 @@ class File extends \OCP\Search\Provider { // return return $results; } - } diff --git a/lib/private/Search/Result/File.php b/lib/private/Search/Result/File.php index cd605c49821..b0f6b3df622 100644 --- a/lib/private/Search/Result/File.php +++ b/lib/private/Search/Result/File.php @@ -75,7 +75,6 @@ class File extends \OCP\Search\Result { * @param FileInfo $data file data given by provider */ public function __construct(FileInfo $data) { - $path = $this->getRelativePath($data->getPath()); $info = pathinfo($path); @@ -113,5 +112,4 @@ class File extends \OCP\Search\Result { } return self::$userFolderCache->getRelativePath($path); } - } diff --git a/lib/private/Search/Result/Folder.php b/lib/private/Search/Result/Folder.php index 0a746221ee0..aa166cff8fc 100644 --- a/lib/private/Search/Result/Folder.php +++ b/lib/private/Search/Result/Folder.php @@ -34,5 +34,4 @@ class Folder extends File { * @var string */ public $type = 'folder'; - } |