Completed
Push — master ( 9c17ee...81c77a )
by Aitor Riba
01:42
created
src/Views/translations.blade.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -156,13 +156,13 @@
 block discarded – undo
156 156
 $( function() {
157 157
 	$('#delete').click(function() {
158 158
 		<?php $url_route = url('/').'/'.config('laralang.default.prefix').'/delete';
159
-		?>
159
+        ?>
160 160
 		$.get("{{ $url_route }}"+'/'+$('.trans-id').val());
161 161
 	});
162 162
 	$('#edit').click(function() {
163 163
 		var translation = $('.input-trans').val();
164 164
 		<?php $url_route = url('/').'/'.config('laralang.default.prefix').'/edit';
165
-		?>
165
+        ?>
166 166
 		$.get("{{ $url_route }}"+'/'+$('.trans-id').val()+'/'+translation);
167 167
 	});
168 168
 
Please login to merge, or discard this patch.
src/Controllers/LaralangController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     public function login(Request $request)
22 22
     {
23
-        session(['laralang.password' => Crypt::encrypt($request->input('password'))]);
23
+        session([ 'laralang.password' => Crypt::encrypt($request->input('password')) ]);
24 24
         if (Crypt::decrypt(session('laralang.password')) != config('laralang.default.password')) {
25 25
             return redirect(Route('laralang::login'))
26 26
             ->with('status', 'Invalid password');
Please login to merge, or discard this patch.
src/Migrations/2016_11_04_135240_laralang_translations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('laralang_translations', function (Blueprint $table) {
16
+        Schema::create('laralang_translations', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('translator');
19 19
             $table->string('string');
Please login to merge, or discard this patch.
src/Builder/ApertiumTrans.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $words = explode(' ', $transObtained);
44 44
                 foreach ($words as $word) {
45 45
                     if ($word != '') {
46
-                        if ($word[0] == '*') {
46
+                        if ($word[ 0 ] == '*') {
47 47
                             $errors = $errors.substr($word, 1).', ';
48 48
                         }
49 49
                     }
Please login to merge, or discard this patch.
src/Builder/Translation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
         if ($this->debug === true) {
119 119
             $this->translation = "<font style='color:#00CC00;'>Translation loaded from DB</font>";
120 120
         } else {
121
-            $this->translation = $existing[0]->translation;
121
+            $this->translation = $existing[ 0 ]->translation;
122 122
         }
123 123
 
124 124
         return true;
Please login to merge, or discard this patch.
src/Builder/MymemoryTrans.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -5,42 +5,42 @@
 block discarded – undo
5 5
 class MymemoryTrans extends Translation
6 6
 {
7 7
     /**
8
-      * Get translation from mymemory API.
9
-      */
10
-     public function main()
11
-     {
12
-         $host = 'api.mymemory.translated.net';
8
+     * Get translation from mymemory API.
9
+     */
10
+        public function main()
11
+        {
12
+            $host = 'api.mymemory.translated.net';
13 13
 
14
-         // Check if host is online.
15
-         if ($this->checkHost($host)) {
14
+            // Check if host is online.
15
+            if ($this->checkHost($host)) {
16 16
 
17
-             // Host online
18
-             $urlString = urlencode($this->string);
19
-             $url = "http://$host/get?q=$urlString&langpair=$this->from%7C$this->to";
20
-             $json = file_get_contents($url);
21
-             $data = json_decode($json);
17
+                // Host online
18
+                $urlString = urlencode($this->string);
19
+                $url = "http://$host/get?q=$urlString&langpair=$this->from%7C$this->to";
20
+                $json = file_get_contents($url);
21
+                $data = json_decode($json);
22 22
 
23
-             // Checking response status
24
-             if ($data->responseStatus != 200) {
25
-                 if ($this->debug == true) {
26
-                     $details = $data->responseDetails;
27
-                     if ($data->responseStatus == 403) {
28
-                         $details = ($data->responseDetails);
29
-                     }
30
-                     $this->translation = "<font style='color:red;'>Error ".$data->responseStatus.': '.$details.'</font>';
31
-                 }
23
+                // Checking response status
24
+                if ($data->responseStatus != 200) {
25
+                    if ($this->debug == true) {
26
+                        $details = $data->responseDetails;
27
+                        if ($data->responseStatus == 403) {
28
+                            $details = ($data->responseDetails);
29
+                        }
30
+                        $this->translation = "<font style='color:red;'>Error ".$data->responseStatus.': '.$details.'</font>';
31
+                    }
32 32
 
33
-                 return;
34
-             }
33
+                    return;
34
+                }
35 35
 
36 36
 
37
-             $transObtained = $data->responseData->translatedText;
37
+                $transObtained = $data->responseData->translatedText;
38 38
 
39
-             $this->translation = ucfirst(strtolower(trim($transObtained)));
39
+                $this->translation = ucfirst(strtolower(trim($transObtained)));
40 40
 
41
-             $this->checkSave();
41
+                $this->checkSave();
42 42
 
43
-             return;
44
-         }
45
-     }
43
+                return;
44
+            }
45
+        }
46 46
 }
Please login to merge, or discard this patch.
src/Builder.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 static function trans($string)
12 12
     {
13 13
         $translator = config('laralang.default.translator');
14
-        if (!in_array(config('laralang.default.translator'), ['apertium', 'mymemory'])) {
14
+        if (!in_array(config('laralang.default.translator'), [ 'apertium', 'mymemory' ])) {
15 15
             return new Exception("<font style='color:red;'>Laralang doesn't support $translator translator. Check config</font>");
16 16
         } else {
17 17
             if (config('laralang.default.translator') == 'mymemory') {
Please login to merge, or discard this patch.
src/Builder/Exception.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 class Exception extends Translation
6 6
 {
7 7
     /**
8
-      * This function do nothing, but it's neccesary to create an exception object.
9
-      */
10
-     public function main()
11
-     {
12
-     }
8
+     * This function do nothing, but it's neccesary to create an exception object.
9
+     */
10
+        public function main()
11
+        {
12
+        }
13 13
 }
Please login to merge, or discard this patch.
src/Routes/web.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2
-if (config('laralang.default.routes')){
3
-    Route::group(['middleware' => 'web', 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers'], function () {
2
+if (config('laralang.default.routes')) {
3
+    Route::group([ 'middleware' => 'web', 'as' => 'laralang::', 'prefix' => config('laralang.default.prefix'), 'namespace' => 'Aitor24\Laralang\Controllers' ], function() {
4 4
         Route::get('/login', 'LaralangController@showLogin')->name('login');
5 5
         Route::post('/login', 'LaralangController@login');
6 6
 
7
-        Route::group(['middleware' => 'laralang.middleware'], function () {
8
-            Route::get('/', function () {
7
+        Route::group([ 'middleware' => 'laralang.middleware' ], function() {
8
+            Route::get('/', function() {
9 9
                 return redirect(Route('laralang::translations'));
10 10
             })->name('home');
11 11
             Route::get('/translations', 'LaralangController@showTranslations')->name('translations');
12 12
             Route::post('/delete', 'LaralangController@deleteTranslation')->name('delete');
13 13
             Route::post('/edit', 'LaralangController@editTranslation');
14 14
             Route::get('/logout', 'LaralangController@logout')->name('logout');
15
-            Route::group(['middleware' => ['throttle:5000,1', 'bindings']], function () {
15
+            Route::group([ 'middleware' => [ 'throttle:5000,1', 'bindings' ] ], function() {
16 16
                 Route::get('/api', 'LaralangController@api')->name('api');
17 17
             });
18 18
         });
Please login to merge, or discard this patch.