Passed
Branch master (77647e)
by Chubarov
03:42 queued 01:12
created
src/helpers.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      *
32 32
      * @param  array|string  $key
33 33
      * @param  mixed  $default
34
-     * @return mixed
34
+     * @return string
35 35
      */
36 36
     function config($key = null, $default = null)
37 37
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use Illuminate\Support\Collection;
5 5
 
6 6
 
7
-if (! function_exists('app')) {
7
+if (!function_exists('app')) {
8 8
     /**
9 9
      * Get the available container instance.
10 10
      *
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 
26
-if (! function_exists('config')) {
26
+if (!function_exists('config')) {
27 27
     /**
28 28
      * Get / set the specified configuration value.
29 29
      *
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     }
48 48
 }
49 49
 
50
-if (! function_exists('collect')) {
50
+if (!function_exists('collect')) {
51 51
     /**
52 52
      * Create a collection from the given value.
53 53
      *
Please login to merge, or discard this patch.
src/CapsuleSettings.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
             is_a($this->capsule->getConnection()->getPdo(), \PDO::class );
38 38
         } catch (\Exception $exception)
39 39
         {
40
-           dd($exception->getMessage());
40
+            dd($exception->getMessage());
41 41
         }
42 42
     }
43 43
 }
44 44
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@  discard block
 block discarded – undo
7 7
 {
8 8
     protected $capsule;
9 9
 
10
-    public function __construct( Capsule $capsule )
10
+    public function __construct(Capsule $capsule)
11 11
     {
12 12
         $this->capsule = $capsule;
13 13
     }
14 14
 
15
-    public function settings( array $settings )
15
+    public function settings(array $settings)
16 16
     {
17 17
         $this->capsule->addConnection([
18 18
             'driver'    => $settings['databaseType'],
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function checkConnection()
35 35
     {
36
-        try{
37
-            is_a($this->capsule->getConnection()->getPdo(), \PDO::class );
36
+        try {
37
+            is_a($this->capsule->getConnection()->getPdo(), \PDO::class);
38 38
         } catch (\Exception $exception)
39 39
         {
40 40
            dd($exception->getMessage());
Please login to merge, or discard this patch.
src/ManagerMigrations.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@
 block discarded – undo
15 15
         foreach ($this->migrations as $migration)
16 16
         {
17 17
             $migration->check(function ($object){
18
-               $object->execute();
19
-           });
18
+                $object->execute();
19
+            });
20 20
         }
21 21
     }
22 22
 }
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     {
15 15
         foreach ($this->migrations as $migration)
16 16
         {
17
-            $migration->check(function ($object){
17
+            $migration->check(function($object) {
18 18
                $object->execute();
19 19
            });
20 20
         }
Please login to merge, or discard this patch.
src/database/migrations/RegionsMigration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 {
9 9
     public function execute()
10 10
     {
11
-        Capsule::schema()->create('regions', function ($table) {
11
+        Capsule::schema()->create('regions', function($table) {
12 12
             $table->increments('id');
13 13
             $table->integer('country_id')->unsigned()->index();
14 14
             $table->foreign('country_id')->references('id')->on('country')->onDelete('cascade');
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function check(callable $callback)
22 22
     {
23
-        if ( Capsule::schema()->hasTable('regions') === false )
23
+        if (Capsule::schema()->hasTable('regions') === false)
24 24
         {
25 25
             call_user_func($callback, $this);
26 26
         }
Please login to merge, or discard this patch.
src/database/migrations/CountryMigration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 {
10 10
     public function execute()
11 11
     {
12
-        Capsule::schema()->create('country', function ($table) {
12
+        Capsule::schema()->create('country', function($table) {
13 13
             $table->increments('id');
14 14
             $table->string('title', 100);
15 15
             $table->text('description')->nullable();
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function check(callable $callback)
21 21
     {
22
-        if ( Capsule::schema()->hasTable('country') === false )
22
+        if (Capsule::schema()->hasTable('country') === false)
23 23
         {
24 24
             call_user_func($callback, $this);
25 25
         }
Please login to merge, or discard this patch.
src/database/migrations/CitiesMigration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function execute()
12 12
     {
13
-        Capsule::schema()->create('cities', function ($table) {
13
+        Capsule::schema()->create('cities', function($table) {
14 14
             $table->increments('id');
15 15
             $table->integer('region_id')->unsigned()->index()->nullable();
16 16
             $table->foreign('region_id')->references('id')->on('regions')->onDelete('cascade');
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function check(callable $callback)
25 25
     {
26
-        if ( Capsule::schema()->hasTable('cities') === false )
26
+        if (Capsule::schema()->hasTable('cities') === false)
27 27
         {
28 28
             call_user_func($callback, $this);
29 29
         }
Please login to merge, or discard this patch.
src/database/seeds/CountryTableSeeder.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@
 block discarded – undo
13 13
      */
14 14
     public function run()
15 15
     {
16
-          $body      = file_get_contents('http://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang='. config('geography.locale') . '&code=' .  config('geography.country'));
17
-          $response  = json_decode($body, true);
16
+            $body      = file_get_contents('http://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang='. config('geography.locale') . '&code=' .  config('geography.country'));
17
+            $response  = json_decode($body, true);
18 18
 
19
-          Capsule::table( config('geography.nameTable.country') )->insert( $response['response']['items'] );
19
+            Capsule::table( config('geography.nameTable.country') )->insert( $response['response']['items'] );
20 20
     }
21 21
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@
 block discarded – undo
13 13
      */
14 14
     public function run()
15 15
     {
16
-          $body      = file_get_contents('http://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang='. config('geography.locale') . '&code=' .  config('geography.country'));
16
+          $body      = file_get_contents('http://api.vk.com/method/database.getCountries?v=5.5&need_all=1&count=1000&lang=' . config('geography.locale') . '&code=' . config('geography.country'));
17 17
           $response  = json_decode($body, true);
18 18
 
19
-          Capsule::table( config('geography.nameTable.country') )->insert( $response['response']['items'] );
19
+          Capsule::table(config('geography.nameTable.country'))->insert($response['response']['items']);
20 20
     }
21 21
 }
Please login to merge, or discard this patch.
src/database/seeds/CitiesTableSeeder.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@
 block discarded – undo
37 37
                 do {
38 38
                     $body          = file_get_contents(
39 39
                             'http://api.vk.com/method/database.getCities?v=5.5&country_id='
40
-                                     . $concreteCountry->id
41
-                                     . '&need_all=1&count=1000&offset='
42
-                                     . $offset);
40
+                                        . $concreteCountry->id
41
+                                        . '&need_all=1&count=1000&offset='
42
+                                        . $offset);
43 43
 
44 44
                     $responseArray = json_decode($body, true);
45 45
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
     public function run()
26 26
     {
27 27
         ini_set('memory_limit', '256M');
28
-        Capsule::transaction(function ()  {
28
+        Capsule::transaction(function() {
29 29
             $response  = [];
30 30
             $offset    = 0;
31 31
             $arrCities = [];
32
-            $regions   =  Capsule::table(config('geography.nameTable.regions'))->get()->pluck('id', 'title')->toArray();
33
-            $country   =  Capsule::table(config('geography.nameTable.country'))->get();
32
+            $regions   = Capsule::table(config('geography.nameTable.regions'))->get()->pluck('id', 'title')->toArray();
33
+            $country   = Capsule::table(config('geography.nameTable.country'))->get();
34 34
 
35 35
             foreach ($country as $concreteCountry)
36 36
             {
37 37
                 do {
38
-                    $body          = file_get_contents(
38
+                    $body = file_get_contents(
39 39
                             'http://api.vk.com/method/database.getCities?v=5.5&country_id='
40 40
                                      . $concreteCountry->id
41 41
                                      . '&need_all=1&count=1000&offset='
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
                             ];
54 54
                     }
55 55
 
56
-                    $response      = array_merge($response, $responseArray['response']['items']);
56
+                    $response = array_merge($response, $responseArray['response']['items']);
57 57
                     $offset += 1000;
58 58
 
59 59
                     Capsule::table('cities')->insert($arrCities);
60 60
                     $arrCities = [];
61
-                } while( ( count($responseArray['response']['items'])  > 0) );
61
+                } while ((count($responseArray['response']['items']) > 0));
62 62
             }
63 63
         });
64 64
     }
Please login to merge, or discard this patch.
src/database/seeds/RegionsTableSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     {
16 16
         $response = [];
17 17
 
18
-        Capsule::table( config('geography.nameTable.country') )->get()->each(function ($item) use ( &$response )
18
+        Capsule::table(config('geography.nameTable.country'))->get()->each(function($item) use (&$response)
19 19
         {
20 20
             $body          = file_get_contents('http://api.vk.com/method/database.getRegions?v=5.5&count=1000&country_id=' . $item->id);
21 21
             $responseArray = json_decode($body, true);
Please login to merge, or discard this patch.