Skip to content

Commit 2bc90fe

Browse files
Sairahcazgithub-actions[bot]
authored andcommitted
Fix styling
1 parent df39de8 commit 2bc90fe

File tree

5 files changed

+9
-27
lines changed

5 files changed

+9
-27
lines changed

config/useful-traits.php

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

33
return [
4-
"refresh_db_fast" => [
4+
'refresh_db_fast' => [
55
/**
66
* This field determines if the database should be seeded after migration.
77
*/
8-
"seed" => env('USEFUL_TRAITS_SEED_AFTER_FAST_DB_REFRESH', false),
8+
'seed' => env('USEFUL_TRAITS_SEED_AFTER_FAST_DB_REFRESH', false),
99
],
1010
];

src/LaravelUsefulTraitsServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public function configurePackage(Package $package): void
1616
*/
1717
$package
1818
->name('laravel-useful-traits')
19-
->hasConfigFile()
20-
;
19+
->hasConfigFile();
2120
}
2221
}

src/RefreshDatabaseFast.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/**
1111
* Only migrate fresh if necessary -> much faster after first time!
1212
* Credits to mayahi, with some small changes of mine.
13+
*
1314
* @link https://mayahi.net/laravel/make-refresh-database-trait-much-faster/
1415
*/
1516
trait RefreshDatabaseFast
@@ -18,8 +19,6 @@ trait RefreshDatabaseFast
1819

1920
/**
2021
* Only migrates fresh if necessary
21-
*
22-
* @return void
2322
*/
2423
protected function refreshTestDatabase(): void
2524
{
@@ -37,12 +36,10 @@ protected function refreshTestDatabase(): void
3736
/**
3837
* Check if migration fresh is necessary by checking
3938
* if the migrations files checksum has changed.
40-
*
41-
* @return void
4239
*/
4340
protected function runMigrationsIfNecessary(): void
4441
{
45-
if (!$this->identicalChecksum()) {
42+
if (! $this->identicalChecksum()) {
4643
if (config('useful-traits.refresh_db_fast.seed')) {
4744
$this->seed();
4845
}
@@ -56,8 +53,6 @@ protected function runMigrationsIfNecessary(): void
5653

5754
/**
5855
* Calaculates the checksum of the migration files.
59-
*
60-
* @return string
6156
*/
6257
private function calculateChecksum(): string
6358
{
@@ -74,15 +69,15 @@ private function calculateChecksum(): string
7469

7570
$files = array_keys(iterator_to_array($files));
7671

77-
$checksum = collect($files)->map(function($file) {return md5_file($file);})->implode('');
72+
$checksum = collect($files)->map(function ($file) {
73+
return md5_file($file);
74+
})->implode('');
7875

7976
return md5($checksum);
8077
}
8178

8279
/**
8380
* Filepath to store the checksum.
84-
*
85-
* @return string
8681
*/
8782
private function checksumFilePath(): string
8883
{
@@ -91,8 +86,6 @@ private function checksumFilePath(): string
9186

9287
/**
9388
* Creates the checksum file.
94-
*
95-
* @return void
9689
*/
9790
private function createChecksum(): void
9891
{
@@ -111,8 +104,6 @@ private function checksumFileContents()
111104

112105
/**
113106
* Check if checksum exists.
114-
*
115-
* @return bool
116107
*/
117108
private function isChecksumExists(): bool
118109
{
@@ -122,12 +113,10 @@ private function isChecksumExists(): bool
122113
/**
123114
* Check if checksum of current database migration files
124115
* are identical to the one we stored already.
125-
*
126-
* @return bool
127116
*/
128117
private function identicalChecksum(): bool
129118
{
130-
if (!$this->isChecksumExists()) {
119+
if (! $this->isChecksumExists()) {
131120
return false;
132121
}
133122

src/UsefulScopes.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ trait UsefulScopes
1010
{
1111
/**
1212
* Scope a query to only exclude specific Columns.
13-
*
14-
* @param Builder $query
15-
* @param $excludeColumns
16-
* @return Builder
1713
*/
1814
public function scopeSelectAllBut(Builder $query, array $excludeColumns): Builder
1915
{
@@ -35,7 +31,6 @@ public function scopeSelectAllBut(Builder $query, array $excludeColumns): Builde
3531
* modifying the contents of files inside the migrations directory will not re-cache the columns
3632
* Whenever you make a new deployment/migration you can clear the cache.
3733
*
38-
* @return array
3934
**/
4035
public function getTableColumns(): array
4136
{

tests/Pest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
use Illuminate\Foundation\Testing\RefreshDatabase;
43
use LaracraftTech\LaravelUsefulTraits\RefreshDatabaseFast;
54
use LaracraftTech\LaravelUsefulTraits\Tests\TestCase;
65

0 commit comments

Comments
 (0)