Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit 0c113a4

Browse files
authored
Apply fixes from StyleCI (#4912)
1 parent 3d9690d commit 0c113a4

14 files changed

+40
-30
lines changed

migrations/2018_03_16_000000_make_settings_value_nullable.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Database\Schema\Blueprint;
5-
use Illuminate\Support\Facades\Schema;
65
use Illuminate\Support\Facades\DB;
6+
use Illuminate\Support\Facades\Schema;
77

88
class MakeSettingsValueNullable extends Migration
99
{

routes/voyager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
Route::get($dataType->slug.'/order', $breadController.'@order')->name($dataType->slug.'.order');
4545
Route::post($dataType->slug.'/action', $breadController.'@action')->name($dataType->slug.'.action');
46-
Route::post($dataType->slug.'/order', $breadController.'@update_order')->name($dataType->slug.'.update_order');;
46+
Route::post($dataType->slug.'/order', $breadController.'@update_order')->name($dataType->slug.'.update_order');
4747
Route::get($dataType->slug.'/{id}/restore', $breadController.'@restore')->name($dataType->slug.'.restore');
4848
Route::get($dataType->slug.'/relation', $breadController.'@relation')->name($dataType->slug.'.relation');
4949
Route::post($dataType->slug.'/remove', $breadController.'@remove_media')->name($dataType->slug.'.media.remove');

src/Database/Schema/ForeignKey.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ public static function make(array $foreignKey)
2929
}
3030

3131
$doctrineForeignKey = new DoctrineForeignKey(
32-
$localColumns, $foreignTable, $foreignColumns, $name, $options
32+
$localColumns,
33+
$foreignTable,
34+
$foreignColumns,
35+
$name,
36+
$options
3337
);
3438

3539
if (isset($localTable)) {

src/Http/Controllers/ContentTypes/Image.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public function handle()
2525
$resize_width = null;
2626
$resize_height = null;
2727
if (isset($this->options->resize) && (
28-
isset($this->options->resize->width) || isset($this->options->resize->height)
29-
)) {
28+
isset($this->options->resize->width) || isset($this->options->resize->height)
29+
)) {
3030
if (isset($this->options->resize->width)) {
3131
$resize_width = $this->options->resize->width;
3232
}
@@ -75,17 +75,17 @@ function (Constraint $constraint) {
7575
}
7676

7777
$image = InterventionImage::make($file)
78-
->orientate()
78+
->orientate()
7979
->resize(
80-
$thumb_resize_width,
81-
$thumb_resize_height,
82-
function (Constraint $constraint) {
80+
$thumb_resize_width,
81+
$thumb_resize_height,
82+
function (Constraint $constraint) {
8383
$constraint->aspectRatio();
8484
if (isset($this->options->upsize) && !$this->options->upsize) {
8585
$constraint->upsize();
8686
}
8787
}
88-
)->encode($file->getClientOriginalExtension(), $resize_quality);
88+
)->encode($file->getClientOriginalExtension(), $resize_quality);
8989
} elseif (isset($thumbnails->crop->width) && isset($thumbnails->crop->height)) {
9090
$crop_width = $thumbnails->crop->width;
9191
$crop_height = $thumbnails->crop->height;

src/Http/Controllers/ContentTypes/MultipleImage.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public function handle()
3232
$resize_height = null;
3333

3434
if (isset($this->options->resize) && (
35-
isset($this->options->resize->width) || isset($this->options->resize->height)
36-
)) {
35+
isset($this->options->resize->width) || isset($this->options->resize->height)
36+
)) {
3737
if (isset($this->options->resize->width)) {
3838
$resize_width = $this->options->resize->width;
3939
}
@@ -83,15 +83,15 @@ function (Constraint $constraint) {
8383
$image = InterventionImage::make($file)
8484
->orientate()
8585
->resize(
86-
$thumb_resize_width,
87-
$thumb_resize_height,
88-
function (Constraint $constraint) {
86+
$thumb_resize_width,
87+
$thumb_resize_height,
88+
function (Constraint $constraint) {
8989
$constraint->aspectRatio();
9090
if (isset($this->options->upsize) && !$this->options->upsize) {
9191
$constraint->upsize();
9292
}
9393
}
94-
)->encode($file->getClientOriginalExtension(), $resize_quality);
94+
)->encode($file->getClientOriginalExtension(), $resize_quality);
9595
} elseif (isset($this->options->thumbnails) && isset($thumbnails->crop->width) && isset($thumbnails->crop->height)) {
9696
$crop_width = $thumbnails->crop->width;
9797
$crop_height = $thumbnails->crop->height;

src/Http/Controllers/VoyagerBreadController.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public function create(Request $request, $table)
5353
$dataType = Voyager::model('DataType')->whereName($table)->first();
5454

5555
$data = $this->prepopulateBreadInfo($table);
56-
$data['fieldOptions'] = SchemaManager::describeTable((isset($dataType) && strlen($dataType->model_name) != 0)
56+
$data['fieldOptions'] = SchemaManager::describeTable(
57+
(isset($dataType) && strlen($dataType->model_name) != 0)
5758
? DB::getTablePrefix().app($dataType->model_name)->getTable()
5859
: DB::getTablePrefix().$table
5960
);
@@ -121,7 +122,8 @@ public function edit($table)
121122

122123
$dataType = Voyager::model('DataType')->whereName($table)->first();
123124

124-
$fieldOptions = SchemaManager::describeTable((strlen($dataType->model_name) != 0)
125+
$fieldOptions = SchemaManager::describeTable(
126+
(strlen($dataType->model_name) != 0)
125127
? DB::getTablePrefix().app($dataType->model_name)->getTable()
126128
: DB::getTablePrefix().$dataType->name
127129
);

src/Http/Controllers/VoyagerCompassController.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use Exception;
77
use Illuminate\Http\Request;
88
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
9-
use Symfony\Component\Process\Exception\ProcessFailedException;
10-
use Symfony\Component\Process\Process;
119

1210
class VoyagerCompassController extends Controller
1311
{
@@ -71,7 +69,7 @@ public function index(Request $request)
7169
$args = (isset($args)) ? ' '.$args : '';
7270

7371
try {
74-
Artisan::call($command . $args);
72+
Artisan::call($command.$args);
7573
$artisan_output = Artisan::output();
7674
} catch (Exception $e) {
7775
$artisan_output = $e->getMessage();

src/Http/Controllers/VoyagerMediaController.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ public function upload(Request $request)
274274
($thumbnail_data->height ?? null),
275275
function ($constraint) {
276276
$constraint->aspectRatio();
277-
}, ($thumbnail_data->position ?? 'center')
277+
},
278+
($thumbnail_data->position ?? 'center')
278279
);
279280
} elseif ($type == 'crop') {
280281
$thumbnail = $thumbnail->crop(

src/Models/DataType.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ public function updateDataType($requestData, $throw = false)
9595
}
9696

9797
if ($this->fill($requestData)->save()) {
98-
$fields = $this->fields((strlen($this->model_name) != 0)
98+
$fields = $this->fields(
99+
(strlen($this->model_name) != 0)
99100
? DB::getTablePrefix().app($this->model_name)->getTable()
100101
: DB::getTablePrefix().Arr::get($requestData, 'name')
101102
);
@@ -213,7 +214,8 @@ public function fieldOptions()
213214
// Get ordered BREAD fields
214215
$orderedFields = $this->rows()->pluck('field')->toArray();
215216

216-
$_fieldOptions = SchemaManager::describeTable((strlen($this->model_name) != 0)
217+
$_fieldOptions = SchemaManager::describeTable(
218+
(strlen($this->model_name) != 0)
217219
? app($this->model_name)->getTable()
218220
: $this->name
219221
)->toArray();

src/Providers/VoyagerDummyServiceProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ private function registerPublishableResources()
5252
public function registerConfigs()
5353
{
5454
$this->mergeConfigFrom(
55-
dirname(__DIR__).'/../publishable/config/voyager_dummy.php', 'voyager'
55+
dirname(__DIR__).'/../publishable/config/voyager_dummy.php',
56+
'voyager'
5657
);
5758
}
5859
}

src/Traits/Translatable.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ public static function scopeWhereTranslation($query, $field, $operator, $value =
278278
$self = new static();
279279
$table = $self->getTable();
280280

281-
return $query->whereIn($self->getKeyName(), Translation::where('table_name', $table)
281+
return $query->whereIn(
282+
$self->getKeyName(),
283+
Translation::where('table_name', $table)
282284
->where('column_name', $field)
283285
->where('value', $operator, $value)
284286
->when(!is_null($locales), function ($query) use ($locales) {

src/VoyagerServiceProvider.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ private function registerPublishableResources()
265265
public function registerConfigs()
266266
{
267267
$this->mergeConfigFrom(
268-
dirname(__DIR__).'/publishable/config/voyager.php', 'voyager'
268+
dirname(__DIR__).'/publishable/config/voyager.php',
269+
'voyager'
269270
);
270271
}
271272

tests/CompassTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testCanExecuteCommand()
5555

5656
$response = $this->post(route('voyager.compass.index'), [
5757
'command' => 'make:model',
58-
'args' => 'TestModel'
58+
'args' => 'TestModel',
5959
]);
6060
$this->assertStringContainsString('Model created successfully.', $response->response->content());
6161
}
@@ -66,7 +66,7 @@ public function testCannotExecuteUnknownCommand()
6666

6767
$response = $this->post(route('voyager.compass.index'), [
6868
'command' => 'unknown:command',
69-
'args' => 'AnArgument'
69+
'args' => 'AnArgument',
7070
]);
7171
$this->assertStringContainsString('The command "unknown:command" does not exist.', $response->response->content());
7272
}

tests/DisabledTestException.php

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace TCG\Voyager\Tests;
44

5-
use Exception;
65
use Illuminate\Foundation\Exceptions\Handler;
76

87
class DisabledTestException extends Handler

0 commit comments

Comments
 (0)