Skip to content

Commit 3cf842f

Browse files
author
farhadzand
committed
fix styles
1 parent 73e9cf6 commit 3cf842f

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

src/Drivers/MySQLDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private function getTableName(string $entityType): string
174174
// Handle pluralization
175175
$tableName = Str::plural($className);
176176

177-
return $this->tablePrefix . $tableName . $this->tableSuffix;
177+
return $this->tablePrefix.$tableName.$this->tableSuffix;
178178
}
179179

180180
private function applyFilters(Builder $query, array $options): void

tests/Feature/AuditLogAdvancedTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44

55
namespace iamfarhad\LaravelAuditLog\Tests\Feature;
66

7-
use Illuminate\Support\Facades\Config;
7+
use Illuminate\Support\Str;
88
use Illuminate\Support\Facades\DB;
9+
use Illuminate\Support\Facades\Config;
910
use Illuminate\Support\Facades\Schema;
10-
use Illuminate\Support\Str;
11+
use iamfarhad\LaravelAuditLog\Tests\TestCase;
1112
use iamfarhad\LaravelAuditLog\Tests\Mocks\Post;
1213
use iamfarhad\LaravelAuditLog\Tests\Mocks\User;
13-
use iamfarhad\LaravelAuditLog\Tests\TestCase;
1414

1515
final class AuditLogAdvancedTest extends TestCase
1616
{
1717
/**
1818
* Get the latest audit log for the given model
19-
*
20-
* @param string $modelClass Class name of the model
19+
*
20+
* @param string $modelClass Class name of the model
2121
* @return object|null The audit log record
2222
*/
2323
protected function getLatestAuditLog(string $modelClass): ?object
2424
{
2525
// Convert class name to table name (e.g., User -> audit_users_logs)
2626
$className = class_basename($modelClass);
27-
$tableName = 'audit_' . Str::snake(Str::plural($className)) . '_logs';
27+
$tableName = 'audit_'.Str::snake(Str::plural($className)).'_logs';
2828

2929
return DB::table($tableName)
3030
->latest('id')
@@ -129,7 +129,7 @@ public function test_excluded_fields_from_different_sources(): void
129129
// Create a user with all fields including test_field
130130
Schema::table('users', function ($table) {
131131
// Only add the column if it doesn't already exist
132-
if (!Schema::hasColumn('users', 'test_field')) {
132+
if (! Schema::hasColumn('users', 'test_field')) {
133133
$table->string('test_field')->nullable();
134134
}
135135
});

tests/Feature/AuditLogFeatureTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44

55
namespace iamfarhad\LaravelAuditLog\Tests\Feature;
66

7-
use Illuminate\Support\Carbon;
8-
use Illuminate\Support\Facades\DB;
97
use Illuminate\Support\Str;
8+
use Illuminate\Support\Facades\DB;
9+
use iamfarhad\LaravelAuditLog\Tests\TestCase;
1010
use iamfarhad\LaravelAuditLog\Tests\Mocks\Post;
1111
use iamfarhad\LaravelAuditLog\Tests\Mocks\User;
12-
use iamfarhad\LaravelAuditLog\Tests\TestCase;
1312

1413
final class AuditLogFeatureTest extends TestCase
1514
{
1615
/**
1716
* Get the latest audit log for the given model
18-
*
19-
* @param string $modelClass Class name of the model
17+
*
18+
* @param string $modelClass Class name of the model
2019
* @return object|null The audit log record
2120
*/
2221
protected function getLatestAuditLog(string $modelClass): ?object
2322
{
2423
// Convert class name to table name (e.g., User -> audit_users_logs)
2524
$className = class_basename($modelClass);
26-
$tableName = 'audit_' . Str::snake(Str::plural($className)) . '_logs';
25+
$tableName = 'audit_'.Str::snake(Str::plural($className)).'_logs';
2726

2827
return DB::table($tableName)
2928
->latest('id')

tests/Mocks/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace iamfarhad\LaravelAuditLog\Tests\Mocks;
66

77
use Illuminate\Database\Eloquent\Model;
8-
use Illuminate\Database\Eloquent\Relations\BelongsTo;
98
use iamfarhad\LaravelAuditLog\Traits\Auditable;
9+
use Illuminate\Database\Eloquent\Relations\BelongsTo;
1010

1111
final class Post extends Model
1212
{
@@ -26,7 +26,7 @@ final class Post extends Model
2626
protected array $auditInclude = [
2727
'title',
2828
'status',
29-
'published_at'
29+
'published_at',
3030
];
3131

3232
// Property to control auditing

tests/Mocks/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class User extends Model
2424
// Define fields to exclude from audit logs
2525
protected array $auditExclude = [
2626
'password',
27-
'remember_token'
27+
'remember_token',
2828
];
2929

3030
// Property to control auditing

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace iamfarhad\LaravelAuditLog\Tests;
66

7-
use Illuminate\Database\Schema\Blueprint;
87
use Illuminate\Support\Facades\Schema;
8+
use Illuminate\Database\Schema\Blueprint;
99
use Orchestra\Testbench\TestCase as Orchestra;
1010
use iamfarhad\LaravelAuditLog\AuditLoggerServiceProvider;
1111

@@ -80,7 +80,7 @@ protected function setUpDatabase(): void
8080
// Create model-specific audit tables
8181
$auditTables = [
8282
'audit_users_logs',
83-
'audit_posts_logs'
83+
'audit_posts_logs',
8484
];
8585

8686
foreach ($auditTables as $tableName) {

0 commit comments

Comments
 (0)