From e5f8efb8d75eb816f8826c3f79ee580ddad8e755 Mon Sep 17 00:00:00 2001 From: kakuilan Date: Tue, 4 Feb 2020 15:12:08 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=A1=8C=E5=88=9B=E5=BB=BA=E6=A8=A1=E5=9E=8B,=E5=BD=93?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=B1=BB=E5=B7=B2=E5=AD=98=E5=9C=A8=E6=97=B6?= =?UTF-8?q?,=E9=87=8D=E6=96=B0=E6=8C=87=E5=AE=9Auses=E7=BB=A7=E6=89=BF?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E7=88=B6=E7=B1=BB,=E8=80=8C=E8=AF=A5?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=B2=A1=E6=9C=89=E6=9B=B4=E6=96=B0=E6=96=B0?= =?UTF-8?q?=E7=88=B6=E7=B1=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/database/src/Commands/ModelCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/database/src/Commands/ModelCommand.php b/src/database/src/Commands/ModelCommand.php index 50c567ab0..c270c798a 100644 --- a/src/database/src/Commands/ModelCommand.php +++ b/src/database/src/Commands/ModelCommand.php @@ -172,9 +172,8 @@ class ModelCommand extends Command if (! is_dir($dir)) { @mkdir($dir, 0755, true); } - - file_put_contents($path, $this->buildClass($table, $class, $option)); } + file_put_contents($path, $this->buildClass($table, $class, $option)); $columns = $this->getColumns($class, $columns, $option->isForceCasts()); From d2f742c4509068b9202ff5d9839fdf423c8f8917 Mon Sep 17 00:00:00 2001 From: kakuilan Date: Tue, 4 Feb 2020 15:21:20 +0800 Subject: [PATCH 2/6] fix CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a1ddbc3..ffcf57823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ - [#1303](https://github.com/hyperf/hyperf/pull/1303) Deleted useless `$httpMethod` for `Hyperf\RpcServer\Router\Router`. +## Fixed + +- [#1328](https://github.com/hyperf/hyperf/pull/1328) Fixed when model exists,and reset the parent class,but ModelCommand::createModel not update. + + # v1.1.17 - 2020-01-24 ## Added From e049b5ac1161af243473544b8673ae1434919f61 Mon Sep 17 00:00:00 2001 From: kakuilan Date: Wed, 5 Feb 2020 13:23:27 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix=20=E4=BF=AE=E6=94=B9gen:model=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E6=94=AF=E6=8C=81=E6=9B=B4=E6=96=B0=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=BB=A7=E6=89=BF=E7=9A=84=E7=88=B6=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Commands/Ast/ModelUpdateVisitor.php | 37 ++++++++++++++++++- src/database/src/Commands/ModelCommand.php | 3 +- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/database/src/Commands/Ast/ModelUpdateVisitor.php b/src/database/src/Commands/Ast/ModelUpdateVisitor.php index 37ce0861e..bfe36d908 100644 --- a/src/database/src/Commands/Ast/ModelUpdateVisitor.php +++ b/src/database/src/Commands/Ast/ModelUpdateVisitor.php @@ -15,6 +15,7 @@ namespace Hyperf\Database\Commands\Ast; use Hyperf\Database\Commands\ModelOption; use PhpParser\Comment\Doc; use PhpParser\Node; +use PhpParser\Node\Identifier; use PhpParser\NodeVisitorAbstract; class ModelUpdateVisitor extends NodeVisitorAbstract @@ -29,10 +30,16 @@ class ModelUpdateVisitor extends NodeVisitorAbstract */ protected $option; - public function __construct($columns = [], ModelOption $option) + /** + * @var string + */ + protected $class = ''; + + public function __construct($columns = [], ModelOption $option, $class) { $this->columns = $columns; $this->option = $option; + $this->class = $class; } public function leaveNode(Node $node) @@ -47,6 +54,12 @@ class ModelUpdateVisitor extends NodeVisitorAbstract return $node; case $node instanceof Node\Stmt\Class_: + //更改模型继承的父类名; + $inheritance = $this->option->getInheritance(); + if(is_object($node->extends) && !empty($inheritance)) { + $node->extends->parts = [$inheritance]; + } + $doc = '/**' . PHP_EOL; foreach ($this->columns as $column) { [$name, $type, $comment] = $this->getProperty($column); @@ -55,6 +68,28 @@ class ModelUpdateVisitor extends NodeVisitorAbstract $doc .= ' */'; $node->setDocComment(new Doc($doc)); return $node; + case $node instanceof Node\Stmt\UseUse: //更改模型父类的use路径; + $modelParent = get_parent_class($this->class); + + $class = end($node->name->parts); + $alias = is_object($node->alias) ? $node->alias->name : ''; + if ($class == $modelParent || $alias = $modelParent) { + preg_match_all('/\s*([a-z0-9\\\\]+)(as)?([a-z0-9]+)?;?\s*/is', $this->option->getUses(), $match); + if(!empty($match) && isset($match[1][0])) { + $newClass = $match[1][0]; + $newAlias = $match[1][2] ?? ''; + + $node->name->parts = explode('\\', $newClass); + $node->alias = null; + + if(!empty($newAlias)) { + $node->alias = new Identifier($newAlias); + $node->alias->setAttribute('startLine', $node->getAttribute('startLine')); + $node->alias->setAttribute('endLine', $node->getAttribute('endLine')); + } + } + } + return $node; } } diff --git a/src/database/src/Commands/ModelCommand.php b/src/database/src/Commands/ModelCommand.php index c270c798a..1594df9f3 100644 --- a/src/database/src/Commands/ModelCommand.php +++ b/src/database/src/Commands/ModelCommand.php @@ -172,8 +172,8 @@ class ModelCommand extends Command if (! is_dir($dir)) { @mkdir($dir, 0755, true); } + file_put_contents($path, $this->buildClass($table, $class, $option)); } - file_put_contents($path, $this->buildClass($table, $class, $option)); $columns = $this->getColumns($class, $columns, $option->isForceCasts()); @@ -182,6 +182,7 @@ class ModelCommand extends Command $visitor = make(ModelUpdateVisitor::class, [ 'columns' => $columns, 'option' => $option, + 'class' => $class, ]); $traverser->addVisitor($visitor); $traverser->addVisitor(make(ModelRewriteConnectionVisitor::class, [$class, $option->getPool()])); From 5b208b484792a5c149b3966468a487c0d5e77339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 11 Feb 2020 16:19:51 +0800 Subject: [PATCH 4/6] Added custom visitors for `gen:model`. --- .../Ast/ModelRewriteInheritanceVisitor.php | 72 +++++++++++++++++++ .../src/Commands/Ast/ModelUpdateVisitor.php | 33 +-------- src/database/src/Commands/ModelCommand.php | 16 +++-- src/database/src/Commands/ModelData.php | 48 +++++++++++++ src/database/src/Commands/ModelOption.php | 36 +++++++--- src/database/src/Schema/Blueprint.php | 2 +- .../src/Schema/ForeignKeyDefinition.php | 4 +- 7 files changed, 161 insertions(+), 50 deletions(-) create mode 100644 src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php create mode 100644 src/database/src/Commands/ModelData.php diff --git a/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php b/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php new file mode 100644 index 000000000..787928a2c --- /dev/null +++ b/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php @@ -0,0 +1,72 @@ +option = $option; + $this->data = $data; + } + + public function leaveNode(Node $node) + { + switch ($node) { + case $node instanceof Node\Stmt\Class_: + $inheritance = $this->option->getInheritance(); + if (is_object($node->extends) && ! empty($inheritance)) { + $node->extends->parts = [$inheritance]; + } + return $node; + case $node instanceof Node\Stmt\UseUse: + $modelParent = get_parent_class($this->data->getClass()); + + $class = end($node->name->parts); + $alias = is_object($node->alias) ? $node->alias->name : ''; + if ($class == $modelParent || $alias == $modelParent) { + preg_match_all('/\s*([a-z0-9\\\\]+)(as)?([a-z0-9]+)?;?\s*/is', $this->option->getUses(), $match); + if (! empty($match) && isset($match[1][0])) { + $newClass = $match[1][0]; + $newAlias = $match[1][2] ?? ''; + + $node->name->parts = explode('\\', $newClass); + $node->alias = null; + + if (! empty($newAlias)) { + $node->alias = new Identifier($newAlias); + $node->alias->setAttribute('startLine', $node->getAttribute('startLine')); + $node->alias->setAttribute('endLine', $node->getAttribute('endLine')); + } + } + } + return $node; + } + } +} diff --git a/src/database/src/Commands/Ast/ModelUpdateVisitor.php b/src/database/src/Commands/Ast/ModelUpdateVisitor.php index bfe36d908..a2a9aff52 100644 --- a/src/database/src/Commands/Ast/ModelUpdateVisitor.php +++ b/src/database/src/Commands/Ast/ModelUpdateVisitor.php @@ -15,7 +15,6 @@ namespace Hyperf\Database\Commands\Ast; use Hyperf\Database\Commands\ModelOption; use PhpParser\Comment\Doc; use PhpParser\Node; -use PhpParser\Node\Identifier; use PhpParser\NodeVisitorAbstract; class ModelUpdateVisitor extends NodeVisitorAbstract @@ -30,16 +29,10 @@ class ModelUpdateVisitor extends NodeVisitorAbstract */ protected $option; - /** - * @var string - */ - protected $class = ''; - - public function __construct($columns = [], ModelOption $option, $class) + public function __construct($columns = [], ModelOption $option) { $this->columns = $columns; $this->option = $option; - $this->class = $class; } public function leaveNode(Node $node) @@ -56,7 +49,7 @@ class ModelUpdateVisitor extends NodeVisitorAbstract case $node instanceof Node\Stmt\Class_: //更改模型继承的父类名; $inheritance = $this->option->getInheritance(); - if(is_object($node->extends) && !empty($inheritance)) { + if (is_object($node->extends) && ! empty($inheritance)) { $node->extends->parts = [$inheritance]; } @@ -68,28 +61,6 @@ class ModelUpdateVisitor extends NodeVisitorAbstract $doc .= ' */'; $node->setDocComment(new Doc($doc)); return $node; - case $node instanceof Node\Stmt\UseUse: //更改模型父类的use路径; - $modelParent = get_parent_class($this->class); - - $class = end($node->name->parts); - $alias = is_object($node->alias) ? $node->alias->name : ''; - if ($class == $modelParent || $alias = $modelParent) { - preg_match_all('/\s*([a-z0-9\\\\]+)(as)?([a-z0-9]+)?;?\s*/is', $this->option->getUses(), $match); - if(!empty($match) && isset($match[1][0])) { - $newClass = $match[1][0]; - $newAlias = $match[1][2] ?? ''; - - $node->name->parts = explode('\\', $newClass); - $node->alias = null; - - if(!empty($newAlias)) { - $node->alias = new Identifier($newAlias); - $node->alias->setAttribute('startLine', $node->getAttribute('startLine')); - $node->alias->setAttribute('endLine', $node->getAttribute('endLine')); - } - } - } - return $node; } } diff --git a/src/database/src/Commands/ModelCommand.php b/src/database/src/Commands/ModelCommand.php index 1594df9f3..b88094768 100644 --- a/src/database/src/Commands/ModelCommand.php +++ b/src/database/src/Commands/ModelCommand.php @@ -98,7 +98,8 @@ class ModelCommand extends Command ->setRefreshFillable($this->getOption('refresh-fillable', 'commands.gen:model.refresh_fillable', $pool, false)) ->setTableMapping($this->getOption('table-mapping', 'commands.gen:model.table_mapping', $pool, [])) ->setIgnoreTables($this->getOption('ignore-tables', 'commands.gen:model.ignore_tables', $pool, [])) - ->setWithComments($this->getOption('with-comments', 'commands.gen:model.with_comments', $pool, false)); + ->setWithComments($this->getOption('with-comments', 'commands.gen:model.with_comments', $pool, false)) + ->setVisitors($this->getOption('visitors', 'commands.gen:model.visitors', $pool, [])); if ($table) { $this->createModel($table, $option); @@ -121,6 +122,7 @@ class ModelCommand extends Command $this->addOption('table-mapping', 'M', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Table mappings for model.'); $this->addOption('ignore-tables', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Ignore tables for creating models.'); $this->addOption('with-comments', null, InputOption::VALUE_NONE, 'Whether generate the property comments for model.'); + $this->addOption('visitors', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Custom visitors for ast traverser.'); } protected function getSchemaBuilder(string $poolName): MySqlBuilder @@ -179,13 +181,15 @@ class ModelCommand extends Command $stms = $this->astParser->parse(file_get_contents($path)); $traverser = new NodeTraverser(); - $visitor = make(ModelUpdateVisitor::class, [ + $traverser->addVisitor(make(ModelUpdateVisitor::class, [ 'columns' => $columns, 'option' => $option, - 'class' => $class, - ]); - $traverser->addVisitor($visitor); + ])); $traverser->addVisitor(make(ModelRewriteConnectionVisitor::class, [$class, $option->getPool()])); + foreach ($option->getVisitors() as $visitorClass) { + $data = make(ModelData::class)->setClass($class)->setColumns($columns); + $traverser->addVisitor(make($visitorClass, [$option, $data])); + } $stms = $traverser->traverse($stms); $code = $this->printer->prettyPrintFile($stms); @@ -233,7 +237,7 @@ class ModelCommand extends Command if (in_array($name, ['force-casts', 'refresh-fillable', 'with-comments'])) { $nonInput = false; } - if (in_array($name, ['table-mapping', 'ignore-tables'])) { + if (in_array($name, ['table-mapping', 'ignore-tables', 'visitors'])) { $nonInput = []; } diff --git a/src/database/src/Commands/ModelData.php b/src/database/src/Commands/ModelData.php new file mode 100644 index 000000000..b46b84439 --- /dev/null +++ b/src/database/src/Commands/ModelData.php @@ -0,0 +1,48 @@ +columns; + } + + public function setColumns(array $columns): self + { + $this->columns = $columns; + return $this; + } + + public function getClass(): string + { + return $this->class; + } + + public function setClass(string $class): self + { + $this->class = $class; + return $this; + } +} diff --git a/src/database/src/Commands/ModelOption.php b/src/database/src/Commands/ModelOption.php index 556f70433..af0186da4 100644 --- a/src/database/src/Commands/ModelOption.php +++ b/src/database/src/Commands/ModelOption.php @@ -64,12 +64,17 @@ class ModelOption */ protected $ignoreTables = []; + /** + * @var array + */ + protected $visitors = []; + public function getPool(): string { return $this->pool; } - public function setPool(string $pool): ModelOption + public function setPool(string $pool): self { $this->pool = $pool; return $this; @@ -80,7 +85,7 @@ class ModelOption return $this->path; } - public function setPath(string $path): ModelOption + public function setPath(string $path): self { $this->path = $path; return $this; @@ -91,7 +96,7 @@ class ModelOption return $this->forceCasts; } - public function setForceCasts(bool $forceCasts): ModelOption + public function setForceCasts(bool $forceCasts): self { $this->forceCasts = $forceCasts; return $this; @@ -102,7 +107,7 @@ class ModelOption return $this->prefix; } - public function setPrefix(string $prefix): ModelOption + public function setPrefix(string $prefix): self { $this->prefix = $prefix; return $this; @@ -113,7 +118,7 @@ class ModelOption return $this->inheritance; } - public function setInheritance(string $inheritance): ModelOption + public function setInheritance(string $inheritance): self { $this->inheritance = $inheritance; return $this; @@ -124,7 +129,7 @@ class ModelOption return $this->uses; } - public function setUses(string $uses): ModelOption + public function setUses(string $uses): self { $this->uses = $uses; return $this; @@ -135,7 +140,7 @@ class ModelOption return $this->refreshFillable; } - public function setRefreshFillable(bool $refreshFillable): ModelOption + public function setRefreshFillable(bool $refreshFillable): self { $this->refreshFillable = $refreshFillable; return $this; @@ -146,7 +151,7 @@ class ModelOption return $this->tableMapping; } - public function setTableMapping(array $tableMapping): ModelOption + public function setTableMapping(array $tableMapping): self { foreach ($tableMapping as $item) { [$key, $name] = explode(':', $item); @@ -161,7 +166,7 @@ class ModelOption return $this->ignoreTables; } - public function setIgnoreTables(array $ignoreTables): ModelOption + public function setIgnoreTables(array $ignoreTables): self { $this->ignoreTables = $ignoreTables; return $this; @@ -172,9 +177,20 @@ class ModelOption return $this->withComments; } - public function setWithComments(bool $withComments): ModelOption + public function setWithComments(bool $withComments): self { $this->withComments = $withComments; return $this; } + + public function getVisitors(): array + { + return $this->visitors; + } + + public function setVisitors(array $visitors): self + { + $this->visitors = $visitors; + return $this; + } } diff --git a/src/database/src/Schema/Blueprint.php b/src/database/src/Schema/Blueprint.php index 50f23212a..d80dcdec7 100755 --- a/src/database/src/Schema/Blueprint.php +++ b/src/database/src/Schema/Blueprint.php @@ -408,7 +408,7 @@ class Blueprint * * @param array|string $columns * @param string $name - * @return \Hyperf\Utils\Fluent|\Hyperf\Database\Schema\ForeignKeyDefinition + * @return \Hyperf\Database\Schema\ForeignKeyDefinition|\Hyperf\Utils\Fluent */ public function foreign($columns, $name = null) { diff --git a/src/database/src/Schema/ForeignKeyDefinition.php b/src/database/src/Schema/ForeignKeyDefinition.php index 5ef1eb20e..c28d81a4f 100644 --- a/src/database/src/Schema/ForeignKeyDefinition.php +++ b/src/database/src/Schema/ForeignKeyDefinition.php @@ -15,7 +15,7 @@ namespace Hyperf\Database\Schema; use Hyperf\Utils\Fluent; /** - * @method ForeignKeyDefinition references(string|array $columns) Specify the referenced column(s) + * @method ForeignKeyDefinition references(array|string $columns) Specify the referenced column(s) * @method ForeignKeyDefinition on(string $table) Specify the referenced table * @method ForeignKeyDefinition onDelete(string $action) Add an ON DELETE action * @method ForeignKeyDefinition onUpdate(string $action) Add an ON UPDATE action @@ -24,4 +24,4 @@ use Hyperf\Utils\Fluent; */ class ForeignKeyDefinition extends Fluent { -} \ No newline at end of file +} From ed5e2e7f5480256050f34f88e99ceef9b23e158b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 11 Feb 2020 17:31:43 +0800 Subject: [PATCH 5/6] Optimized code. --- .../Ast/ModelRewriteInheritanceVisitor.php | 67 ++++++++++++++----- .../src/Commands/Ast/ModelUpdateVisitor.php | 6 -- 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php b/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php index 787928a2c..855a54b77 100644 --- a/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php +++ b/src/database/src/Commands/Ast/ModelRewriteInheritanceVisitor.php @@ -30,10 +30,51 @@ class ModelRewriteInheritanceVisitor extends NodeVisitorAbstract */ protected $data; + /** + * @var null|string + */ + protected $parentClass; + + /** + * @var bool + */ + protected $shouldAddUseUse = true; + public function __construct(ModelOption $option, ModelData $data) { $this->option = $option; $this->data = $data; + + if (! empty($option->getUses())) { + preg_match_all('/\s*([a-z0-9\\\\]+)(as)?([a-z0-9]+)?;?\s*/is', $option->getUses(), $match); + if (isset($match[1][0])) { + $this->parentClass = $match[1][0]; + } + } + } + + public function afterTraverse(array $nodes) + { + if (empty($this->option->getUses())) { + return null; + } + + $use = new Node\Stmt\UseUse( + new Node\Name($this->parentClass), + $this->option->getInheritance() + ); + + foreach ($nodes as $namespace) { + if (! $namespace instanceof Node\Stmt\Namespace_) { + continue; + } + + if ($this->shouldAddUseUse) { + array_unshift($namespace->stmts, new Node\Stmt\Use_([$use])); + } + } + + return null; } public function leaveNode(Node $node) @@ -46,24 +87,14 @@ class ModelRewriteInheritanceVisitor extends NodeVisitorAbstract } return $node; case $node instanceof Node\Stmt\UseUse: - $modelParent = get_parent_class($this->data->getClass()); - - $class = end($node->name->parts); - $alias = is_object($node->alias) ? $node->alias->name : ''; - if ($class == $modelParent || $alias == $modelParent) { - preg_match_all('/\s*([a-z0-9\\\\]+)(as)?([a-z0-9]+)?;?\s*/is', $this->option->getUses(), $match); - if (! empty($match) && isset($match[1][0])) { - $newClass = $match[1][0]; - $newAlias = $match[1][2] ?? ''; - - $node->name->parts = explode('\\', $newClass); - $node->alias = null; - - if (! empty($newAlias)) { - $node->alias = new Identifier($newAlias); - $node->alias->setAttribute('startLine', $node->getAttribute('startLine')); - $node->alias->setAttribute('endLine', $node->getAttribute('endLine')); - } + $class = implode('\\', $node->name->parts); + $alias = is_object($node->alias) ? $node->alias->name : null; + if ($class == $this->parentClass) { + // The parent class is exists. + $this->shouldAddUseUse = false; + if (end($node->name->parts) !== $this->option->getInheritance() && $alias !== $this->option->getInheritance()) { + // Rewrite the alias, if the class is not equal with inheritance. + $node->alias = new Identifier($this->option->getInheritance()); } } return $node; diff --git a/src/database/src/Commands/Ast/ModelUpdateVisitor.php b/src/database/src/Commands/Ast/ModelUpdateVisitor.php index a2a9aff52..37ce0861e 100644 --- a/src/database/src/Commands/Ast/ModelUpdateVisitor.php +++ b/src/database/src/Commands/Ast/ModelUpdateVisitor.php @@ -47,12 +47,6 @@ class ModelUpdateVisitor extends NodeVisitorAbstract return $node; case $node instanceof Node\Stmt\Class_: - //更改模型继承的父类名; - $inheritance = $this->option->getInheritance(); - if (is_object($node->extends) && ! empty($inheritance)) { - $node->extends->parts = [$inheritance]; - } - $doc = '/**' . PHP_EOL; foreach ($this->columns as $column) { [$name, $type, $comment] = $this->getProperty($column); From a5cd1416b0f3d41f20d089f59b8c2f4748f05ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 12 Feb 2020 09:19:04 +0800 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3e0433d1..d40e71753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Added +- [#1328](https://github.com/hyperf/hyperf/pull/1328) Added `ModelRewriteInheritanceVisitor` to rewrite the model inheritance for command `gen:model`. - [#1331](https://github.com/hyperf/hyperf/pull/1331) Added `Hyperf\LoadBalancer\LoadBalancerInterface::getNodes()`. ## Changed