Skip to content

Commit

Permalink
[5.x] Use constructor property promotion in events (#11380)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Jan 23, 2025
1 parent 7a144d5 commit 10ae91c
Show file tree
Hide file tree
Showing 124 changed files with 121 additions and 510 deletions.
9 changes: 1 addition & 8 deletions src/Events/AssetContainerBlueprintFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@

class AssetContainerBlueprintFound extends Event
{
public $blueprint;
public $container;
public $asset;

public function __construct($blueprint, $container = null, $asset = null)
public function __construct(public $blueprint, public $container = null, public $asset = null)
{
$this->blueprint = $blueprint;
$this->container = $container;
$this->asset = $asset;
}
}
5 changes: 1 addition & 4 deletions src/Events/AssetContainerCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

class AssetContainerCreated extends Event
{
public $container;

public function __construct($container)
public function __construct(public $container)
{
$this->container = $container;
}
}
5 changes: 1 addition & 4 deletions src/Events/AssetContainerCreating.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class AssetContainerCreating extends Event
{
public $container;

public function __construct($container)
public function __construct(public $container)
{
$this->container = $container;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetContainerDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetContainerDeleted extends Event implements ProvidesCommitMessage
{
public $container;

public function __construct($container)
public function __construct(public $container)
{
$this->container = $container;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetContainerDeleting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class AssetContainerDeleting extends Event
{
public $container;

public function __construct($container)
public function __construct(public $container)
{
$this->container = $container;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetContainerSaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetContainerSaved extends Event implements ProvidesCommitMessage
{
public $container;

public function __construct($container)
public function __construct(public $container)
{
$this->container = $container;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetContainerSaving.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class AssetContainerSaving extends Event
{
public $container;

public function __construct($container)
public function __construct(public $container)
{
$this->container = $container;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

class AssetCreated extends Event
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}
}
5 changes: 1 addition & 4 deletions src/Events/AssetCreating.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class AssetCreating extends Event
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetDeleted extends Event implements ProvidesCommitMessage
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetDeleting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class AssetDeleting extends Event
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetFolderDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetFolderDeleted extends Event implements ProvidesCommitMessage
{
public $folder;

public function __construct($folder)
public function __construct(public $folder)
{
$this->folder = $folder;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetFolderSaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetFolderSaved extends Event implements ProvidesCommitMessage
{
public $folder;

public function __construct($folder)
public function __construct(public $folder)
{
$this->folder = $folder;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetReferencesUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetReferencesUpdated extends Event implements ProvidesCommitMessage
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

public function commitMessage()
Expand Down
7 changes: 1 addition & 6 deletions src/Events/AssetReplaced.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

class AssetReplaced extends Event
{
public $originalAsset;
public $newAsset;

public function __construct($originalAsset, $newAsset)
public function __construct(public $originalAsset, public $newAsset)
{
$this->originalAsset = $originalAsset;
$this->newAsset = $newAsset;
}
}
5 changes: 1 addition & 4 deletions src/Events/AssetReuploaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetReuploaded extends Event implements ProvidesCommitMessage
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetSaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetSaved extends Event implements ProvidesCommitMessage
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetSaving.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class AssetSaving extends Event
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/AssetUploaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class AssetUploaded extends Event implements ProvidesCommitMessage
{
public $asset;

public function __construct($asset)
public function __construct(public $asset)
{
$this->asset = $asset;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/BlueprintCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

class BlueprintCreated extends Event
{
public $blueprint;

public function __construct($blueprint)
public function __construct(public $blueprint)
{
$this->blueprint = $blueprint;
}
}
5 changes: 1 addition & 4 deletions src/Events/BlueprintCreating.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class BlueprintCreating extends Event
{
public $blueprint;

public function __construct($blueprint)
public function __construct(public $blueprint)
{
$this->blueprint = $blueprint;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/BlueprintDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class BlueprintDeleted extends Event implements ProvidesCommitMessage
{
public $blueprint;

public function __construct($blueprint)
public function __construct(public $blueprint)
{
$this->blueprint = $blueprint;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/BlueprintDeleting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class BlueprintDeleting extends Event
{
public $blueprint;

public function __construct($blueprint)
public function __construct(public $blueprint)
{
$this->blueprint = $blueprint;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/BlueprintReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class BlueprintReset extends Event implements ProvidesCommitMessage
{
public $blueprint;

public function __construct($blueprint)
public function __construct(public $blueprint)
{
$this->blueprint = $blueprint;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/BlueprintSaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class BlueprintSaved extends Event implements ProvidesCommitMessage
{
public $blueprint;

public function __construct($blueprint)
public function __construct(public $blueprint)
{
$this->blueprint = $blueprint;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/BlueprintSaving.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class BlueprintSaving extends Event
{
public $blueprint;

public function __construct($blueprint)
public function __construct(public $blueprint)
{
$this->blueprint = $blueprint;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/CollectionCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

class CollectionCreated extends Event
{
public $collection;

public function __construct($collection)
public function __construct(public $collection)
{
$this->collection = $collection;
}
}
5 changes: 1 addition & 4 deletions src/Events/CollectionCreating.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class CollectionCreating extends Event
{
public $collection;

public function __construct($collection)
public function __construct(public $collection)
{
$this->collection = $collection;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/Events/CollectionDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

class CollectionDeleted extends Event implements ProvidesCommitMessage
{
public $collection;

public function __construct($collection)
public function __construct(public $collection)
{
$this->collection = $collection;
}

public function commitMessage()
Expand Down
5 changes: 1 addition & 4 deletions src/Events/CollectionDeleting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

class CollectionDeleting extends Event
{
public $collection;

public function __construct($collection)
public function __construct(public $collection)
{
$this->collection = $collection;
}

/**
Expand Down
Loading

0 comments on commit 10ae91c

Please sign in to comment.