1 | <?php |
||
27 | final class MigrationBus extends CommandBus implements MigrationBusInterface |
||
28 | { |
||
29 | /** |
||
30 | * @inheritdoc |
||
31 | */ |
||
32 | 122 | public function __construct(array $middleware) |
|
33 | { |
||
34 | 122 | $foundHandler = false; |
|
35 | 122 | foreach ($middleware as $object) { |
|
36 | 121 | if ($object instanceof MigrateHandler) { |
|
37 | 121 | $foundHandler = true; |
|
38 | 121 | break; |
|
39 | } |
||
40 | 122 | } |
|
41 | 122 | if (!$foundHandler) { |
|
42 | 1 | throw new MigrationBusException(sprintf( |
|
43 | 1 | 'MigrationBus must have at least one instance of "%s"', |
|
44 | MigrateHandler::class |
||
45 | 1 | )); |
|
46 | } |
||
47 | 121 | parent::__construct($middleware); |
|
48 | 121 | } |
|
49 | |||
50 | /** |
||
51 | * factory |
||
52 | * @return MigrationBus |
||
53 | */ |
||
54 | 121 | public static function createDefaultBus() |
|
58 | |||
59 | /** |
||
60 | * getDefaultMiddleWare |
||
61 | * @return array |
||
62 | */ |
||
63 | 122 | public static function getDefaultMiddleWare() |
|
71 | } |
||
72 |