From e87ae3514e157ec52de2076b677863acce7f2872 Mon Sep 17 00:00:00 2001 From: freek Date: Fri, 24 Jun 2016 00:54:41 +0200 Subject: [PATCH] psr2 --- src/CleanActivitylogCommand.php | 2 +- src/Exceptions/CouldNotLogActivity.php | 2 +- src/Models/Activity.php | 3 ++- src/Traits/LogsActivity.php | 2 +- src/helpers.php | 7 +++---- tests/ActivityloggerTest.php | 2 +- tests/Models/Article.php | 2 +- tests/Models/User.php | 2 +- tests/TestCase.php | 10 ++++------ 9 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/CleanActivitylogCommand.php b/src/CleanActivitylogCommand.php index 951352a6..cf13dd85 100644 --- a/src/CleanActivitylogCommand.php +++ b/src/CleanActivitylogCommand.php @@ -14,7 +14,7 @@ class CleanActivitylogCommand extends Command * @var string */ protected $signature = 'activitylog:clean'; - + /** * The console command description. * diff --git a/src/Exceptions/CouldNotLogActivity.php b/src/Exceptions/CouldNotLogActivity.php index b1272918..b227d598 100644 --- a/src/Exceptions/CouldNotLogActivity.php +++ b/src/Exceptions/CouldNotLogActivity.php @@ -10,4 +10,4 @@ public static function couldNotDetermineUser($id) { return new static("Could not determine a user with identifier `{$id}`."); } -} \ No newline at end of file +} diff --git a/src/Models/Activity.php b/src/Models/Activity.php index 0a3b2afb..78cb7024 100644 --- a/src/Models/Activity.php +++ b/src/Models/Activity.php @@ -22,11 +22,12 @@ public function causer(): MorphTo { return $this->morphTo(); } - + /** * Get the extra properties with the given name. * * @param $propertyName + * * @return mixed */ public function getExtraProperty(string $propertyName) diff --git a/src/Traits/LogsActivity.php b/src/Traits/LogsActivity.php index 9cd74d19..22cf2b10 100644 --- a/src/Traits/LogsActivity.php +++ b/src/Traits/LogsActivity.php @@ -19,7 +19,7 @@ protected static function bootLogsActivity() if ($description == '') { return; } - + $extraProperties = []; if ($eventName != 'deleted') { $extraProperties['changes'] = $model->getChanges(); diff --git a/src/helpers.php b/src/helpers.php index 39e21af3..9619624f 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -2,10 +2,9 @@ use Spatie\Activitylog\ActivityLogger; -if (! function_exists('activity')) { - - function activity(): ActivityLogger { +if (!function_exists('activity')) { + function activity(): ActivityLogger + { return app(ActivityLogger::class); } - } diff --git a/tests/ActivityloggerTest.php b/tests/ActivityloggerTest.php index e0ca47ef..775fc30e 100644 --- a/tests/ActivityloggerTest.php +++ b/tests/ActivityloggerTest.php @@ -15,4 +15,4 @@ public function it_can_log_an_activity() $this->assertEquals($activityDescription, Activity::first()->description); } -} \ No newline at end of file +} diff --git a/tests/Models/Article.php b/tests/Models/Article.php index 554ac6df..f3815bc7 100644 --- a/tests/Models/Article.php +++ b/tests/Models/Article.php @@ -7,4 +7,4 @@ class Article extends Model { protected $guarded = []; -} \ No newline at end of file +} diff --git a/tests/Models/User.php b/tests/Models/User.php index e0c27802..6859506a 100644 --- a/tests/Models/User.php +++ b/tests/Models/User.php @@ -10,4 +10,4 @@ class User extends Model use CausesActivity; protected $guarded = []; -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index 202f731e..a35d87f0 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -20,7 +20,7 @@ public function setUp() protected function getPackageProviders($app) { return [ - ActivitylogServiceProvider::class + ActivitylogServiceProvider::class, ]; } @@ -30,7 +30,7 @@ public function getEnvironmentSetUp($app) $app['config']->set('database.connections.sqlite', [ 'driver' => 'sqlite', - 'database' => $this->getTempDirectory() . '/database.sqlite', + 'database' => $this->getTempDirectory().'/database.sqlite', 'prefix' => '', ]); $app['config']->set('app.key', '6rE9Nz59bGRbeMATftriyQjrpF7DcOQm'); @@ -48,7 +48,7 @@ protected function setUpDatabase() protected function resetDatabase() { - file_put_contents($this->getTempDirectory() . '/database.sqlite', null); + file_put_contents($this->getTempDirectory().'/database.sqlite', null); } protected function createActivityLogTable() @@ -60,7 +60,7 @@ protected function createActivityLogTable() public function getTempDirectory(): string { - return __DIR__ . '/temp'; + return __DIR__.'/temp'; } protected function createTables(...$tableNames) @@ -82,6 +82,4 @@ protected function seedModels(...$modelClasses) } }); } - - }