Skip to content

Commit

Permalink
Code style (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev authored Sep 13, 2023
1 parent e077fda commit 4836069
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/Stubs/Models/UserWithCustomOptimusConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public function nestedUsers(): HasMany

public function parentUser(): BelongsTo
{
return$this->belongsTo(UserWithCustomOptimusConnection::class, 'parent_id');
return $this->belongsTo(UserWithCustomOptimusConnection::class, 'parent_id');
}
}
2 changes: 1 addition & 1 deletion tests/Stubs/Models/UserWithDefaultOptimusConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function nestedUsers(): HasMany

public function parentUser(): BelongsTo
{
return$this->belongsTo(UserWithDefaultOptimusConnection::class, 'parent_id');
return $this->belongsTo(UserWithDefaultOptimusConnection::class, 'parent_id');
}
}
6 changes: 3 additions & 3 deletions tests/Traits/OptimusEncodedRouteKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function setUp(): void
parent::setUp();

$this->loadLaravelMigrations(config('database.default'));
$this->loadMigrationsFrom(__DIR__.'/../Stubs/Migrations');
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
$this->configurePrimeNumbers();
}

Expand Down Expand Up @@ -185,13 +185,13 @@ public function testExistingIntegerValuesBelow256AreResolved()
*
* @return \Cog\Tests\Laravel\Optimus\Stubs\Models\UserWithDefaultOptimusConnection
*/
protected function createUserWithDefaultOptimusConnection(array $data = []): UserWithDefaultOptimusConnection
protected function createUserWithDefaultOptimusConnection(array $attributes = []): UserWithDefaultOptimusConnection
{
return UserWithDefaultOptimusConnection::create(array_merge([
'name' => 'Default Test User',
'email' => '[email protected]',
'password' => 'p4ssw0rd',
], $data));
], $attributes));
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddParentIdToUsersTable extends Migration
return new class extends Migration
{
public function up()
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->foreignId('parent_id')
->nullable();
$table->foreignId('parent_id')->nullable();
});
}

public function down()
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['parent_id']);
});
}
}
};

0 comments on commit 4836069

Please sign in to comment.