Skip to content

Commit

Permalink
fixes syntax to fit php7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
denismitr committed Aug 9, 2018
1 parent bb51022 commit 3dc9f63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/JsonAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@ public static function scopeWithJsonAttributes(string $attributeName): Builder
$arguments = debug_backtrace()[1]['args'];

if (count($arguments) === 1) {
[$builder] = $arguments;
list($builder) = $arguments;
$jsonAttributes = [];
}

if (count($arguments) === 2) {
[$builder, $jsonAttributes] = $arguments;
list($builder, $jsonAttributes) = $arguments;
}

if (count($arguments) >= 3) {
[$builder, $name, $value] = $arguments;
list($builder, $name, $value) = $arguments;
$jsonAttributes = [$name => $value];
}

Expand Down

0 comments on commit 3dc9f63

Please sign in to comment.