From 39ec442c6fbb5b3f1b57c78d6ebded6b965afa03 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 29 Sep 2016 14:29:50 +0200 Subject: [PATCH] raise required package versions --- CHANGELOG.md | 11 +++++++++++ UPGRADE.md | 11 +++++++++++ composer.json | 10 +++++----- metadata/MappedStatement.mongodb.xml | 2 +- ...entRepository.php => StatementRepository.php} | 16 ++++++++-------- tests/Functional/StatementRepositoryTest.php | 4 ++-- ...itoryTest.php => StatementRepositoryTest.php} | 8 ++++---- 7 files changed, 42 insertions(+), 20 deletions(-) rename src/Repository/{MappedStatementRepository.php => StatementRepository.php} (57%) rename tests/Unit/Repository/{MappedStatementRepositoryTest.php => StatementRepositoryTest.php} (71%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3f886f..4c694bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ CHANGELOG ========= +0.3.0 +----- + +* The `StatementRepository` class is final. + +* The version of the virtual `php-xapi/repository-implementation` package + provided by this package has been raised to `0.3`. + +* The versions of the `php-xapi/repository-api` and `php-xapi/repository-doctrine` + requirements have been raised to `^0.3`. + 0.2.0 ----- diff --git a/UPGRADE.md b/UPGRADE.md index 5a03e2c..a7a03e8 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,6 +1,17 @@ UPGRADE ======= +Upgrading from 0.2 to 0.3 +------------------------- + +* The `StatementRepository` class is final. + +* The version of the virtual `php-xapi/repository-implementation` package + provided by this package has been raised to `0.3`. + +* The versions of the `php-xapi/repository-api` and `php-xapi/repository-doctrine` + requirements have been raised to `^0.3`. + Upgrading from 0.1 to 0.2 ------------------------- diff --git a/composer.json b/composer.json index a57320e..22aa486 100644 --- a/composer.json +++ b/composer.json @@ -12,9 +12,9 @@ ], "require": { "doctrine/mongodb-odm": "~1.0", - "php-xapi/model": "^0.1.0", - "php-xapi/repository-api": "^0.2.0", - "php-xapi/repository-doctrine": "^0.2.1" + "php-xapi/model": "^1.0", + "php-xapi/repository-api": "^0.3@dev", + "php-xapi/repository-doctrine": "^0.3@dev" }, "require-dev": { "php-xapi/exception": "^0.1.0" @@ -23,7 +23,7 @@ "xabbuh/xapi-mongodb-storage": "*" }, "provide": { - "php-xapi/repository-implementation": "0.2" + "php-xapi/repository-implementation": "0.3" }, "autoload": { "psr-4": { @@ -37,7 +37,7 @@ }, "extra": { "branch-alias": { - "dev-master": "0.2.x-dev" + "dev-master": "0.3.x-dev" } } } diff --git a/metadata/MappedStatement.mongodb.xml b/metadata/MappedStatement.mongodb.xml index b636f85..235741d 100644 --- a/metadata/MappedStatement.mongodb.xml +++ b/metadata/MappedStatement.mongodb.xml @@ -4,7 +4,7 @@ http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd" > diff --git a/src/Repository/MappedStatementRepository.php b/src/Repository/StatementRepository.php similarity index 57% rename from src/Repository/MappedStatementRepository.php rename to src/Repository/StatementRepository.php index 4212cc4..ba0bf2a 100644 --- a/src/Repository/MappedStatementRepository.php +++ b/src/Repository/StatementRepository.php @@ -12,36 +12,36 @@ namespace XApi\Repository\MongoDB\Repository; use Doctrine\ODM\MongoDB\DocumentRepository; -use XApi\Repository\Api\Mapping\MappedStatement; -use XApi\Repository\Doctrine\Repository\MappedStatementRepository as MappedStatementRepositoryInteface; +use XApi\Repository\Doctrine\Mapping\Statement; +use XApi\Repository\Doctrine\Repository\Mapping\StatementRepository as StatementRepositoryInterface; /** * A MongoDB backed statement repository. * * @author Christian Flothmann */ -class MappedStatementRepository extends DocumentRepository implements MappedStatementRepositoryInteface +final class StatementRepository extends DocumentRepository implements StatementRepositoryInterface { /** * {@inheritdoc} */ - public function findMappedStatement(array $criteria) + public function findStatement(array $criteria) { - return parent::findOneBy($criteria); + return $this->findOneBy($criteria); } /** * {@inheritdoc} */ - public function findMappedStatements(array $criteria) + public function findStatements(array $criteria) { - return parent::findBy($criteria); + return $this->findBy($criteria); } /** * {@inheritdoc} */ - public function storeMappedStatement(MappedStatement $mappedStatement, $flush = true) + public function storeStatement(Statement $mappedStatement, $flush = true) { $this->getDocumentManager()->persist($mappedStatement); diff --git a/tests/Functional/StatementRepositoryTest.php b/tests/Functional/StatementRepositoryTest.php index 07350c8..b94979d 100644 --- a/tests/Functional/StatementRepositoryTest.php +++ b/tests/Functional/StatementRepositoryTest.php @@ -35,7 +35,7 @@ protected function createObjectManager() $config->setHydratorDir(__DIR__.'/../hydrators'); $config->setHydratorNamespace('Hydrator'); $fileLocator = new SymfonyFileLocator( - array(__DIR__.'/../../metadata' => 'XApi\Repository\Api\Mapping'), + array(__DIR__.'/../../metadata' => 'XApi\Repository\Doctrine\Mapping'), '.mongodb.xml' ); $driver = new XmlDriver($fileLocator); @@ -46,6 +46,6 @@ protected function createObjectManager() protected function getStatementClassName() { - return 'XApi\Repository\Api\Mapping\MappedStatement'; + return 'XApi\Repository\Doctrine\Mapping\Statement'; } } diff --git a/tests/Unit/Repository/MappedStatementRepositoryTest.php b/tests/Unit/Repository/StatementRepositoryTest.php similarity index 71% rename from tests/Unit/Repository/MappedStatementRepositoryTest.php rename to tests/Unit/Repository/StatementRepositoryTest.php index 1d45b42..b75380c 100644 --- a/tests/Unit/Repository/MappedStatementRepositoryTest.php +++ b/tests/Unit/Repository/StatementRepositoryTest.php @@ -11,13 +11,13 @@ namespace XApi\Repository\MongoDB\Tests\Unit\Repository; -use XApi\Repository\Doctrine\Test\Unit\Repository\MappedStatementRepositoryTest as BaseStatementRepositoryTest; -use XApi\Repository\MongoDB\Repository\MappedStatementRepository; +use XApi\Repository\Doctrine\Test\Unit\Repository\Mapping\StatementRepositoryTest as BaseStatementRepositoryTest; +use XApi\Repository\MongoDB\Repository\StatementRepository; /** * @author Christian Flothmann */ -class MappedStatementRepositoryTest extends BaseStatementRepositoryTest +class StatementRepositoryTest extends BaseStatementRepositoryTest { protected function getObjectManagerClass() { @@ -36,6 +36,6 @@ protected function getClassMetadataClass() protected function createMappedStatementRepository($objectManager, $unitOfWork, $classMetadata) { - return new MappedStatementRepository($objectManager, $unitOfWork, $classMetadata); + return new StatementRepository($objectManager, $unitOfWork, $classMetadata); } }