Skip to content

Commit

Permalink
🐛 Removed possibility of infinite loop and completed a todo for #61
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Dann committed Jan 13, 2017
1 parent f218c6d commit 917c753
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Entities/Generators/TaxonomyIndexGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ class TaxonomyIndexGenerator extends FileGenerator
public function generate(Project $project)
{
if (! $this->file->hasData('use')) {
return $this->file; //@todo this should return a stripped version of the generator, otherwise you will get infinite loops?
$this->file->setData([
'generator' => array_filter($this->file->getData('generator'), function ($value) {
return $value !== 'TaxonomyIndexGenerator';
}),
]);
return $this->file;
}

$newFile = clone $this->file;
Expand Down

0 comments on commit 917c753

Please sign in to comment.