Permalink
Browse files

Renamed "Version" to "Delta" to follow the Ubiquitous Language

  • Loading branch information...
gsomoza committed Jan 31, 2016
1 parent fdfad2a commit da048bee63aefe4085c74a59ef615cb013733674
Showing with 618 additions and 618 deletions.
  1. +7 −7 docs/en/domain-model/glossary.txt
  2. +2 −2 docs/en/domain-model/timeline.txt
  3. +1 −1 docs/en/examples/simple-usage.txt
  4. +4 −4 docs/en/ref/Baleen/Migrations/Event/Timeline/CollectionEvent.txt
  5. +4 −4 docs/en/ref/Baleen/Migrations/Event/Timeline/MigrationEvent.txt
  6. +8 −8 docs/en/ref/Baleen/Migrations/Storage/AbstractStorage.txt
  7. +7 −7 docs/en/ref/Baleen/Migrations/Storage/StorageInterface.txt
  8. +9 −9 docs/en/ref/Baleen/Migrations/Timeline.txt
  9. +10 −10 docs/en/ref/Baleen/Migrations/Timeline/AbstractTimeline.txt
  10. +8 −8 docs/en/ref/Baleen/Migrations/Timeline/TimelineEmitter.txt
  11. +6 −6 docs/en/ref/Baleen/Migrations/Timeline/TimelineInterface.txt
  12. +3 −3 docs/en/ref/Baleen/Migrations/Version.txt
  13. +10 −10 docs/en/ref/Baleen/Migrations/Version/Collection.txt
  14. +12 −12 docs/en/ref/Baleen/Migrations/Version/Collection/Linked.txt
  15. +12 −12 docs/en/ref/Baleen/Migrations/Version/Collection/Migrated.txt
  16. +7 −7 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/AbstractResolver.txt
  17. +2 −2 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/DefaultResolverStackFactory.txt
  18. +8 −8 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/FirstLastResolver.txt
  19. +7 −7 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/HeadResolver.txt
  20. +6 −6 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/IdResolver.txt
  21. +8 −8 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/OffsetResolver.txt
  22. +4 −4 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/ResolverInterface.txt
  23. +7 −7 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/ResolverStack.txt
  24. +2 −2 docs/en/ref/Baleen/Migrations/Version/Collection/Resolver/index.txt
  25. +12 −12 docs/en/ref/Baleen/Migrations/Version/Collection/Sortable.txt
  26. +2 −2 docs/en/ref/Baleen/Migrations/Version/Collection/index.txt
  27. +2 −2 docs/en/ref/Baleen/Migrations/Version/Comparator/ComparatorAwareInterface.txt
  28. +2 −2 docs/en/ref/Baleen/Migrations/Version/Comparator/ComparatorAwareTrait.txt
  29. +5 −5 docs/en/ref/Baleen/Migrations/Version/Comparator/ComparatorInterface.txt
  30. +5 −5 docs/en/ref/Baleen/Migrations/Version/Comparator/DefaultComparator.txt
  31. +2 −2 docs/en/ref/Baleen/Migrations/Version/Comparator/index.txt
  32. +3 −3 docs/en/ref/Baleen/Migrations/Version/VersionInterface.txt
  33. +3 −3 docs/en/ref/Baleen/Migrations/Version/index.txt
  34. +2 −2 docs/en/ref/Baleen/Migrations/index.txt
  35. +8 −8 src/Common/Collection/AbstractCollection.php
  36. +19 −19 src/Common/Collection/CollectionInterface.php
  37. +4 −4 src/Common/Event/AbstractDomainEvent.php
  38. +13 −13 src/{Version → Delta}/Collection/Collection.php
  39. +5 −5 src/{Version → Delta}/Collection/Migrated.php
  40. +6 −6 src/{Version → Delta}/Collection/ResolvableCollectionInterface.php
  41. +12 −12 src/{Version → Delta}/Collection/Resolver/AbstractResolver.php
  42. +1 −1 src/{Version → Delta}/Collection/Resolver/DefaultResolverStackFactory.php
  43. +5 −5 src/{Version → Delta}/Collection/Resolver/FilenameResolver.php
  44. +5 −5 src/{Version → Delta}/Collection/Resolver/FirstLastResolver.php
  45. +5 −5 src/{Version → Delta}/Collection/Resolver/HeadResolver.php
  46. +2 −2 src/{Version → Delta}/Collection/Resolver/LazyIdResolver.php
  47. +4 −4 src/{Version → Delta}/Collection/Resolver/OffsetResolver.php
  48. +5 −5 src/{Version → Delta}/Collection/Resolver/ResolverInterface.php
  49. +3 −3 src/{Version → Delta}/Collection/Resolver/ResolverStack.php
  50. +3 −3 src/{Version → Delta}/Comparator/AbstractComparator.php
  51. +8 −8 src/{Version → Delta}/Comparator/ComparatorInterface.php
  52. +3 −3 src/{Version → Delta}/Comparator/IdComparator.php
  53. +3 −3 src/{Version → Delta}/Comparator/MigrationComparator.php
  54. +5 −5 src/{Version → Delta}/Comparator/NamespacesAwareComparator.php
  55. +5 −5 src/{Version → Delta}/Comparator/ReversedComparator.php
  56. +7 −7 src/{Version/Version.php → Delta/Delta.php}
  57. +9 −9 src/{Version/VersionId.php → Delta/DeltaId.php}
  58. +3 −3 src/{Version/VersionInterface.php → Delta/DeltaInterface.php}
  59. +15 −15 src/{Version → Delta}/Repository/Mapper/VersionMapperInterface.php
  60. +12 −12 src/{Version → Delta}/Repository/VersionRepository.php
  61. +12 −12 src/{Version → Delta}/Repository/VersionRepositoryInterface.php
  62. +1 −1 src/Migration/Repository/AggregateMigrationRepository.php
  63. +4 −4 src/Migration/Repository/Mapper/Definition.php
  64. +2 −2 src/Migration/Repository/Mapper/DefinitionInterface.php
  65. +8 −8 src/Migration/Repository/MigrationRepository.php
  66. +1 −1 src/Migration/Repository/MigrationRepositoryInterface.php
  67. +1 −1 src/Service/DomainBus/HasVersionRepositoryTrait.php
  68. +4 −4 src/Service/DomainBus/Migrate/Collection/CollectionCommand.php
  69. +3 −3 src/Service/DomainBus/Migrate/Collection/CollectionHandler.php
  70. +4 −4 src/Service/DomainBus/Migrate/Converge/ConvergeCommand.php
  71. +5 −5 src/Service/DomainBus/Migrate/HasTargetTrait.php
  72. +4 −4 src/Service/DomainBus/Migrate/Single/SingleCommand.php
  73. +2 −2 src/Service/DomainBus/Migrate/Single/SingleHandler.php
  74. +4 −4 src/Service/Runner/CollectionRunner.php
  75. +5 −5 src/Service/Runner/Event/Collection/CollectionEvent.php
  76. +6 −6 src/Service/Runner/Event/Migration/MigrationEvent.php
  77. +6 −6 src/Service/Runner/MigrationRunner.php
  78. +3 −3 src/Service/Runner/RunnerInterface.php
  79. +10 −10 test/BaseTestCase.php
  80. +2 −2 test/Common/Collection/AbstractCollectionTest.php
  81. +1 −1 test/Common/Collection/CollectionTestCase.php
  82. +2 −2 test/Common/Event/AbstractDomainEventTest.php
  83. +15 −15 test/{Version → Delta}/Collection/CollectionTest.php
  84. +3 −3 test/{Version → Delta}/Collection/MigratedTest.php
  85. +9 −9 test/{Version → Delta}/Collection/Resolver/AbstractResolverTest.php
  86. +3 −3 test/{Version → Delta}/Collection/Resolver/FilenameResolverTest.php
  87. +8 −8 test/{Version → Delta}/Collection/Resolver/HeadResolverTest.php
  88. +3 −3 test/{Version → Delta}/Collection/Resolver/LazyIdResolverTest.php
  89. +3 −3 test/{Version → Delta}/Collection/Resolver/OffsetResolverTest.php
  90. +2 −2 test/{Version → Delta}/Collection/Resolver/ResolverStackTest.php
  91. +1 −1 test/{Version → Delta}/Comparator/ComparatorTestCase.php
  92. +11 −11 test/{Version → Delta}/Comparator/NamespacesAwareComparatorTest.php
  93. +12 −12 test/{Version/VersionIdTest.php → Delta/DeltaIdTest.php}
  94. +9 −9 test/{Version/VersionTest.php → Delta/DeltaTest.php}
  95. +11 −11 test/{Version → Delta}/Repository/VersionRepositoryTest.php
  96. +2 −2 test/Migration/Options/DirectionTest.php
  97. +2 −2 test/Migration/OptionsTest.php
  98. +6 −6 test/Migration/Repository/MigrationRepositoryTest.php
  99. +1 −1 test/Migration/Repository/RepositoryAggregateTest.php
  100. +4 −4 test/Service/DomainBus/Migrate/Collection/CollectionCommandTest.php
  101. +9 −9 test/Service/DomainBus/Migrate/Collection/CollectionHandlerTest.php
  102. +2 −2 test/Service/DomainBus/Migrate/Converge/ConvergeHandlerTest.php
  103. +5 −5 test/Service/DomainBus/Migrate/Single/SingleCommandTest.php
  104. +5 −5 test/Service/DomainBus/Migrate/Single/SingleHandlerTest.php
  105. +4 −4 test/Service/Runner/CollectionRunnerTest.php
  106. +7 −7 test/Service/Runner/Event/CollectionEventTest.php
  107. +7 −7 test/Service/Runner/Event/MigrationEventTest.php
  108. +3 −3 test/Service/Runner/MigrationRunnerTest.php
  109. +1 −1 test/Service/Runner/RunnerTestCase.php
  110. +18 −18 test/TimelineTes.php
@@ -19,7 +19,7 @@ as to provide information about the different models that make up the "migration
* :term:`Timeline`
* :term:`VersionRepository`
* :term:`Storage`
* :term:`Version`
* :term:`Delta`
* :term:`Migration`
A single application can have any number of Migration Ecosystems, but its most common to find only one or two per
@@ -52,13 +52,13 @@ as to provide information about the different models that make up the "migration
Timeline
The Timeline is an object that is in charge of executing migrations in bulk using certain pre-defined algorithms.
It holds an immutable :term:`Version Collection`.
It holds an immutable :term:`Delta Collection`.
Version
A Version is a lightweight entity that is persisted into the :term:`Storage` and holds state information about
a :term:`Migration`. Currently the only state information being saved is whether the Version is :term:`migrated`
or not. If a Version is present in the :term:`Storage` then it means that Version has already been migrated.
Delta
A Delta is a lightweight entity that is persisted into the :term:`Storage` and holds state information about
a :term:`Migration`. Currently the only state information being saved is whether the Delta is :term:`migrated`
or not. If a Delta is present in the :term:`Storage` then it means that Delta has already been migrated.
Version Collection
Delta Collection
A special object to represent and sort a set of Collection. Its important to note that it behaves as an ordered
set of elements.
@@ -39,7 +39,7 @@ When being instantiated the Timeline requires a :term:`version collection` and a
.. glossary::
``VersionCollection $versions``
The :term:`version collection` must contain at least one :term:`Version`. All versions in the collection must
The :term:`version collection` must contain at least one :term:`Delta`. All versions in the collection must
have a :term:`migration` assigned to them or otherwise an exception will be thrown.
Something to note is that the ``VersionCollection`` object will be cloned before being stored in the Timeline.
@@ -53,7 +53,7 @@ When being instantiated the Timeline requires a :term:`version collection` and a
The default comparator simply
extracts the first number from each version and subtracts the second one from the first one. See class
``Version\Comparator\DefaultComparator`` for the source code.
``Delta\Comparator\DefaultComparator`` for the source code.
``MigrationBus $migrationBus`` (optional)
The ``MigrationBus`` (colloquially "bus") is an object that can handle a ``MigrationCommand`` ("command"). The
@@ -40,7 +40,7 @@ The following example illustrates how you can use Baleen migrations from within
]);
$timeline->runSingle('v100', $options);
/* Version 'v100' will receive an instance of RunOptions through the setOptions
/* Delta 'v100' will receive an instance of RunOptions through the setOptions
method. You can also pass RunOptions to most of the other Timeline methods. */
@@ -18,17 +18,17 @@ Baleen\\Migrations\\Service\\Runner\\Event\\Collection\\CollectionEvent
.. php:attr:: target
protected VersionInterface
protected DeltaInterface
.. php:attr:: progress
protected Progress
.. php:method:: __construct(VersionInterface $target, OptionsInterface $options, Linked $versions, Progress $progress = null)
.. php:method:: __construct(DeltaInterface $target, OptionsInterface $options, Linked $versions, Progress $progress = null)
CollectionEvent constructor.
:type $target: VersionInterface
:type $target: DeltaInterface
:param $target:
:type $options: OptionsInterface
:param $options:
@@ -47,7 +47,7 @@ Baleen\\Migrations\\Service\\Runner\\Event\\Collection\\CollectionEvent
.. php:method:: getTarget()
:returns: VersionInterface
:returns: DeltaInterface
.. php:method:: getProgress()
@@ -14,17 +14,17 @@ Baleen\\Migrations\\Service\\Runner\\Event\\Migration\\MigrationEvent
.. php:attr:: version
protected VersionInterface
protected DeltaInterface
.. php:attr:: progress
protected Progress
.. php:method:: __construct(VersionInterface $version, OptionsInterface $options, Progress $progress = null)
.. php:method:: __construct(DeltaInterface $version, OptionsInterface $options, Progress $progress = null)
MigrationEvent constructor.
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
@@ -37,7 +37,7 @@ Baleen\\Migrations\\Service\\Runner\\Event\\Migration\\MigrationEvent
.. php:method:: getVersion()
:returns: VersionInterface
:returns: DeltaInterface
.. php:method:: getProgress()
@@ -1,5 +1,5 @@
--------------------------------------------
Baleen\\Migrations\\Version\\VersionRepository\\VersionRepository
Baleen\\Migrations\\Delta\\VersionRepository\\VersionRepository
--------------------------------------------
.. php:namespace: Baleen\\Migrations\\Storage
@@ -14,14 +14,14 @@ Baleen\\Migrations\\Version\\VersionRepository\\VersionRepository
:returns: Migrated
.. php:method:: update(VersionInterface $version)
.. php:method:: update(DeltaInterface $version)
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
.. php:method:: doFetchAll()
:returns: VersionInterface[]|Migrated
:returns: DeltaInterface[]|Migrated
.. php:method:: setComparator(ComparatorInterface $comparator)
@@ -40,18 +40,18 @@ Baleen\\Migrations\\Version\\VersionRepository\\VersionRepository
:param $versions:
:returns: bool Returns false on failure.
.. php:method:: save(VersionInterface $version)
.. php:method:: save(DeltaInterface $version)
Adds a version into storage
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:returns: bool
.. php:method:: delete(VersionInterface $version)
.. php:method:: delete(DeltaInterface $version)
Removes a version from storage
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:returns: bool
@@ -1,5 +1,5 @@
---------------------------------------------
Baleen\\Migrations\\Version\\VersionRepository\\MigrationRepositoryInterface
Baleen\\Migrations\\Delta\\VersionRepository\\MigrationRepositoryInterface
---------------------------------------------
.. php:namespace: Baleen\\Migrations\\Storage
@@ -22,27 +22,27 @@ Baleen\\Migrations\\Version\\VersionRepository\\MigrationRepositoryInterface
:param $versions:
:returns: bool Returns false on failure.
.. php:method:: update(VersionInterface $version)
.. php:method:: update(DeltaInterface $version)
Saves or deletes a version depending on whether the version is
respectively migrated or not.
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:returns: bool The result of calling 'save' or 'delete' on the version.
.. php:method:: save(VersionInterface $version)
.. php:method:: save(DeltaInterface $version)
Adds a version into storage
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:returns: bool
.. php:method:: delete(VersionInterface $version)
.. php:method:: delete(DeltaInterface $version)
Removes a version from storage
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:returns: bool
@@ -12,15 +12,15 @@ Baleen\\Migrations\\Timeline
.. php:method:: upTowards($goalVersion, OptionsInterface $options = null)
:type $goalVersion: VersionInterface|string
:type $goalVersion: DeltaInterface|string
:param $goalVersion:
:type $options: OptionsInterface
:param $options:
:returns: Sortable A collection of modified versions
.. php:method:: downTowards($goalVersion, OptionsInterface $options = null)
:type $goalVersion: VersionInterface|string
:type $goalVersion: DeltaInterface|string
:param $goalVersion:
:type $options: OptionsInterface
:param $options:
@@ -37,15 +37,15 @@ Baleen\\Migrations\\Timeline
:param $options:
:returns: Linked A collection of versions that were *changed* during the process. Note that this collection may significantly defer from what would be obtained by $this->getVersions()
.. php:method:: runSingle(VersionInterface $version, OptionsInterface $options, Progress $progress = null)
.. php:method:: runSingle(DeltaInterface $version, OptionsInterface $options, Progress $progress = null)
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
:type $progress: Progress
:param $progress: Provides contextual information about current progress if this migration is one of many that are being run in batch.
:returns: VersionInterface|false
:returns: DeltaInterface|false
.. php:method:: __construct(Linked $versions, MigrationBus $migrationBus = null)
@@ -54,12 +54,12 @@ Baleen\\Migrations\\Timeline
:type $migrationBus: MigrationBus
:param $migrationBus: A CommandBus that will be used to run each individual migration.
.. php:method:: shouldMigrate(VersionInterface $version, OptionsInterface $options)
.. php:method:: shouldMigrate(DeltaInterface $version, OptionsInterface $options)
Returns true if the operatin is forced, or if the direction is the
opposite to the state of the migration.
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
@@ -79,11 +79,11 @@ Baleen\\Migrations\\Timeline
:param $options:
:returns: bool
.. php:method:: runCollection(VersionInterface $goalVersion, OptionsInterface $options, Linked $collection)
.. php:method:: runCollection(DeltaInterface $goalVersion, OptionsInterface $options, Linked $collection)
Executes migrations against a collection
:type $goalVersion: VersionInterface
:type $goalVersion: DeltaInterface
:param $goalVersion:
:type $options: OptionsInterface
:param $options:
@@ -19,12 +19,12 @@ Baleen\\Migrations\\Timeline\\AbstractTimeline
:type $migrationBus: MigrationBus
:param $migrationBus: A CommandBus that will be used to run each individual migration.
.. php:method:: shouldMigrate(VersionInterface $version, OptionsInterface $options)
.. php:method:: shouldMigrate(DeltaInterface $version, OptionsInterface $options)
Returns true if the operatin is forced, or if the direction is the
opposite to the state of the migration.
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
@@ -44,11 +44,11 @@ Baleen\\Migrations\\Timeline\\AbstractTimeline
:param $options:
:returns: bool
.. php:method:: runCollection(VersionInterface $goalVersion, OptionsInterface $options, Linked $collection)
.. php:method:: runCollection(DeltaInterface $goalVersion, OptionsInterface $options, Linked $collection)
Executes migrations against a collection
:type $goalVersion: VersionInterface
:type $goalVersion: DeltaInterface
:param $goalVersion:
:type $options: OptionsInterface
:param $options:
@@ -94,7 +94,7 @@ Baleen\\Migrations\\Timeline\\AbstractTimeline
Runs all versions up, starting from the oldest and until (and including)
the specified version.
:type $version: string|VersionInterface
:type $version: string|DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
@@ -104,7 +104,7 @@ Baleen\\Migrations\\Timeline\\AbstractTimeline
Runs all versions down, starting from the newest and until (and including)
the specified version.
:type $version: string|VersionInterface
:type $version: string|DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
@@ -115,19 +115,19 @@ Baleen\\Migrations\\Timeline\\AbstractTimeline
specified version are "up" and
all versions *after* the specified version are "down".
:type $goalVersion: string|VersionInterface
:type $goalVersion: string|DeltaInterface
:param $goalVersion:
:type $options: OptionsInterface
:param $options:
.. php:method:: runSingle(VersionInterface $version, OptionsInterface $options, Progress $progress)
.. php:method:: runSingle(DeltaInterface $version, OptionsInterface $options, Progress $progress)
Runs a single migration in the specified direction.
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
:type $progress: Progress
:param $progress:
:returns: VersionInterface|false
:returns: DeltaInterface|false
@@ -12,9 +12,9 @@ Baleen\\Migrations\\Timeline\\TimelineEmitter
protected null|EventDispatcherInterface
.. php:method:: dispatchCollectionBefore(VersionInterface $targetVersion, OptionsInterface $options, Linked $versions, Progress $progress = null)
.. php:method:: dispatchCollectionBefore(DeltaInterface $targetVersion, OptionsInterface $options, Linked $versions, Progress $progress = null)
:type $targetVersion: VersionInterface
:type $targetVersion: DeltaInterface
:param $targetVersion:
:type $options: OptionsInterface
:param $options:
@@ -24,11 +24,11 @@ Baleen\\Migrations\\Timeline\\TimelineEmitter
:param $progress:
:returns: \Symfony\Component\EventDispatcher\Event|void
.. php:method:: dispatchCollectionAfter(VersionInterface $targetVersion, OptionsInterface $options, Linked $versions, Progress $progress = null)
.. php:method:: dispatchCollectionAfter(DeltaInterface $targetVersion, OptionsInterface $options, Linked $versions, Progress $progress = null)
dispatchCollectionAfter.
:type $targetVersion: VersionInterface
:type $targetVersion: DeltaInterface
:param $targetVersion:
:type $options: OptionsInterface
:param $options:
@@ -38,23 +38,23 @@ Baleen\\Migrations\\Timeline\\TimelineEmitter
:param $progress:
:returns: \Symfony\Component\EventDispatcher\Event|void
.. php:method:: dispatchMigrationBefore(VersionInterface $version, OptionsInterface $options, Progress $progress = null)
.. php:method:: dispatchMigrationBefore(DeltaInterface $version, OptionsInterface $options, Progress $progress = null)
dispatchMigrationBefore.
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
:type $progress: Progress
:param $progress:
:returns: \Symfony\Component\EventDispatcher\Event|void
.. php:method:: dispatchMigrationAfter(VersionInterface $version, OptionsInterface $options, Progress $progress = null)
.. php:method:: dispatchMigrationAfter(DeltaInterface $version, OptionsInterface $options, Progress $progress = null)
dispatchMigrationAfter.
:type $version: VersionInterface
:type $version: DeltaInterface
:param $version:
:type $options: OptionsInterface
:param $options:
Oops, something went wrong.

0 comments on commit da048be

Please sign in to comment.