Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mai.tan committed Apr 18, 2019
1 parent 2c13bcb commit 8a7c449
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Defer.php
Expand Up @@ -81,8 +81,11 @@ public function fromHtml($html, $charset = null)
return $this;
}

// Check if gc_enable is true
$gc_enabled = @gc_enabled();

// Turn on gc_enable
if (!($gc_enabled = @gc_enabled())) {
if (!$gc_enabled) {
@gc_enable();
}

Expand Down
5 changes: 3 additions & 2 deletions src/DeferCache.php
Expand Up @@ -130,9 +130,10 @@ public static function fast_file_exists($path)

public static function readdir($path, $type = null)
{
$list = [];
$list = [];
$handle = @opendir($path);

if ($handle = @opendir($path)) {
if ($handle) {
while (false !== ($item = readdir($handle))) {
if ($item != '.' && $item !== '..') {
$list[] = $path . static::DS . $item;
Expand Down

0 comments on commit 8a7c449

Please sign in to comment.