Skip to content
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

[12.x] use promoted properties for Database events #53848

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions src/Illuminate/Database/Events/DatabaseBusy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,15 @@

class DatabaseBusy
{
/**
* The database connection name.
*
* @var string
*/
public $connectionName;

/**
* The number of open connections.
*
* @var int
*/
public $connections;

/**
* Create a new event instance.
*
* @param string $connectionName
* @param int $connections
* @param string $connectionName The database connection name.
* @param int $connections The number of open connections.
*/
public function __construct($connectionName, $connections)
{
$this->connectionName = $connectionName;
$this->connections = $connections;
public function __construct(
public $connectionName,
public $connections,
) {
}
}
1 change: 0 additions & 1 deletion src/Illuminate/Database/Events/DatabaseRefreshed.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ public function __construct(
public ?string $database = null,
public bool $seeding = false,
) {
//
}
}
15 changes: 4 additions & 11 deletions src/Illuminate/Database/Events/MigrationsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,14 @@

abstract class MigrationsEvent implements MigrationEventContract
{
/**
* The migration method that was invoked.
*
* @var string
*/
public $method;

/**
* Create a new event instance.
*
* @param string $method
* @param string $method The migration method that was invoked.
* @return void
*/
public function __construct($method)
{
$this->method = $method;
public function __construct(
public $method,
) {
}
}
15 changes: 4 additions & 11 deletions src/Illuminate/Database/Events/ModelPruningFinished.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@

class ModelPruningFinished
{
/**
* The class names of the models that were pruned.
*
* @var array<class-string>
*/
public $models;

/**
* Create a new event instance.
*
* @param array<class-string> $models
* @param array<class-string> $models The class names of the models that were pruned.
* @return void
*/
public function __construct($models)
{
$this->models = $models;
public function __construct(
public $models,
) {
}
}
15 changes: 4 additions & 11 deletions src/Illuminate/Database/Events/ModelPruningStarting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@

class ModelPruningStarting
{
/**
* The class names of the models that will be pruned.
*
* @var array<class-string>
*/
public $models;

/**
* Create a new event instance.
*
* @param array<class-string> $models
* @param array<class-string> $models The class names of the models that will be pruned.
* @return void
*/
public function __construct($models)
{
$this->models = $models;
public function __construct(
public $models
) {
}
}
26 changes: 6 additions & 20 deletions src/Illuminate/Database/Events/ModelsPruned.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,16 @@

class ModelsPruned
{
/**
* The class name of the model that was pruned.
*
* @var string
*/
public $model;

/**
* The number of pruned records.
*
* @var int
*/
public $count;

/**
* Create a new event instance.
*
* @param string $model
* @param int $count
* @param string $model The class name of the model that was pruned.
* @param int $count The number of pruned records.
* @return void
*/
public function __construct($model, $count)
{
$this->model = $model;
$this->count = $count;
public function __construct(
public $model,
public $count,
) {
}
}
15 changes: 4 additions & 11 deletions src/Illuminate/Database/Events/NoPendingMigrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@

class NoPendingMigrations
{
/**
* The migration method that was called.
*
* @var string
*/
public $method;

/**
* Create a new event instance.
*
* @param string $method
* @param string $method The migration method that was called.
* @return void
*/
public function __construct($method)
{
$this->method = $method;
public function __construct(
public $method,
) {
}
}
26 changes: 6 additions & 20 deletions src/Illuminate/Database/Events/StatementPrepared.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,16 @@

class StatementPrepared
{
/**
* The database connection instance.
*
* @var \Illuminate\Database\Connection
*/
public $connection;

/**
* The PDO statement.
*
* @var \PDOStatement
*/
public $statement;

/**
* Create a new event instance.
*
* @param \Illuminate\Database\Connection $connection
* @param \PDOStatement $statement
* @param \Illuminate\Database\Connection $connection The database connection instance.
* @param \PDOStatement $statement The PDO statement.
* @return void
*/
public function __construct($connection, $statement)
{
$this->statement = $statement;
$this->connection = $connection;
public function __construct(
public $connection,
public $statement,
) {
}
}
Loading