Completed
Push — master ( 9c4b0f...4c0cee )
by Sam
02:26
created
src/Controllers/FileController.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -7,11 +7,7 @@
 block discarded – undo
7 7
 use Symfony\Component\HttpFoundation\BinaryFileResponse;
8 8
 use Symfony\Component\HttpFoundation\Request;
9 9
 use Symfony\Component\HttpFoundation\Response;
10
-use Symfony\Component\HttpFoundation\RedirectResponse;
11 10
 use Symfony\Component\HttpFoundation\ResponseHeaderBag;
12
-use Symfony\Component\HttpFoundation\StreamedResponse;
13
-use Intervention\Image\Facades\Image;
14
-use Intervention\Image\ImageManager;
15 11
 
16 12
 class FileController extends Base
17 13
 {
Please login to merge, or discard this patch.
src/Template.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -15,6 +15,9 @@
 block discarded – undo
15 15
     const WARNING = 'warning';
16 16
     const ERROR = 'error';
17 17
 
18
+    /**
19
+     * @param string $template
20
+     */
18 21
     public function __construct($template)
19 22
     {
20 23
         $this->template = $template;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
         $twig->addExtension(new \Twig_Extension_Debug());
61 61
 
62 62
         // Mardown support.
63
-        $twig->addFilter(new \Twig_SimpleFilter('markdown', function ($text) {
63
+        $twig->addFilter(new \Twig_SimpleFilter('markdown', function($text) {
64 64
             $parsedown = new \Parsedown();
65 65
             return $parsedown->text($text);
66 66
         }));
Please login to merge, or discard this patch.
src/Db.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -119,11 +119,11 @@
 block discarded – undo
119 119
             . " php_format VARCHAR(50) NOT NULL UNIQUE"
120 120
             . ")");
121 121
         $granularities = [
122
-             [1, 'Exact', 'Y-m-d H:i:s'],
123
-             [2, 'Day', 'j F Y'],
124
-             [3, 'Month', 'F Y'],
125
-             [4, 'Year', 'Y'],
126
-             [5, 'Circa', '\\c. Y'],
122
+                [1, 'Exact', 'Y-m-d H:i:s'],
123
+                [2, 'Day', 'j F Y'],
124
+                [3, 'Month', 'F Y'],
125
+                [4, 'Year', 'Y'],
126
+                [5, 'Circa', '\\c. Y'],
127 127
         ];
128 128
         foreach ($granularities as $gran) {
129 129
             $this->query(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@
 block discarded – undo
161 161
             . " `password` VARCHAR(255) NULL DEFAULT NULL,"
162 162
             . " `reminder_token` VARCHAR(255) NULL DEFAULT NULL,"
163 163
             . " `reminder_time` DATETIME NULL DEFAULT NULL,"
164
-            . " `default_group` INT(5) UNSIGNED NOT NULL DEFAULT ".User::GROUP_PUBLIC.","
164
+            . " `default_group` INT(5) UNSIGNED NOT NULL DEFAULT " . User::GROUP_PUBLIC . ","
165 165
             . "     FOREIGN KEY (`default_group`) REFERENCES `groups` (`id`)"
166 166
             . ")");
167 167
         $this->query("CREATE TABLE IF NOT EXISTS `user_groups` ("
Please login to merge, or discard this patch.
src/App.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,6 @@
 block discarded – undo
76 76
             return false;
77 77
         }
78 78
         return is_file($path) ?
79
-            @unlink($path) :
80
-            array_map([__CLASS__, __FUNCTION__], glob($path . '/*')) == @rmdir($path);
79
+            @unlink($path) : array_map([__CLASS__, __FUNCTION__], glob($path . '/*')) == @rmdir($path);
81 80
     }
82 81
 }
Please login to merge, or discard this patch.
src/Item.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             $version = $this->getVersionCount();
249 249
         }
250 250
         if ($version > $this->getVersionCount()) {
251
-            throw new Exception("Version $version does not exist for Item ".$this->getId());
251
+            throw new Exception("Version $version does not exist for Item " . $this->getId());
252 252
         }
253 253
         $filesystem = App::getFilesystem();
254 254
         $path = $this->getFilePath($version);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             $height = $image->getHeight();
280 280
             $newWidth = ($width > $height) ? 700 : null;
281 281
             $newHeight = ($width > $height) ? null : 700;
282
-            $image->resize($newWidth, $newHeight, function (Constraint $constraint) {
282
+            $image->resize($newWidth, $newHeight, function(Constraint $constraint) {
283 283
                 $constraint->aspectRatio();
284 284
                 $constraint->upsize();
285 285
             });
Please login to merge, or discard this patch.
src/Commands/UpgradeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public function run()
12 12
     {
13 13
         $config = new Config();
14
-        $this->write("Upgrading ".$config->siteTitle()." . . . ");
14
+        $this->write("Upgrading " . $config->siteTitle() . " . . . ");
15 15
         $db = new Db();
16 16
         $db->install();
17 17
         $this->write("Upgrade complete");
Please login to merge, or discard this patch.
src/Controllers/TagController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             . " FROM item_tags selected_tags"
40 40
             . " JOIN item_tags related_tags ON selected_tags.item = related_tags.item"
41 41
             . " JOIN tags ON related_tags.tag = tags.id"
42
-            . (!$tags->isEmpty() ? " WHERE selected_tags.tag IN (".$tags->toString().") " : '')
42
+            . (!$tags->isEmpty() ? " WHERE selected_tags.tag IN (" . $tags->toString() . ") " : '')
43 43
             . " GROUP BY tags.id ORDER BY tags.title ASC";
44 44
         $params = [];
45 45
         $template->tags = $this->db->query($tagsSql, $params);
Please login to merge, or discard this patch.
bootstrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,17 +12,17 @@
 block discarded – undo
12 12
 /**
13 13
  * Exception handling.
14 14
  */
15
-set_exception_handler([ \App\App::class, 'exceptionHandler' ]);
15
+set_exception_handler([\App\App::class, 'exceptionHandler']);
16 16
 
17 17
 /**
18 18
  * Configuration file. When testing, the tests/config.php file is used.
19 19
  */
20
-if (substr(basename($_SERVER['PHP_SELF']), 0, 7)==='phpunit') {
20
+if (substr(basename($_SERVER['PHP_SELF']), 0, 7) === 'phpunit') {
21 21
     define('CONFIG_FILE', __DIR__ . '/tests/config.php');
22 22
 } else {
23 23
     define('CONFIG_FILE', __DIR__ . '/config.php');
24 24
 }
25 25
 if (!file_exists(CONFIG_FILE)) {
26
-    echo "Please copy <code>config.example.php</code> to <code>".CONFIG_FILE."</code> and edit the values therein";
26
+    echo "Please copy <code>config.example.php</code> to <code>" . CONFIG_FILE . "</code> and edit the values therein";
27 27
     exit(1);
28 28
 }
Please login to merge, or discard this patch.
src/TagsIdentifier.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     }
66 66
 
67 67
     /**
68
-     * @param $str
68
+     * @param string $str
69 69
      * @return $this
70 70
      */
71 71
     public function removeFromString($str)
Please login to merge, or discard this patch.