-
Notifications
You must be signed in to change notification settings - Fork 11.6k
[5.0] Automatically Resolve Migrations Dependencies #6784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
<?php namespace Illuminate\Database\Migrations; | ||
|
||
use Illuminate\Filesystem\Filesystem; | ||
use Illuminate\Contracts\Container\Container as ContainerContract; | ||
use Illuminate\Database\ConnectionResolverInterface as Resolver; | ||
|
||
class Migrator { | ||
|
||
/** | ||
* The container instance. | ||
* | ||
* @var \Illuminate\Contracts\Container\Container | ||
*/ | ||
protected $container; | ||
|
||
/** | ||
* The migration repository implementation. | ||
* | ||
|
@@ -44,17 +52,20 @@ class Migrator { | |
* Create a new migrator instance. | ||
* | ||
* @param \Illuminate\Database\Migrations\MigrationRepositoryInterface $repository | ||
* @param \Illuminate\Contracts\Container\Container $container | ||
* @param \Illuminate\Database\ConnectionResolverInterface $resolver | ||
* @param \Illuminate\Filesystem\Filesystem $files | ||
* @return void | ||
*/ | ||
public function __construct(MigrationRepositoryInterface $repository, | ||
Resolver $resolver, | ||
Filesystem $files) | ||
ContainerContract $container, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is already aligned with spaces. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. incorrect indentation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this still needs fixing |
||
Resolver $resolver, | ||
Filesystem $files) | ||
{ | ||
$this->files = $files; | ||
$this->resolver = $resolver; | ||
$this->repository = $repository; | ||
$this->container = $container; | ||
$this->resolver = $resolver; | ||
$this->files = $files; | ||
} | ||
|
||
/** | ||
|
@@ -298,7 +309,7 @@ public function resolve($file) | |
|
||
$class = studly_case($file); | ||
|
||
return new $class; | ||
return $this->container->make($class); | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already indented with tabs.