Skip to content

Commit

Permalink
Laravel - fixed compatibility with PHP 5.3. (Fixes #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsgoingd committed Jan 13, 2014
1 parent 5211ac7 commit ce389e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Clockwork/Clockwork.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Clockwork implements LoggerInterface
/**
* Clockwork version
*/
const VERSION = '1.4';
const VERSION = '1.4.1';

/**
* Array of data sources, these objects provide data to be stored in a request object
Expand Down
4 changes: 2 additions & 2 deletions Clockwork/DataSource/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function resolve(Request $request)
/**
* Replaces unserializable items such as closures, resources and objects in an array with textual representation
*/
protected function replaceUnserializable(array $data)
public function replaceUnserializable(array $data)
{
foreach ($data as &$item) {
if ($item instanceof Closure)
Expand All @@ -36,7 +36,7 @@ protected function replaceUnserializable(array $data)
/**
* Censors passwords in an array, identified by key containing "pass" substring
*/
protected function removePasswords(array $data)
public function removePasswords(array $data)
{
foreach ($data as $key => &$val)
if (strpos($key, 'pass') !== false)
Expand Down
5 changes: 3 additions & 2 deletions Clockwork/DataSource/LaravelDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ public function listenToEvents()
});

$views = $this->views;
$that = $this;

$this->app['events']->listen('composing:*', function($view) use($views)
$this->app['events']->listen('composing:*', function($view) use($views, $that)
{
$time = microtime(true);

Expand All @@ -145,7 +146,7 @@ public function listenToEvents()
$time,
array(
'name' => $view->getName(),
'data' => $this->replaceUnserializable($view->getData())
'data' => $that->replaceUnserializable($view->getData())
)
);
});
Expand Down

0 comments on commit ce389e8

Please sign in to comment.