Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Let's modernise this.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbillion committed Jul 10, 2024
1 parent 8e12a89 commit 3ec50c6
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions lib/class-hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,15 @@
use phpDocumentor\Reflection\DocBlock;
use phpDocumentor\Reflection\Location;

class Hook {
private string $name;

private ?DocBlock $docBlock;

private string $type;

private array $args;

private Location $location;

private Location $endLocation;

final readonly class Hook {
public function __construct(
string $name,
?DocBlock $docBlock,
string $type,
array $args,
Location $location,
Location $endLocation
) {
$this->name = $name;
$this->docBlock = $docBlock;
$this->type = $type;
$this->args = $args;
$this->location = $location;
$this->endLocation = $endLocation;
}
private string $name,
private ?DocBlock $docBlock,
private string $type,
private array $args,
private Location $location,
private Location $endLocation,
) {}

public function getName(): string {
return $this->name;
Expand Down

0 comments on commit 3ec50c6

Please sign in to comment.