Skip to content

Commit

Permalink
adjust repository factory to throw exception instead of returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Dec 5, 2014
1 parent 032f50c commit 82abeac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 15 additions & 0 deletions src/PHPCR/ConfigurationException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace PHPCR;

use InvalidArgumentException;

/**
* Exception to throw when the options passed to the factory are invalid.
*
* @license http://www.apache.org/licenses Apache License Version 2.0, January 2004
* @license http://opensource.org/licenses/MIT MIT License
*/
class ConfigurationException extends InvalidArgumentException
{
}
5 changes: 3 additions & 2 deletions src/PHPCR/RepositoryFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ interface RepositoryFactoryInterface
* arguments or null if a client wishes to connect to a default
* repository.
*
* @return RepositoryInterface a repository instance or null if this
* implementation does not understand the passed parameters
* @return RepositoryInterface The repository for these parameters.
*
* @throws ConfigurationException if a required parameter is missing from
* the parameters or an unknown parameter is found in the list.
* @throws RepositoryException if no suitable repository is found or
* another error occurs.
*
Expand Down

0 comments on commit 82abeac

Please sign in to comment.