Skip to content

Commit 06796d7

Browse files
committed
pint
1 parent ae03278 commit 06796d7

File tree

14 files changed

+22
-20
lines changed

14 files changed

+22
-20
lines changed

database/migrations/2024_11_04_000014_create_tasks_table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*

src/Console/Commands/GenerateErd.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private function runMigrate(?string $database): int
7272
'--path' => $this->option('path'),
7373
]);
7474

75-
$output = new BufferedOutput();
75+
$output = new BufferedOutput;
7676
if ($this->runCommand('migrate', $arguments, $output) === self::FAILURE) {
7777
$this->error($output->fetch());
7878

src/Console/Commands/InstallBinary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function download(string $url, string $path): void
8989
File::ensureDirectoryExists(dirname($path));
9090

9191
$request = new Request('GET', $url);
92-
$plugins = [new ErrorPlugin(), new RedirectPlugin()];
92+
$plugins = [new ErrorPlugin, new RedirectPlugin];
9393
$response = (new PluginClient($this->client, $plugins))->sendRequest($request);
9494

9595
File::put($path, (string) $response->getBody());

src/ErdFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private function findByModels(Collection $models, array $excludes = []): Collect
9292
});
9393

9494
return $models
95-
->map(fn (string $model) => new $model())
95+
->map(fn (string $model) => new $model)
9696
->map(fn (Model $model) => [
9797
'connection' => $model->getConnectionName(),
9898
'table' => $model->getTable(),

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function create(?string $name = null): ErdFinder
2828
return $this->cache[$key] = new ErdFinder(
2929
$this->getSchemaBuilder($name),
3030
new ModelFinder($name),
31-
new RelationFinder()
31+
new RelationFinder
3232
);
3333
}
3434

src/ModelFinder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ModelFinder
2626
public function __construct(?string $connection = null)
2727
{
2828
$this->connection = $connection;
29-
$parserFactory = new ParserFactory();
29+
$parserFactory = new ParserFactory;
3030
$this->parser = $parserFactory->createForNewestSupportedVersion();
3131
}
3232

@@ -40,7 +40,7 @@ public function find(string $directory, $regex = '*.php'): Collection
4040
return collect($files)
4141
->map(fn (SplFileInfo $file) => $this->getFullyQualifiedClassName($file))
4242
->filter(fn (?string $className) => $className && self::isEloquentModel($className))
43-
->filter(fn (string $className) => (new $className())->getConnectionName() === $this->connection)
43+
->filter(fn (string $className) => (new $className)->getConnectionName() === $this->connection)
4444
->values();
4545
}
4646

@@ -57,8 +57,8 @@ private static function isEloquentModel(string $className): bool
5757

5858
private function getFullyQualifiedClassName(SplFileInfo $file): ?string
5959
{
60-
$nodeTraverser = new NodeTraverser();
61-
$nodeTraverser->addVisitor(new NameResolver());
60+
$nodeTraverser = new NodeTraverser;
61+
$nodeTraverser->addVisitor(new NameResolver);
6262
$nodes = $nodeTraverser->traverse($this->parser->parse($file->getContents()));
6363

6464
/** @var ?Namespace_ $rootNode */

src/Pivot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function connection(): ?string
6666
{
6767
$model = $this->related();
6868

69-
return (new $model())->getConnectionName();
69+
return (new $model)->getConnectionName();
7070
}
7171

7272
/**

src/Relation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Relation
1616
\Awobaz\Compoships\Database\Eloquent\Relations\HasOne::class => HasOne::class,
1717
\Awobaz\Compoships\Database\Eloquent\Relations\HasMany::class => HasMany::class,
1818
];
19+
1920
private array $attributes;
2021

2122
public function __construct(array $attributes)
@@ -91,7 +92,7 @@ public function connection(): ?string
9192
{
9293
$model = $this->related();
9394

94-
return (new $model())->getConnectionName();
95+
return (new $model)->getConnectionName();
9596
}
9697

9798
public function pivot(): ?Pivot

src/Template/Er.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Er implements Template
3636

3737
public function __construct()
3838
{
39-
$this->finder = new ExecutableFinder();
39+
$this->finder = new ExecutableFinder;
4040
}
4141

4242
public function render(Collection $tables): string
@@ -82,9 +82,9 @@ private function renderTable(Table $table): string
8282
->unique();
8383

8484
return $table->getColumns()
85-
->map(fn (ColumnSchema $column) => $this->renderColumn($column, $primaryKeys, $indexes))
86-
->prepend(sprintf('[%s] {}', $table->getName()))
87-
->implode("\n")."\n";
85+
->map(fn (ColumnSchema $column) => $this->renderColumn($column, $primaryKeys, $indexes))
86+
->prepend(sprintf('[%s] {}', $table->getName()))
87+
->implode("\n")."\n";
8888
}
8989

9090
private function renderColumn(ColumnSchema $column, Collection $primaryKeys, Collection $indexes): string

tests/Console/Commands/InstallBinaryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private function givenOs(string $platform, string $arch): void
9797

9898
private function givenClient(): Client
9999
{
100-
$client = new Client();
100+
$client = new Client;
101101
$client->addResponse(new Response(200, [], 'ok'));
102102
$this->app->addContextualBinding(InstallBinary::class, ClientInterface::class, fn () => $client);
103103

0 commit comments

Comments
 (0)