Completed
Push — master ( 64c14b...60e2f6 )
by Vojta
35:53 queued 28:45
created
classes/TimeDiffTranslator.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
 {
8 8
     public function trans($id, array $parameters = [], $domain = 'messages', $locale = null)
9 9
     {
10
-        return $this->get('vojtasvoboda.twigextensions::lang.' . $id, $parameters, $locale);
10
+        return $this->get('vojtasvoboda.twigextensions::lang.'.$id, $parameters, $locale);
11 11
     }
12 12
 
13 13
     public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null)
14 14
     {
15
-        return $this->choice('vojtasvoboda.twigextensions::lang.' . $id, $number, $parameters, $locale);
15
+        return $this->choice('vojtasvoboda.twigextensions::lang.'.$id, $number, $parameters, $locale);
16 16
     }
17 17
 }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,5 @@
 block discarded – undo
1 1
 <?php namespace VojtaSvoboda\TwigExtensions\Classes;
2 2
 
3
-use App;
4 3
 use October\Rain\Translation\Translator;
5 4
 use Symfony\Component\Translation\TranslatorInterface;
6 5
 
Please login to merge, or discard this patch.
tests/PluginTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use Twig_Environment;
10 10
 use VojtaSvoboda\TwigExtensions\Classes\TimeDiffTranslator;
11 11
 
12
-require_once __DIR__ . '/../vendor/autoload.php';
12
+require_once __DIR__.'/../vendor/autoload.php';
13 13
 
14 14
 class PluginTest extends PluginTestCase
15 15
 {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $twig = $this->getTwig();
117 117
 
118 118
         $now = Carbon::now()->subMinute();
119
-        $template = "{{ '" . $now->format('Y-m-d H:i:s') . "' | time_diff }}";
119
+        $template = "{{ '".$now->format('Y-m-d H:i:s')."' | time_diff }}";
120 120
 
121 121
         // this test fails at TravisCI and I don't know why
122 122
         $twigTemplate = $twig->createTemplate($template);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $key = 'app.custom.key';
317 317
         $value = 'test value';
318 318
         Config::set($key, $value);
319
-        $template = "{{ config('" . $key . "') }}";
319
+        $template = "{{ config('".$key."') }}";
320 320
 
321 321
         $twigTemplate = $twig->createTemplate($template);
322 322
         $this->assertEquals($twigTemplate->render([]), $value);
Please login to merge, or discard this patch.
Plugin.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -378,7 +378,9 @@
 block discarded – undo
378 378
         $key = str_shuffle($character_set);
379 379
         $cipher_text = '';
380 380
         $id = 'e' . rand(1, 999999999);
381
-        for ($i = 0; $i < strlen($email); $i += 1) $cipher_text .= $key[strpos($character_set, $email[$i])];
381
+        for ($i = 0; $i < strlen($email); $i += 1) {
382
+            $cipher_text .= $key[strpos($character_set, $email[$i])];
383
+        }
382 384
         $script = 'var a="' . $key . '";var b=a.split("").sort().join("");var c="' . $cipher_text . '";var d="";';
383 385
         $script .= 'for(var e=0;e<c.length;e++)d+=b.charAt(a.indexOf(c.charAt(e)));';
384 386
         $script .= 'var y = d;';
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,5 @@
 block discarded – undo
1 1
 <?php namespace VojtaSvoboda\TwigExtensions;
2 2
 
3
-use App;
4
-use Backend;
5 3
 use Carbon\Carbon;
6 4
 use Snilius\Twig\SortByFieldExtension;
7 5
 use System\Classes\PluginBase;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -373,30 +373,30 @@  discard block
 block discarded – undo
373 373
 
374 374
         // if we want just unprotected link
375 375
         if (!$protected) {
376
-            return $link ? '<a href="mailto:' . $email . '">' . $linkText . '</a>' : $linkText;
376
+            return $link ? '<a href="mailto:'.$email.'">'.$linkText.'</a>' : $linkText;
377 377
         }
378 378
 
379 379
         // turn on protection
380 380
         $character_set = '+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
381 381
         $key = str_shuffle($character_set);
382 382
         $cipher_text = '';
383
-        $id = 'e' . rand(1, 999999999);
383
+        $id = 'e'.rand(1, 999999999);
384 384
         for ($i = 0; $i < strlen($email); $i += 1) $cipher_text .= $key[strpos($character_set, $email[$i])];
385
-        $script = 'var a="' . $key . '";var b=a.split("").sort().join("");var c="' . $cipher_text . '";var d="";';
385
+        $script = 'var a="'.$key.'";var b=a.split("").sort().join("");var c="'.$cipher_text.'";var d="";';
386 386
         $script .= 'for(var e=0;e<c.length;e++)d+=b.charAt(a.indexOf(c.charAt(e)));';
387 387
         $script .= 'var y = d;';
388 388
         if ($text !== null) {
389 389
             $script .= 'var y = "'.$text.'";';
390 390
         }
391 391
         if ($link) {
392
-            $script .= 'document.getElementById("' . $id . '").innerHTML="<a href=\\"mailto:"+d+"\\">"+y+"</a>"';
392
+            $script .= 'document.getElementById("'.$id.'").innerHTML="<a href=\\"mailto:"+d+"\\">"+y+"</a>"';
393 393
         } else {
394
-            $script .= 'document.getElementById("' . $id . '").innerHTML=y';
394
+            $script .= 'document.getElementById("'.$id.'").innerHTML=y';
395 395
         }
396
-        $script = "eval(\"" . str_replace(array("\\", '"'), array("\\\\", '\"'), $script) . "\")";
397
-        $script = '<script type="text/javascript">/*<![CDATA[*/' . $script . '/*]]>*/</script>';
396
+        $script = "eval(\"".str_replace(array("\\", '"'), array("\\\\", '\"'), $script)."\")";
397
+        $script = '<script type="text/javascript">/*<![CDATA[*/'.$script.'/*]]>*/</script>';
398 398
 
399
-        return '<span id="' . $id . '">[javascript protected email address]</span>' . $script;
399
+        return '<span id="'.$id.'">[javascript protected email address]</span>'.$script;
400 400
     }
401 401
 
402 402
     /**
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
     private function getFileRevision()
412 412
     {
413 413
         return [
414
-            'revision' => function ($filename, $format = null) {
414
+            'revision' => function($filename, $format = null) {
415 415
                 // Remove http/web address from the file name if there is one to load it locally
416 416
                 $prefix = url('/');
417
-                $filename_ = trim(preg_replace('/^' . preg_quote($prefix, '/') . '/', '', $filename), '/');
417
+                $filename_ = trim(preg_replace('/^'.preg_quote($prefix, '/').'/', '', $filename), '/');
418 418
                 if (file_exists($filename_)) {
419 419
                     $timestamp = filemtime($filename_);
420 420
                     $prepend = ($format) ? date($format, $timestamp) : $timestamp;
421 421
 
422
-                    return $filename . "?" . $prepend;
422
+                    return $filename."?".$prepend;
423 423
                 }
424 424
 
425 425
                 return $filename;
Please login to merge, or discard this patch.