Skip to content

Commit

Permalink
调整readme
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Apr 24, 2019
1 parent c3d04e8 commit 0ca9582
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# thinkphp5.2 数据库迁移工具
# thinkphp6 数据库迁移工具

## 安装
~~~
Expand Down
4 changes: 2 additions & 2 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getAdapter()
* 获取数据库配置
* @return array
*/
protected function getDbConfig()
protected function getDbConfig(): array
{
$config = $this->app->config->get('database');

Expand Down Expand Up @@ -72,7 +72,7 @@ protected function getDbConfig()
return $dbConfig;
}

protected function verifyMigrationDirectory($path)
protected function verifyMigrationDirectory(string $path)
{
if (!is_dir($path)) {
throw new InvalidArgumentException(sprintf('Migration directory "%s" does not exist', $path));
Expand Down
2 changes: 1 addition & 1 deletion src/Creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(App $app)
$this->app = $app;
}

public function create($className)
public function create(string $className)
{
$path = $this->ensureDirectory();

Expand Down
30 changes: 15 additions & 15 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(Faker $faker)
* @param callable $attributes
* @return $this
*/
public function defineAs($class, $name, callable $attributes)
public function defineAs(string $class, string $name, callable $attributes)
{
return $this->define($class, $attributes, $name);
}
Expand All @@ -75,7 +75,7 @@ public function defineAs($class, $name, callable $attributes)
* @param string $name
* @return $this
*/
public function define($class, callable $attributes, $name = 'default')
public function define(string $class, callable $attributes, string $name = 'default')
{
$this->definitions[$class][$name] = $attributes;

Expand All @@ -90,7 +90,7 @@ public function define($class, callable $attributes, $name = 'default')
* @param callable|array $attributes
* @return $this
*/
public function state($class, $state, $attributes)
public function state(string $class, string $state, $attributes)
{
$this->states[$class][$state] = $attributes;

Expand All @@ -105,7 +105,7 @@ public function state($class, $state, $attributes)
* @param string $name
* @return $this
*/
public function afterMaking($class, callable $callback, $name = 'default')
public function afterMaking(string $class, callable $callback, string $name = 'default')
{
$this->afterMaking[$class][$name][] = $callback;

Expand All @@ -120,7 +120,7 @@ public function afterMaking($class, callable $callback, $name = 'default')
* @param callable $callback
* @return $this
*/
public function afterMakingState($class, $state, callable $callback)
public function afterMakingState(string $class, string $state, callable $callback)
{
return $this->afterMaking($class, $callback, $state);
}
Expand All @@ -133,7 +133,7 @@ public function afterMakingState($class, $state, callable $callback)
* @param string $name
* @return $this
*/
public function afterCreating($class, callable $callback, $name = 'default')
public function afterCreating(string $class, callable $callback, string $name = 'default')
{
$this->afterCreating[$class][$name][] = $callback;

Expand All @@ -148,7 +148,7 @@ public function afterCreating($class, callable $callback, $name = 'default')
* @param callable $callback
* @return $this
*/
public function afterCreatingState($class, $state, callable $callback)
public function afterCreatingState(string $class, string $state, callable $callback)
{
return $this->afterCreating($class, $callback, $state);
}
Expand All @@ -160,7 +160,7 @@ public function afterCreatingState($class, $state, callable $callback)
* @param array $attributes
* @return mixed
*/
public function create($class, array $attributes = [])
public function create(string $class, array $attributes = [])
{
return $this->of($class)->create($attributes);
}
Expand All @@ -173,7 +173,7 @@ public function create($class, array $attributes = [])
* @param array $attributes
* @return mixed
*/
public function createAs($class, $name, array $attributes = [])
public function createAs(string $class, string $name, array $attributes = [])
{
return $this->of($class, $name)->create($attributes);
}
Expand All @@ -185,7 +185,7 @@ public function createAs($class, $name, array $attributes = [])
* @param array $attributes
* @return mixed
*/
public function make($class, array $attributes = [])
public function make(string $class, array $attributes = [])
{
return $this->of($class)->make($attributes);
}
Expand All @@ -198,7 +198,7 @@ public function make($class, array $attributes = [])
* @param array $attributes
* @return mixed
*/
public function makeAs($class, $name, array $attributes = [])
public function makeAs(string $class, string $name, array $attributes = [])
{
return $this->of($class, $name)->make($attributes);
}
Expand All @@ -211,7 +211,7 @@ public function makeAs($class, $name, array $attributes = [])
* @param array $attributes
* @return array
*/
public function rawOf($class, $name, array $attributes = [])
public function rawOf(string $class, string $name, array $attributes = [])
{
return $this->raw($class, $attributes, $name);
}
Expand All @@ -224,7 +224,7 @@ public function rawOf($class, $name, array $attributes = [])
* @param string $name
* @return array
*/
public function raw($class, array $attributes = [], $name = 'default')
public function raw(string $class, array $attributes = [], string $name = 'default')
{
return array_merge(
call_user_func($this->definitions[$class][$name], $this->faker), $attributes
Expand All @@ -238,7 +238,7 @@ public function raw($class, array $attributes = [], $name = 'default')
* @param string $name
* @return FactoryBuilder
*/
public function of($class, $name = 'default')
public function of(string $class, string $name = 'default')
{
return new FactoryBuilder(
$class, $name, $this->definitions, $this->states,
Expand All @@ -252,7 +252,7 @@ public function of($class, $name = 'default')
* @param string $path
* @return $this
*/
public function load($path)
public function load(string $path)
{
$factory = $this;

Expand Down

0 comments on commit 0ca9582

Please sign in to comment.