Skip to content

Commit f4afab6

Browse files
author
Chris Cho
committed
PHP code style updates
1 parent 9719367 commit f4afab6

File tree

7 files changed

+35
-30
lines changed

7 files changed

+35
-30
lines changed

docs/eloquent-models/schema-builder.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ the migration and drops them when you roll back the migration:
7777
.. literalinclude:: /includes/schema-builder/astronauts_migration.php
7878
:dedent:
7979
:language: php
80-
:emphasize-lines: 4, 10
80+
:emphasize-lines: 6, 11
8181

8282
Run or Roll Back a Migration
8383
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/includes/schema-builder/astronauts_migration.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
4-
use MongoDB\Laravel\Schema\Blueprint;
56
use Illuminate\Support\Facades\Schema;
6-
7+
use MongoDB\Laravel\Schema\Blueprint;
8+
79
return new class extends Migration
810
{
9-
1011
protected $connect = 'mongodb';
1112

1213
/**
1314
* Run the migrations.
1415
*/
1516
public function up(): void
1617
{
17-
Schema::create('astronauts', function (Blueprint $collection) {
18-
$collection->index('name');
19-
});
18+
Schema::create('astronauts', function (Blueprint $collection) {
19+
$collection->index('name');
20+
});
2021
}
2122

2223
/**

docs/includes/schema-builder/flights_migration.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
4-
use MongoDB\Laravel\Schema\Blueprint;
56
use Illuminate\Support\Facades\Schema;
7+
use MongoDB\Laravel\Schema\Blueprint;
68

79
return new class extends Migration
810
{
9-
1011
protected $connect = 'mongodb';
1112

1213
public function up(): void
1314
{
1415
// begin create index
15-
Schema::create('flights', function (Blueprint $collection) {
16-
$collection->index('mission_type');
17-
$collection->index(['launch_location' => 1, 'launch_date' => -1]);
18-
$collection->unique('mission_id', null, null, [ 'name' => 'unique_mission_id_idx']);
19-
});
16+
Schema::create('flights', function (Blueprint $collection) {
17+
$collection->index('mission_type');
18+
$collection->index(['launch_location' => 1, 'launch_date' => -1]);
19+
$collection->unique('mission_id', null, null, ['name' => 'unique_mission_id_idx']);
20+
});
2021
// end create index
2122
}
2223

docs/includes/schema-builder/passengers_migration.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
4-
use MongoDB\Laravel\Schema\Blueprint;
56
use Illuminate\Support\Facades\Schema;
6-
7+
use MongoDB\Laravel\Schema\Blueprint;
8+
79
return new class extends Migration
810
{
9-
1011
protected $connect = 'mongodb';
1112

1213
public function up(): void
1314
{
1415
// begin index options
15-
Schema::create('passengers', function(Blueprint $collection) {
16+
Schema::create('passengers', function (Blueprint $collection) {
1617
$collection->index('last_name', 'passengers_collation_idx', null, [
17-
'collation' => [ 'locale' => 'de@collation=phonebook', 'numericOrdering' => true ]]);
18+
'collation' => [ 'locale' => 'de@collation=phonebook', 'numericOrdering' => true ],
19+
]);
1820
});
1921
// end index options
2022
}

docs/includes/schema-builder/planets_migration.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
4-
use MongoDB\Laravel\Schema\Blueprint;
56
use Illuminate\Support\Facades\Schema;
6-
7+
use MongoDB\Laravel\Schema\Blueprint;
8+
79
return new class extends Migration
810
{
9-
1011
protected $connect = 'mongodb';
1112

1213
public function up(): void
@@ -20,7 +21,7 @@ public function up(): void
2021

2122
// begin multi index helpers
2223
Schema::create('planet_systems', function (Blueprint $collection) {
23-
$collection->index('last_visible_dt', null, null, [ 'sparse' => true, 'expireAfterSeconds' => 3600, 'unique' => true]);
24+
$collection->index('last_visible_dt', null, null, ['sparse' => true, 'expireAfterSeconds' => 3600, 'unique' => true]);
2425
});
2526
// end multi index helpers
2627
}

docs/includes/schema-builder/spaceports_migration.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
4-
use MongoDB\Laravel\Schema\Blueprint;
56
use Illuminate\Support\Facades\Schema;
6-
7+
use MongoDB\Laravel\Schema\Blueprint;
8+
79
return new class extends Migration
810
{
9-
1011
protected $connect = 'mongodb';
1112

1213
/**

docs/includes/schema-builder/stars_migration.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Illuminate\Database\Migrations\Migration;
4-
use MongoDB\Laravel\Schema\Blueprint;
56
use Illuminate\Support\Facades\Schema;
67

78
return new class extends Migration
89
{
9-
1010
protected $connect = 'mongodb';
1111

1212
public function up(): void
@@ -18,8 +18,7 @@ public function up(): void
1818
Schema::create('telescopes');
1919
}
2020
// end conditional create
21-
}
22-
21+
}
2322

2423
public function down(): void
2524
{

0 commit comments

Comments
 (0)