Skip to content

Commit 36bf314

Browse files
Merge pull request #71 from owen-it/analysis-XkYZOa
Applied fixes from StyleCI
2 parents 54062a9 + 92e699e commit 36bf314

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/AuditingTrait.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static function classLogHistory($limit = 100, $order = 'desc')
9494
}
9595

9696
/**
97-
* Generates a list of the last $limit logs
97+
* Generates a list of the last $limit logs.
9898
*
9999
* @param int $limit
100100
* @param string $order
@@ -232,22 +232,24 @@ public function audit(array $log, $type)
232232
];
233233

234234
// Insert the log and clear the oldest logs if given a limit.
235-
if($this->saveAudit($logAuditing)) $this->clearOlderLogs();
235+
if ($this->saveAudit($logAuditing)) {
236+
$this->clearOlderLogs();
237+
}
236238
}
237239

238240
/**
239241
* Clear the oldest logs if given a limit.
240242
*
241243
* @return void
242244
*/
243-
private function clearOlderLogs(){
244-
245+
private function clearOlderLogs()
246+
{
245247
$logHistoryCount = $this->logHistory()->count();
246248
$logHistoryOlder = $logHistoryCount - $this->historyLimit;
247249

248250
if (isset($this->historyLimit) && $logHistoryOlder > 0) {
249251
$logs = $this->logHistory($logHistoryOlder, 'asc');
250-
$logs->each(function($log){
252+
$logs->each(function ($log) {
251253
$log->delete();
252254
});
253255
}

0 commit comments

Comments
 (0)