diff --git a/src/database/src/Commands/Migrations/InstallCommand.php b/src/database/src/Commands/Migrations/InstallCommand.php index 9c39e4f7e..d0a49b16a 100755 --- a/src/database/src/Commands/Migrations/InstallCommand.php +++ b/src/database/src/Commands/Migrations/InstallCommand.php @@ -40,8 +40,6 @@ class InstallCommand extends BaseCommand /** * Create a new migration install command instance. - * - * @param MigrationRepositoryInterface $repository */ public function __construct(MigrationRepositoryInterface $repository) { diff --git a/src/database/src/Commands/Migrations/MigrateCommand.php b/src/database/src/Commands/Migrations/MigrateCommand.php index 20cdfca19..124e97035 100755 --- a/src/database/src/Commands/Migrations/MigrateCommand.php +++ b/src/database/src/Commands/Migrations/MigrateCommand.php @@ -38,8 +38,6 @@ class MigrateCommand extends BaseCommand /** * Create a new migration command instance. - * - * @param \Hyperf\Database\Migrations\Migrator $migrator */ public function __construct(Migrator $migrator) { diff --git a/src/database/src/Commands/Migrations/StatusCommand.php b/src/database/src/Commands/Migrations/StatusCommand.php index 49a03a143..073e8e324 100644 --- a/src/database/src/Commands/Migrations/StatusCommand.php +++ b/src/database/src/Commands/Migrations/StatusCommand.php @@ -74,8 +74,6 @@ class StatusCommand extends BaseCommand /** * Get the status for the given ran migrations. * - * @param array $ran - * @param array $batches * @return \Hyperf\Utils\Collection */ protected function getStatusFor(array $ran, array $batches) diff --git a/src/database/src/Commands/Seeders/GenSeederCommand.php b/src/database/src/Commands/Seeders/GenSeederCommand.php index 1939cfb40..df99015d5 100644 --- a/src/database/src/Commands/Seeders/GenSeederCommand.php +++ b/src/database/src/Commands/Seeders/GenSeederCommand.php @@ -28,8 +28,6 @@ class GenSeederCommand extends BaseCommand /** * Create a new seeder generator command instance. - * - * @param \Hyperf\Database\Seeders\SeederCreator $creator */ public function __construct(SeederCreator $creator) { @@ -51,8 +49,6 @@ class GenSeederCommand extends BaseCommand /** * Write the seeder file to disk. - * - * @param string $name */ protected function writeMigration(string $name) { diff --git a/src/database/src/Commands/Seeders/SeedCommand.php b/src/database/src/Commands/Seeders/SeedCommand.php index d53dbf029..a9c10cd21 100644 --- a/src/database/src/Commands/Seeders/SeedCommand.php +++ b/src/database/src/Commands/Seeders/SeedCommand.php @@ -43,8 +43,6 @@ class SeedCommand extends BaseCommand /** * Create a new seed command instance. - * - * @param \Hyperf\Database\Seeders\Seed $seed */ public function __construct(Seed $seed) { diff --git a/src/database/src/Connection.php b/src/database/src/Connection.php index 3fcb47d2f..d633b9fbf 100755 --- a/src/database/src/Connection.php +++ b/src/database/src/Connection.php @@ -537,6 +537,14 @@ class Connection implements ConnectionInterface } } + /** + * Reset `recordsModified` to false. + */ + public function resetRecordsModified(): void + { + $this->recordsModified = false; + } + /** * Is Doctrine available? * diff --git a/src/database/src/Migrations/MigrationCreator.php b/src/database/src/Migrations/MigrationCreator.php index 0c8410d8a..91f3b7ab7 100755 --- a/src/database/src/Migrations/MigrationCreator.php +++ b/src/database/src/Migrations/MigrationCreator.php @@ -35,8 +35,6 @@ class MigrationCreator /** * Create a new migration creator instance. - * - * @param Filesystem $files */ public function __construct(Filesystem $files) { diff --git a/src/database/src/Model/Model.php b/src/database/src/Model/Model.php index 58ab034b0..d9e098932 100644 --- a/src/database/src/Model/Model.php +++ b/src/database/src/Model/Model.php @@ -502,8 +502,6 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab /** * Save the model to the database. - * - * @return bool */ public function save(array $options = []): bool { diff --git a/src/database/src/Seeders/Seed.php b/src/database/src/Seeders/Seed.php index 7d8b02e62..260d4596c 100644 --- a/src/database/src/Seeders/Seed.php +++ b/src/database/src/Seeders/Seed.php @@ -60,9 +60,6 @@ class Seed /** * Create a new seed instance. - * - * @param \Hyperf\Database\ConnectionResolverInterface $resolver - * @param \Hyperf\Utils\Filesystem\Filesystem $files */ public function __construct(Resolver $resolver, Filesystem $files) { @@ -74,7 +71,6 @@ class Seed * Run the pending seeders at a given path. * * @param array|string $paths - * @param array $options * @return array */ public function run($paths = [], array $options = []) @@ -90,8 +86,6 @@ class Seed /** * Set the default connection name. - * - * @param string $name */ public function setConnection(string $name): void { @@ -104,9 +98,6 @@ class Seed /** * Run an array of seeders. - * - * @param array $seeders - * @param array $options */ public function runSeeders(array $seeders, array $options = []) { @@ -155,10 +146,6 @@ class Seed /** * Resolve a seeder instance from a file. - * - * @param string $file - * - * @return object */ public function resolve(string $file): object { @@ -170,8 +157,6 @@ class Seed /** * Resolve the database connection instance. * - * @param string $connection - * * @return Connection */ public function resolveConnection(string $connection) @@ -209,8 +194,6 @@ class Seed /** * Require in all the seeder files in a given path. - * - * @param array $files */ public function requireFiles(array $files) { @@ -222,7 +205,6 @@ class Seed /** * Set the output implementation that should be used by the console. * - * @param OutputInterface $output * @return $this */ public function setOutput(OutputInterface $output) @@ -236,8 +218,6 @@ class Seed * Get the schema grammar out of a migration connection. * * @param Connection $connection - * - * @return \Hyperf\Database\Schema\Grammars\Grammar */ protected function getSchemaGrammar($connection): Grammar { diff --git a/src/database/src/Seeders/SeederCreator.php b/src/database/src/Seeders/SeederCreator.php index 7982657aa..20c54b80d 100644 --- a/src/database/src/Seeders/SeederCreator.php +++ b/src/database/src/Seeders/SeederCreator.php @@ -27,8 +27,6 @@ class SeederCreator /** * Create a new seeder creator instance. - * - * @param Filesystem $files */ public function __construct(Filesystem $files) { diff --git a/src/db-connection/src/Connection.php b/src/db-connection/src/Connection.php index c60aa8202..2670d9e66 100644 --- a/src/db-connection/src/Connection.php +++ b/src/db-connection/src/Connection.php @@ -115,10 +115,16 @@ class Connection extends BaseConnection implements ConnectionInterface, DbConnec public function release(): void { + if ($this->connection instanceof \Hyperf\Database\Connection) { + // Reset `recordsModified` to false before conneciont release into pool. + $this->connection->resetRecordsModified(); + } + if ($this->isTransaction()) { $this->rollBack(0); $this->logger->error('Maybe you\'ve forgotten to commit or rollback the MySQL transaction.'); } + parent::release(); }