Skip to content

Commit

Permalink
Merge pull request #1 from spatie/analysis-8bOdb5
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
freekmurze authored Nov 6, 2016
2 parents 7f51b5b + c9680a5 commit a609d31
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 a609d31

Please sign in to comment.