Passed
Push — Showing-Posts ( 4f10d0...fe7f0c )
by Stone
01:55
created
App/Controllers/Ajax/ImageUpload.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
                 return;
47 47
             }
48 48
 
49
-            $filetowrite = $folder . $tempFile['name'];
49
+            $filetowrite = $folder.$tempFile['name'];
50 50
             move_uploaded_file($tempFile['tmp_name'], $filetowrite);
51 51
 
52 52
             // Respond to the successful upload with JSON.
53 53
             echo json_encode(array('location' => $filetowrite));
54
-        } else {
54
+        }else {
55 55
             // Notify editor that the upload failed
56 56
             echo json_encode(array('error' => 'Upload failed'));
57 57
         }
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
                 return;
80 80
             }
81 81
 
82
-            $filetowrite = $this->imageFolder . $tempFile['name'];
82
+            $filetowrite = $this->imageFolder.$tempFile['name'];
83 83
             move_uploaded_file($tempFile['tmp_name'], $filetowrite);
84 84
 
85 85
             // Respond to the successful upload with JSON.
86 86
             echo json_encode(array('location' => $filetowrite));
87
-        } else {
87
+        }else {
88 88
             // Notify editor that the upload failed
89 89
             header("HTTP/1.1 500 Server Error");
90 90
         }
Please login to merge, or discard this patch.
App/Controllers/Admin/Post.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
         $postId = $postModel->newPost($title, $postImage, $idCategory, $article, $idUser, $published, $onFrontpage,
84 84
             $postSlug);
85 85
 
86
-        echo "<p>new post ID : " . $postId . "</p>";
86
+        echo "<p>new post ID : ".$postId."</p>";
87 87
 
88 88
         //TODO add the tags and create new tags if necessary
89 89
 
Please login to merge, or discard this patch.
Core/Traits/StringFunctions.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,21 +75,21 @@
 block discarded – undo
75 75
      * @return string the shortend text
76 76
      * @throws \ErrorException
77 77
      */
78
-    public function getExcerpt(string $text, int $count=Constant::EXCERPT_WORD_COUNT){
79
-        if($count < 1){
78
+    public function getExcerpt(string $text, int $count = Constant::EXCERPT_WORD_COUNT) {
79
+        if ($count < 1) {
80 80
             throw new \ErrorException('excerpt length too low');
81 81
         }
82 82
 
83 83
         $text = str_replace("  ", " ", $text);
84 84
         $string = explode(" ", $text);
85
-        if(count($string) <= $count){
85
+        if (count($string) <= $count) {
86 86
             return $text;
87 87
         }
88 88
         $trimed = '';
89
-        for ( $wordCounter = 0; $wordCounter < $count; $wordCounter++ ){
89
+        for ($wordCounter = 0; $wordCounter < $count; $wordCounter++) {
90 90
             //TODO Take into account the "read more" tag
91 91
             $trimed .= $string[$wordCounter];
92
-            if ( $wordCounter < $count-1 ){ $trimed .= " "; }
92
+            if ($wordCounter < $count - 1) { $trimed .= " "; }
93 93
             else { $trimed .= "..."; }
94 94
         }
95 95
         $trimed = trim($trimed);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,8 +89,7 @@
 block discarded – undo
89 89
         for ( $wordCounter = 0; $wordCounter < $count; $wordCounter++ ){
90 90
             //TODO Take into account the "read more" tag
91 91
             $trimed .= $string[$wordCounter];
92
-            if ( $wordCounter < $count-1 ){ $trimed .= " "; }
93
-            else { $trimed .= "..."; }
92
+            if ( $wordCounter < $count-1 ){ $trimed .= " "; } else { $trimed .= "..."; }
94 93
         }
95 94
         $trimed = trim($trimed);
96 95
         return $trimed;
Please login to merge, or discard this patch.