Skip to content

Commit

Permalink
Merge pull request #6 from markguinn/patch-1
Browse files Browse the repository at this point in the history
Fixes a glitch where sometimes the other manifests are generated but the traits are not
  • Loading branch information
stevie-mayhew committed Mar 15, 2016
2 parents 485b31d + 52b00e1 commit f471455
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/TraitManifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public function __construct($base, $forceRegen = false) {
$this->cacheKey = 'traits';

if (!$forceRegen && $data = $this->cache->load($this->cacheKey)) {
$this->traits = $data['traits'];
if (!empty($data['traits'])) {
$this->traits = $data['traits'];
} else {
$this->regenerateTrait(true);
}
} else {
$this->regenerateTrait(true);
}
Expand Down Expand Up @@ -100,7 +104,7 @@ public function handleTraitFile($basename, $pathname, $depth) {

if (!$traits) {
$tokens = token_get_all($file);

$namespace = self::get_namespace_parser()->findAll($tokens);
if($namespace) {
$namespace = implode('', $namespace[0]['namespaceName']) . '\\';
Expand Down

0 comments on commit f471455

Please sign in to comment.