Passed
Push — v1 ( e0b522...92f0bc )
by Andrew
09:16 queued 05:46
created
src/services/TypogrifyService.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -356,17 +356,17 @@
 block discarded – undo
356 356
         return Inflector::transliterate($string, $transliterator);
357 357
     }
358 358
 
359
-     /**
360
-     * Limits a string by word count. If $substring is provided, and truncating occurs, the
361
-     * string is further truncated so that the substring may be appended without
362
-     * exceeding the desired length.
363
-     *
364
-     * @param string $string
365
-     * @param int    $length
366
-     * @param string $substring
367
-     *
368
-     * @return string
369
-     */
359
+        /**
360
+         * Limits a string by word count. If $substring is provided, and truncating occurs, the
361
+         * string is further truncated so that the substring may be appended without
362
+         * exceeding the desired length.
363
+         *
364
+         * @param string $string
365
+         * @param int    $length
366
+         * @param string $substring
367
+         *
368
+         * @return string
369
+         */
370 370
     public function wordLimit(string $string, int $length, string $substring = '…'): string
371 371
     {
372 372
         $words = preg_split("/[\s]+/", strip_tags($string) );
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
         if (!empty($string)) {
145 145
             $string = strip_tags($string);
146
-            $result = (string)Stringy::create($string)->truncate($length, $substring);
146
+            $result = (string) Stringy::create($string)->truncate($length, $substring);
147 147
         }
148 148
 
149 149
         return $result;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
         if (!empty($string)) {
169 169
             $string = strip_tags($string);
170
-            $result = (string)Stringy::create($string)->safeTruncate($length, $substring);
170
+            $result = (string) Stringy::create($string)->safeTruncate($length, $substring);
171 171
         }
172 172
 
173 173
         return $result;
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
      */
370 370
     public function wordLimit(string $string, int $length, string $substring = '…'): string
371 371
     {
372
-        $words = preg_split("/[\s]+/", strip_tags($string) );
373
-        return implode(" ", array_slice($words, 0, $length) ) . $substring;
372
+        $words = preg_split("/[\s]+/", strip_tags($string));
373
+        return implode(" ", array_slice($words, 0, $length)).$substring;
374 374
     }
375 375
 }
Please login to merge, or discard this patch.
src/Typogrify.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
         Event::on(
65 65
             CraftVariable::class,
66 66
             CraftVariable::EVENT_INIT,
67
-            function (Event $event) {
67
+            function(Event $event) {
68 68
                 /** @var CraftVariable $variable */
69 69
                 $variable = $event->sender;
70 70
                 $variable->set('typogrify', self::$variable);
Please login to merge, or discard this patch.
src/variables/TypogrifyVariable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -299,7 +299,7 @@
 block discarded – undo
299 299
         if (empty($text)) {
300 300
             $text = '';
301 301
         }
302
-        $text = (string)$text;
302
+        $text = (string) $text;
303 303
 
304 304
         return $text;
305 305
     }
Please login to merge, or discard this patch.