Skip to content

Commit

Permalink
Merge pull request #39 from owen-it/analysis-zEAepZ
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
anteriovieira committed Mar 30, 2016
2 parents 8ca40e4 + f0c9a90 commit d4ebbfa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function restore()
{
if (class_exists($class = $this->owner_type)) {
$model = $this->$class->findOrFail($this->owner_id);

$model->fill($this->old_value);

return $model->save();
Expand Down Expand Up @@ -118,7 +118,7 @@ public function getCustomFieldsAttribute()
{
if (class_exists($class = $this->owner_type)) {
$customFields = [];

foreach ($this->getCustomFields($class) as $field => $message) {
if (is_array($message) && isset($message[$this->type])) {
$customFields[$field] = $this->resolveCustomMessage($message[$this->type]);
Expand Down Expand Up @@ -173,19 +173,19 @@ public function resolveCustomMessage($message)
preg_match_all('/\{[\w.| ]+\}/', $message, $segments);
foreach (current($segments) as $segment) {
$s = str_replace(['{', '}'], '', $segment);

$keys = explode('|', $s);

if (empty($keys[1]) && isset($keys[2])) {
$keys[1] = $this->callback($keys[2]);
}

$valueSegmented = $this->getValueSegmented($this, $keys[0], isset($keys[1]) ? $keys[1] : ' ');

if (!$valueSegmented) {
return false;
}

$message = str_replace($segment, $valueSegmented, $message);
}

Expand Down

0 comments on commit d4ebbfa

Please sign in to comment.