@@ -70,7 +70,7 @@ |
||
70 | 70 | /** |
71 | 71 | * Update the current progress |
72 | 72 | * |
73 | - * @param $newProgress |
|
73 | + * @param integer $newProgress |
|
74 | 74 | * |
75 | 75 | * @return void |
76 | 76 | * |
@@ -141,7 +141,7 @@ |
||
141 | 141 | /** |
142 | 142 | * Add a version to the collection |
143 | 143 | * |
144 | - * @param mixed $version |
|
144 | + * @param VersionInterface $version |
|
145 | 145 | * |
146 | 146 | * @return bool |
147 | 147 | * |
@@ -21,14 +21,12 @@ |
||
21 | 21 | |
22 | 22 | use Baleen\Migrations\Exception\InvalidArgumentException; |
23 | 23 | use Baleen\Migrations\Exception\Version\Collection\CollectionException; |
24 | -use Baleen\Migrations\Migration\Options\Direction; |
|
25 | 24 | use Baleen\Migrations\Shared\Collection\AbstractCollection; |
26 | 25 | use Baleen\Migrations\Version\Collection\Resolver\DefaultResolverStackFactory; |
27 | 26 | use Baleen\Migrations\Version\Collection\Resolver\ResolverInterface; |
28 | 27 | use Baleen\Migrations\Version\Comparator\ComparatorInterface; |
29 | 28 | use Baleen\Migrations\Version\Comparator\MigrationComparator; |
30 | 29 | use Baleen\Migrations\Version\VersionInterface; |
31 | -use Zend\Stdlib\ArrayUtils; |
|
32 | 30 | |
33 | 31 | /** |
34 | 32 | * Class CollectionAbstract. |
@@ -77,7 +77,7 @@ |
||
77 | 77 | * @return string |
78 | 78 | */ |
79 | 79 | public function getDirection() { |
80 | - return $this->direction; |
|
80 | + return $this->direction; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | public function remove($key) |
128 | 128 | { |
129 | 129 | $key = (string) $key; |
130 | - if ( ! isset($this->elements[$key]) && ! array_key_exists($key, $this->elements)) { |
|
130 | + if (!isset($this->elements[$key]) && !array_key_exists($key, $this->elements)) { |
|
131 | 131 | return null; |
132 | 132 | } |
133 | 133 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | final public function forAll(Closure $p) |
271 | 271 | { |
272 | 272 | foreach ($this->elements as $key => $element) { |
273 | - if ( ! $p($key, $element)) { |
|
273 | + if (!$p($key, $element)) { |
|
274 | 274 | return false; |
275 | 275 | } |
276 | 276 | } |
@@ -25,7 +25,6 @@ |
||
25 | 25 | use Baleen\Migrations\Service\Runner\Event\Collection\CollectionBeforeEvent; |
26 | 26 | use Baleen\Migrations\Shared\Collection\CollectionInterface; |
27 | 27 | use Baleen\Migrations\Shared\Event\Context\CollectionContext; |
28 | -use Baleen\Migrations\Shared\Event\MutePublisher; |
|
29 | 28 | use Baleen\Migrations\Shared\Event\Publisher\HasInternalPublisherTrait; |
30 | 29 | use Baleen\Migrations\Shared\Event\PublisherInterface; |
31 | 30 | use Baleen\Migrations\Version\Collection\Collection; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @param string|integer $key The kex/index of the element to remove. |
85 | 85 | * |
86 | - * @return mixed The removed element or NULL, if the collection did not contain the element. |
|
86 | + * @return null|VersionInterface The removed element or NULL, if the collection did not contain the element. |
|
87 | 87 | */ |
88 | 88 | public function remove($key); |
89 | 89 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * Gets all keys/indices of the collection. |
101 | 101 | * |
102 | - * @return array The keys/indices of the collection, in the order of the corresponding |
|
102 | + * @return integer[] The keys/indices of the collection, in the order of the corresponding |
|
103 | 103 | * elements in the collection. |
104 | 104 | */ |
105 | 105 | public function getKeys(); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * |
189 | 189 | * @param Closure $func |
190 | 190 | * |
191 | - * @return array |
|
191 | + * @return \Baleen\Migrations\Version\VersionId[] |
|
192 | 192 | */ |
193 | 193 | public function map(Closure $func); |
194 | 194 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @param int $offset The offset to start from. |
215 | 215 | * @param int|null $length The maximum number of elements to return, or null for no limit. |
216 | 216 | * |
217 | - * @return array |
|
217 | + * @return VersionInterface[] |
|
218 | 218 | */ |
219 | 219 | public function slice($offset, $length = null); |
220 | 220 |
@@ -82,12 +82,12 @@ |
||
82 | 82 | return true; // nothing to do - exit early |
83 | 83 | } |
84 | 84 | |
85 | - $mapToIds = function(VersionInterface $v) { |
|
85 | + $mapToIds = function (VersionInterface $v) { |
|
86 | 86 | return $v->getId(); |
87 | 87 | }; |
88 | 88 | /** @var CollectionInterface $migrated */ |
89 | 89 | /** @var CollectionInterface $notMigrated */ |
90 | - list($migrated, $notMigrated) = $versions->partition(function($i, VersionInterface $v) { |
|
90 | + list($migrated, $notMigrated) = $versions->partition(function ($i, VersionInterface $v) { |
|
91 | 91 | return $v->isMigrated(); |
92 | 92 | }); |
93 | 93 | $migratedIds = $migrated->map($mapToIds); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * |
51 | 51 | * @param SingleCommand $command |
52 | 52 | * |
53 | - * @return VersionInterface |
|
53 | + * @return boolean |
|
54 | 54 | */ |
55 | 55 | public function handle(SingleCommand $command) |
56 | 56 | { |
@@ -20,8 +20,6 @@ |
||
20 | 20 | namespace Baleen\Migrations\Service\Runner; |
21 | 21 | |
22 | 22 | use Baleen\Migrations\Exception\Service\Runner\RunnerException; |
23 | -use Baleen\Migrations\Service\MigrationBus\MigrationBus; |
|
24 | -use Baleen\Migrations\Service\MigrationBus\MigrationBusInterface; |
|
25 | 23 | use Baleen\Migrations\Migration\OptionsInterface; |
26 | 24 | use Baleen\Migrations\Service\Runner\Event\Migration\MigrateAfterEvent; |
27 | 25 | use Baleen\Migrations\Service\Runner\Event\Migration\MigrateBeforeEvent; |