@@ -4,46 +4,46 @@ |
||
4 | 4 | |
5 | 5 | class SetupCountriesTable extends Migration { |
6 | 6 | |
7 | - /** |
|
8 | - * Run the migrations. |
|
9 | - * |
|
10 | - * @return void |
|
11 | - */ |
|
12 | - public function up() |
|
13 | - { |
|
14 | - // Creates the users table |
|
15 | - Schema::create(\Config::get('countries.table_name'), function($table) |
|
16 | - { |
|
17 | - $table->integer('id')->unsigned()->index(); |
|
18 | - $table->string('capital', 255)->nullable(); |
|
19 | - $table->string('citizenship', 255)->nullable(); |
|
20 | - $table->string('country_code', 3)->default(''); |
|
21 | - $table->string('currency', 255)->nullable(); |
|
22 | - $table->string('currency_code', 255)->nullable(); |
|
23 | - $table->string('currency_sub_unit', 255)->nullable(); |
|
24 | - $table->string('currency_symbol', 3)->nullable(); |
|
25 | - $table->string('full_name', 255)->nullable(); |
|
26 | - $table->string('iso_3166_2', 2)->default(''); |
|
27 | - $table->string('iso_3166_3', 3)->default(''); |
|
28 | - $table->string('name', 255)->default(''); |
|
29 | - $table->string('region_code', 3)->default(''); |
|
30 | - $table->string('sub_region_code', 3)->default(''); |
|
31 | - $table->boolean('eea')->default(0); |
|
32 | - $table->string('calling_code', 3)->nullable(); |
|
33 | - $table->string('flag', 6)->nullable(); |
|
7 | + /** |
|
8 | + * Run the migrations. |
|
9 | + * |
|
10 | + * @return void |
|
11 | + */ |
|
12 | + public function up() |
|
13 | + { |
|
14 | + // Creates the users table |
|
15 | + Schema::create(\Config::get('countries.table_name'), function($table) |
|
16 | + { |
|
17 | + $table->integer('id')->unsigned()->index(); |
|
18 | + $table->string('capital', 255)->nullable(); |
|
19 | + $table->string('citizenship', 255)->nullable(); |
|
20 | + $table->string('country_code', 3)->default(''); |
|
21 | + $table->string('currency', 255)->nullable(); |
|
22 | + $table->string('currency_code', 255)->nullable(); |
|
23 | + $table->string('currency_sub_unit', 255)->nullable(); |
|
24 | + $table->string('currency_symbol', 3)->nullable(); |
|
25 | + $table->string('full_name', 255)->nullable(); |
|
26 | + $table->string('iso_3166_2', 2)->default(''); |
|
27 | + $table->string('iso_3166_3', 3)->default(''); |
|
28 | + $table->string('name', 255)->default(''); |
|
29 | + $table->string('region_code', 3)->default(''); |
|
30 | + $table->string('sub_region_code', 3)->default(''); |
|
31 | + $table->boolean('eea')->default(0); |
|
32 | + $table->string('calling_code', 3)->nullable(); |
|
33 | + $table->string('flag', 6)->nullable(); |
|
34 | 34 | |
35 | - $table->primary('id'); |
|
36 | - }); |
|
37 | - } |
|
35 | + $table->primary('id'); |
|
36 | + }); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * Reverse the migrations. |
|
41 | - * |
|
42 | - * @return void |
|
43 | - */ |
|
44 | - public function down() |
|
45 | - { |
|
46 | - Schema::drop(\Config::get('countries.table_name')); |
|
47 | - } |
|
39 | + /** |
|
40 | + * Reverse the migrations. |
|
41 | + * |
|
42 | + * @return void |
|
43 | + */ |
|
44 | + public function down() |
|
45 | + { |
|
46 | + Schema::drop(\Config::get('countries.table_name')); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | } |
@@ -42,7 +42,6 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * MailsAbstract constructor. |
44 | 44 | * |
45 | - * @param \Illuminate\Mail\Mailer $mail |
|
46 | 45 | */ |
47 | 46 | public function __construct() |
48 | 47 | { |
@@ -81,7 +80,7 @@ discard block |
||
81 | 80 | } |
82 | 81 | |
83 | 82 | /** |
84 | - * @param $subject |
|
83 | + * @param string $subject |
|
85 | 84 | */ |
86 | 85 | public function setSubject($subject) |
87 | 86 | { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function send($data = []) |
63 | 63 | { |
64 | - if(!$this->fromEmail || !$this->toEmail){ |
|
64 | + if (!$this->fromEmail || !$this->toEmail) { |
|
65 | 65 | throw new EmailIsMissedException(); |
66 | 66 | } |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | // check if sending emails is enabled and if this is not running a testing environment |
71 | 71 | if (Config::get('mail.enabled')) { |
72 | 72 | |
73 | - Mail::queue('EmailTemplates.' . $this->template, $data, function ($m) { |
|
73 | + Mail::queue('EmailTemplates.' . $this->template, $data, function($m) { |
|
74 | 74 | $m->from($this->fromEmail, $this->fromName); |
75 | 75 | $m->to($this->toEmail, $this->toName) |
76 | 76 | ->subject($this->subject); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
34 | 34 | * @param \App\Containers\Authentication\Tasks\GetAuthenticatedUserTask $getAuthenticatedUserTask |
35 | 35 | * |
36 | - * @return mixed |
|
36 | + * @return boolean |
|
37 | 37 | */ |
38 | 38 | public function authorize(Gate $gate, GetAuthenticatedUserTask $getAuthenticatedUserTask) |
39 | 39 | { |
@@ -19,8 +19,8 @@ |
||
19 | 19 | /* |
20 | 20 | * Authenticate the user's personal channel... |
21 | 21 | */ |
22 | - Broadcast::channel('App.User.*', function ($user, $userId) { |
|
23 | - return (int) $user->id === (int) $userId; |
|
22 | + Broadcast::channel('App.User.*', function($user, $userId) { |
|
23 | + return (int)$user->id === (int)$userId; |
|
24 | 24 | }); |
25 | 25 | } |
26 | 26 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $locale = $request->header('Content-Language'); |
39 | 39 | |
40 | 40 | // if the header is missed |
41 | - if(!$locale){ |
|
41 | + if (!$locale) { |
|
42 | 42 | // take the default local language |
43 | 43 | $locale = $this->app->config->get('app.locale'); |
44 | 44 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | throw (new MissingVisitorIdException()); |
42 | 42 | } |
43 | 43 | |
44 | - if($skipCriterias){ |
|
44 | + if ($skipCriterias) { |
|
45 | 45 | $this->userRepository = $this->userRepository->skipCriteria(); |
46 | 46 | } |
47 | 47 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function register() |
20 | 20 | { |
21 | - $this->app->bind('PortButler', function () { |
|
21 | + $this->app->bind('PortButler', function() { |
|
22 | 22 | return $this->app->make(PortButler::class); |
23 | 23 | }); |
24 | 24 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | public function up() |
13 | 13 | { |
14 | 14 | // Create table for storing roles |
15 | - Schema::create('roles', function (Blueprint $table) { |
|
15 | + Schema::create('roles', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('name')->unique(); |
18 | 18 | $table->string('display_name')->nullable(); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | }); |
22 | 22 | |
23 | 23 | // Create table for associating roles to users (Many-to-Many) |
24 | - Schema::create('role_user', function (Blueprint $table) { |
|
24 | + Schema::create('role_user', function(Blueprint $table) { |
|
25 | 25 | $table->integer('user_id')->unsigned(); |
26 | 26 | $table->integer('role_id')->unsigned(); |
27 | 27 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | }); |
35 | 35 | |
36 | 36 | // Create table for storing permissions |
37 | - Schema::create('permissions', function (Blueprint $table) { |
|
37 | + Schema::create('permissions', function(Blueprint $table) { |
|
38 | 38 | $table->increments('id'); |
39 | 39 | $table->string('name')->unique(); |
40 | 40 | $table->string('display_name')->nullable(); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | }); |
44 | 44 | |
45 | 45 | // Create table for associating permissions to roles (Many-to-Many) |
46 | - Schema::create('permission_role', function (Blueprint $table) { |
|
46 | + Schema::create('permission_role', function(Blueprint $table) { |
|
47 | 47 | $table->integer('permission_id')->unsigned(); |
48 | 48 | $table->integer('role_id')->unsigned(); |
49 | 49 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function debugDatabaseQueries($log = true, $terminal = false) |
29 | 29 | { |
30 | 30 | if (Config::get('database.query_debugging')) { |
31 | - DB::listen(function ($event) use ($terminal, $log) { |
|
31 | + DB::listen(function($event) use ($terminal, $log) { |
|
32 | 32 | $fullQuery = vsprintf(str_replace(['%', '?'], ['%%', '%s'], $event->sql), $event->bindings); |
33 | 33 | |
34 | 34 | $text = $event->connectionName . ' (' . $event->time . '): ' . $fullQuery; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function changeTheDefaultDatabaseModelsFactoriesPath($customPath) |
53 | 53 | { |
54 | - App::singleton(\Illuminate\Database\Eloquent\Factory::class, function ($app) use ($customPath) { |
|
54 | + App::singleton(\Illuminate\Database\Eloquent\Factory::class, function($app) use ($customPath) { |
|
55 | 55 | $faker = $app->make(\Faker\Generator::class); |
56 | 56 | |
57 | 57 | return \Illuminate\Database\Eloquent\Factory::construct($faker, base_path() . $customPath); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $allServiceProviders[] = PortButler::buildMainServiceProvider($containersNamespace, $containerName); |
73 | 73 | } |
74 | 74 | |
75 | - return array_unique($allServiceProviders) ? : []; |
|
75 | + return array_unique($allServiceProviders) ?: []; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | if (File::isDirectory($containerMigrationDirectory)) { |
103 | 103 | |
104 | - App::afterResolving('migrator', function ($migrator) use ($containerMigrationDirectory) { |
|
104 | + App::afterResolving('migrator', function($migrator) use ($containerMigrationDirectory) { |
|
105 | 105 | foreach ((array)$containerMigrationDirectory as $path) { |
106 | 106 | $migrator->path($path); |
107 | 107 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | // if DataArray `\League\Fractal\Serializer\DataArraySerializer` do noting since it's set by default by the Dingo API |
130 | 130 | if ($serializerName !== 'DataArray') { |
131 | - app('Dingo\Api\Transformer\Factory')->setAdapter(function () use ($serializerName) { |
|
131 | + app('Dingo\Api\Transformer\Factory')->setAdapter(function() use ($serializerName) { |
|
132 | 132 | switch ($serializerName) { |
133 | 133 | case 'JsonApi': |
134 | 134 | $serializer = new \League\Fractal\Serializer\JsonApiSerializer(Config::get('api.domain')); |
@@ -48,6 +48,7 @@ discard block |
||
48 | 48 | * By default Laravel takes (server/database/factories) as the |
49 | 49 | * path to the factories, this function changes the path to load |
50 | 50 | * the factories from the infrastructure directory. |
51 | + * @param string $customPath |
|
51 | 52 | */ |
52 | 53 | public function changeTheDefaultDatabaseModelsFactoriesPath($customPath) |
53 | 54 | { |
@@ -138,7 +139,7 @@ discard block |
||
138 | 139 | } |
139 | 140 | |
140 | 141 | /** |
141 | - * @param $directory |
|
142 | + * @param string $directory |
|
142 | 143 | */ |
143 | 144 | private function loadConfigs($directory) |
144 | 145 | { |