Skip to content

Commit

Permalink
[PageFlow] Changed the PageFlowRepository::add() method so that it im…
Browse files Browse the repository at this point in the history
…mediately returns null if the specified page flow is already in the repository. (Issue piece#4)
  • Loading branch information
iteman committed Sep 18, 2012
1 parent c5a02bb commit 7ca2e22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Piece/Flow/PageFlow/PageFlowRepository.php
Expand Up @@ -90,6 +90,8 @@ public function __construct(PageFlowRegistry $pageFlowRegistry, $cacheDir, $clea
*/
public function add($id)
{
if (array_key_exists($id, $this->pageFlows)) return;

if (!file_exists($this->pageFlowRegistry->getFileName($id))) {
throw new FileNotFoundException(sprintf('The page flow definition file [ %s ] is not found.', $this->pageFlowRegistry->getFileName($id)));
}
Expand Down

0 comments on commit 7ca2e22

Please sign in to comment.