Skip to content

Commit

Permalink
Merge pull request #25 from davedevelopment/better-wrapping
Browse files Browse the repository at this point in the history
Wrap individual function calls
  • Loading branch information
davedevelopment committed May 11, 2015
2 parents 18ec485 + d2be20f commit b37020a
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 78 deletions.
9 changes: 9 additions & 0 deletions generator/GlobalFunctionFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,13 @@ public function build()
$this->addCode($this->functions);
$this->addPart('functions_footer');
}

public function generateFactoryCall(FactoryCall $call)
{
$code = "if (!function_exists('{$call->getName()}')) {";
$code.= parent::generateFactoryCall($call);
$code.= "}\n";

return $code;
}
}
1 change: 0 additions & 1 deletion generator/parts/functions_footer.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
}
1 change: 1 addition & 0 deletions generator/parts/functions_header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ if (!function_exists('assertThat')) {
$args
);
}
}
Loading

0 comments on commit b37020a

Please sign in to comment.