Completed
Push — master ( d1b83c...572a9e )
by Chubarov
12:29 queued 10:25
created
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 ) : void
15
+    public function settings(array $settings) : void
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() : void
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/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/helpers.php 1 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/Commands/MigrateLaravelCommand.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@
 block discarded – undo
18 18
     ];
19 19
 
20 20
     protected $listFilesSeeder = [
21
-      'CountryTableSeeder' => 'CountryTableSeeder.php',
22
-      'RegionsTableSeeder' => 'RegionsTableSeeder.php',
23
-      'CitiesTableSeeder'  => 'CitiesTableSeeder.php'
21
+        'CountryTableSeeder' => 'CountryTableSeeder.php',
22
+        'RegionsTableSeeder' => 'RegionsTableSeeder.php',
23
+        'CitiesTableSeeder'  => 'CitiesTableSeeder.php'
24 24
     ];
25 25
 
26 26
     protected $formatterStyle;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
         
51 51
         $this->progressBar->start();
52 52
 
53
-        $this->moveMigrate( $this->progressBar );
54
-        $this->moveSeeders( $this->progressBar );
55
-        $this->moveConfig(  $this->progressBar );
53
+        $this->moveMigrate($this->progressBar);
54
+        $this->moveSeeders($this->progressBar);
55
+        $this->moveConfig($this->progressBar);
56 56
 
57 57
         $this->progressBar->finish();
58 58
         $output->writeln(['']);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
     protected function moveMigrate(ProgressBar $progress)
63 63
     {
64
-        $pathToMigrationsLaravel  =  $_SERVER["PWD"] . '/database/migrations/';
64
+        $pathToMigrationsLaravel  = $_SERVER["PWD"] . '/database/migrations/';
65 65
         $pathToStubs              = __DIR__ . '/../database/migrations/stubs/';
66 66
 
67 67
         $this->createDir($pathToMigrationsLaravel);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
     protected function moveSeeders(ProgressBar $progress)
78 78
     {
79
-        $pathToSeedersLaravel     =  $_SERVER["PWD"] . '/database/seeds/';
79
+        $pathToSeedersLaravel     = $_SERVER["PWD"] . '/database/seeds/';
80 80
         $pathToSeed               = __DIR__ . '/../database/seeds/stubs/';
81 81
 
82 82
         $this->createDir($pathToSeedersLaravel);
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
     protected function moveConfig(ProgressBar $progress) : void
93 93
     {
94 94
         $pathToConfig               = __DIR__ . '/../config.php';
95
-        $pathToConfigsLaravel       =  $_SERVER["PWD"] . '/config/';
95
+        $pathToConfigsLaravel       = $_SERVER["PWD"] . '/config/';
96 96
         $this->createDir($pathToConfigsLaravel);
97 97
 
98
-        copy($pathToConfig,$pathToConfigsLaravel . 'geography.php' );
98
+        copy($pathToConfig, $pathToConfigsLaravel . 'geography.php');
99 99
         $progress->advance();
100 100
     }
101 101
 
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
     protected function getDateNormalize() : string
129 129
     {
130 130
         $date = Carbon::now();
131
-        $date = preg_replace('/-|\s/','_', $date);
132
-        $data = preg_replace('/:/','', $date);
131
+        $date = preg_replace('/-|\s/', '_', $date);
132
+        $data = preg_replace('/:/', '', $date);
133 133
 
134 134
         return $data;
135 135
     }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 
124 124
     /**
125 125
      * Get date normalize mow
126
-     * @return mixed
126
+     * @return string
127 127
      */
128 128
     protected function getDateNormalize() : string
129 129
     {
Please login to merge, or discard this patch.
src/Commands/InstallCommand.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@
 block discarded – undo
90 90
         $this->settings['databasePassword']    = $helper->ask($input, $output, $question);
91 91
 
92 92
 
93
-         $table = new Table($output);
94
-         $table->setHeaders(array('name', 'value'))
93
+            $table = new Table($output);
94
+            $table->setHeaders(array('name', 'value'))
95 95
                 ->setRows(array(
96 96
                     array('Type database', $this->settings['databaseType']),
97 97
                     array('Host database', $this->settings['host']),
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -55,30 +55,30 @@  discard block
 block discarded – undo
55 55
         $this->settings['databaseType'] = $helper->ask($input, $output, $question);
56 56
 
57 57
         $output->writeln('');
58
-        $output->writeln( " You have just selected: <info>{$this->settings['databaseType']}</info>");
58
+        $output->writeln(" You have just selected: <info>{$this->settings['databaseType']}</info>");
59 59
 
60 60
         $helper   = $this->getHelper('question');
61 61
         $question = new Question("Enter <info>host</info> for database , please : ", 'localhost');
62 62
 
63 63
         // get host
64
-        $this->settings['host']     = $helper->ask($input, $output, $question);
65
-        $output->writeln( " You have just selected: <info>{$this->settings['host']} </info>");
64
+        $this->settings['host'] = $helper->ask($input, $output, $question);
65
+        $output->writeln(" You have just selected: <info>{$this->settings['host']} </info>");
66 66
 
67 67
         $output->writeln('');
68 68
         $helper   = $this->getHelper('question');
69 69
         $question = new Question("Enter <info>database name</info>,  please : ");
70 70
 
71 71
         // get name database
72
-        $this->settings['databaseName']     = $helper->ask($input, $output, $question);
73
-        $output->writeln( " You have just selected: <info>{$this->settings['databaseName']} </info>");
72
+        $this->settings['databaseName'] = $helper->ask($input, $output, $question);
73
+        $output->writeln(" You have just selected: <info>{$this->settings['databaseName']} </info>");
74 74
 
75 75
         $output->writeln('');
76 76
         $helper   = $this->getHelper('question');
77 77
         $question = new Question("Enter <info>database username</info>,  please : ");
78 78
 
79 79
         //get username in database
80
-        $this->settings['databaseUsername']     = $helper->ask($input, $output, $question);
81
-        $output->writeln( " You have just selected: <info>{$this->settings['databaseUsername']} </info>");
80
+        $this->settings['databaseUsername'] = $helper->ask($input, $output, $question);
81
+        $output->writeln(" You have just selected: <info>{$this->settings['databaseUsername']} </info>");
82 82
 
83 83
         $output->writeln('');
84 84
         $helper   = $this->getHelper('question');
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $question->setHiddenFallback(false);
88 88
 
89 89
         // get password
90
-        $this->settings['databasePassword']    = $helper->ask($input, $output, $question);
90
+        $this->settings['databasePassword'] = $helper->ask($input, $output, $question);
91 91
 
92 92
 
93 93
          $table = new Table($output);
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
         }
110 110
         // connection database
111 111
         $capsule = new CapsuleSettings(new Manager());
112
-        $capsule->settings( $this->settings );
112
+        $capsule->settings($this->settings);
113 113
         $capsule->checkConnection();
114 114
 
115 115
 
116
-        $output->writeln(['','', '<info>Then go ahead!</info>']);
116
+        $output->writeln(['', '', '<info>Then go ahead!</info>']);
117 117
 
118 118
         $helper = $this->getHelper('question');
119 119
         $question = new ChoiceQuestion(
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
         $output->writeln('<comment>example EN, RU</comment>');
135 135
 
136 136
         //  the list of countries that need to migrate
137
-        $this->settings['country']     = $helper->ask($input, $output, $question);
138
-        $output->writeln( " You have just selected: <info>{$this->settings['country']} </info>");
139
-        config(['geography.country' =>  $this->settings['country'] ]);
137
+        $this->settings['country'] = $helper->ask($input, $output, $question);
138
+        $output->writeln(" You have just selected: <info>{$this->settings['country']} </info>");
139
+        config(['geography.country' =>  $this->settings['country']]);
140 140
 
141 141
         $io = new SymfonyStyle($input, $output);
142 142
         $io->progressStart(3);
Please login to merge, or discard this patch.
src/Support/Local.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@
 block discarded – undo
19 19
 
20 20
     public function setLocal(string $local)
21 21
     {
22
-        if ( isset($this->mapLocal[$local]) )
22
+        if (isset($this->mapLocal[$local]))
23 23
         {
24 24
             config(['geography.locale' => $this->mapLocal[$local]]);
25
-        } else{
25
+        } else {
26 26
             throw new Exception('not locale');
27 27
         }
28 28
 
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->string('code')->nullable()->comments('unique value');
@@ -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('country') === false )
23
+        if (Capsule::schema()->hasTable('country') === false)
24 24
         {
25 25
             call_user_func($callback, $this);
26 26
         }
Please login to merge, or discard this patch.