Skip to content

Commit

Permalink
Applied fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored and StyleCIBot committed Nov 6, 2016
1 parent 7f51b5b commit c9680a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ function once($callback)

$backtrace = new Backtrace($trace);

if (!$backtrace->hasObject()) {
if (! $backtrace->hasObject()) {
throw new Exception('Cannot use `once` outside a class');
}

$object = $backtrace->getObject();

$hash = $backtrace->getArgumentHash();

if (!isset($object->__memoized[$backtrace->getFunctionName()][$hash])) {
if (! isset($object->__memoized[$backtrace->getFunctionName()][$hash])) {
$result = call_user_func($callback, $backtrace->getArguments());

$object->__memoized[$backtrace->getFunctionName()][$hash] = $result;
Expand Down

0 comments on commit c9680a5

Please sign in to comment.