Skip to content

Commit

Permalink
test against interface
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Oct 13, 2016
1 parent b724331 commit 10ced46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/CouchDB/DocumentManager.php
Expand Up @@ -17,6 +17,7 @@
use Doctrine\ODM\CouchDB\Configuration;
use Doctrine\ODM\CouchDB\DocumentManager as BaseDocumentManager;
use Jgut\Doctrine\ManagerBuilder\CouchDB\Repository\DefaultRepositoryFactory;
use Jgut\Doctrine\ManagerBuilder\CouchDB\Repository\RepositoryFactory;

/**
* Custom Doctrine CouchDB Document Manager.
Expand Down Expand Up @@ -54,9 +55,9 @@ public function getRepositoryFactory()
/**
* Set repository factory.
*
* @param DefaultRepositoryFactory $repositoryFactory
* @param RepositoryFactory $repositoryFactory
*/
public function setRepositoryFactory(DefaultRepositoryFactory $repositoryFactory)
public function setRepositoryFactory(RepositoryFactory $repositoryFactory)
{
$this->repositoryFactory = $repositoryFactory;
}
Expand Down
6 changes: 3 additions & 3 deletions src/CouchDBBuilder.php
Expand Up @@ -19,7 +19,7 @@
use Doctrine\ODM\CouchDB\Mapping\Driver\XmlDriver;
use Doctrine\ODM\CouchDB\Mapping\Driver\YamlDriver;
use Jgut\Doctrine\ManagerBuilder\CouchDB\DocumentManager;
use Jgut\Doctrine\ManagerBuilder\CouchDB\Repository\DefaultRepositoryFactory;
use Jgut\Doctrine\ManagerBuilder\CouchDB\Repository\RepositoryFactory;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\HelperSet;

Expand Down Expand Up @@ -148,7 +148,7 @@ protected function getYamlMetadataDriver(array $paths, $extension = null)
*
* @throws \InvalidArgumentException
*
* @return DefaultRepositoryFactory|null
* @return RepositoryFactory|null
*/
protected function getRepositoryFactory()
{
Expand All @@ -158,7 +158,7 @@ protected function getRepositoryFactory()

$repositoryFactory = $this->options['repository_factory'];

if (!$repositoryFactory instanceof DefaultRepositoryFactory) {
if (!$repositoryFactory instanceof RepositoryFactory) {
throw new \InvalidArgumentException(sprintf(
'Invalid factory class "%s". It must be a Jgut\Doctrine\ManagerBuilder\CouchDB\RepositoryFactory.',
get_class($repositoryFactory)
Expand Down

0 comments on commit 10ced46

Please sign in to comment.