Skip to content

Commit

Permalink
Merge branch 'hotfix/2.3.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
cerbero90 committed Jan 14, 2025
2 parents cd28c0c + ff00515 commit 0786fe6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 16 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
- Nothing


## 2.3.0 - 2024-12-22
## 2.3.1 - 2025-01-15

### Changed
- Removed unneeded readonly modifiers


## 2.3.0 - 2025-01-12

### Added
- Enums discoverability
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ BackedEnum::Two->color(); // green
```

> [!TIP]
> Our IDE can autocomplete meta methods thanks to the [`annotate` command](#-annotate).
> Our IDE can autocomplete meta methods thanks to the [`annotate` command](#%EF%B8%8F-annotate).
`#[Meta]` attributes can also be attached to the enum itself to provide default values when a case does not declare its own meta values:

Expand Down Expand Up @@ -319,7 +319,7 @@ BackedEnum::One(); // 1
```

> [!TIP]
> Our IDE can autocomplete cases static methods thanks to the [`annotate` command](#-annotate).
> Our IDE can autocomplete cases static methods thanks to the [`annotate` command](#%EF%B8%8F-annotate).
We can also obtain the name or value of a case by simply invoking it:

Expand All @@ -340,7 +340,7 @@ BackedEnum::One->shape(); // 'triangle'
```

> [!TIP]
> Our IDE can autocomplete meta methods thanks to the [`annotate` command](#-annotate).
> Our IDE can autocomplete meta methods thanks to the [`annotate` command](#%EF%B8%8F-annotate).
Depending on our needs, we can customize the default behavior of all enums in our application when invoking a case or calling inaccessible methods:

Expand Down Expand Up @@ -500,7 +500,7 @@ php artisan enum:make App/Enums/Enum CaseOne CaseTwo --force
php artisan enum:make App/Enums/Enum CaseOne CaseTwo -f
```

Finally, we can generate the TypeScript counterpart of the newly created enum by adding the `--typescript` option:
We can generate the TypeScript counterpart of the newly created enum by adding the `--typescript` option:

```bash
php artisan enum:make App/Enums/Enum CaseOne CaseTwo --typescript
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Annotator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class Annotator
*
* @var Inspector<TEnum>
*/
protected readonly Inspector $inspector;
protected Inspector $inspector;

/**
* Instantiate the class.
*
* @param class-string<TEnum> $enum
* @throws InvalidArgumentException
*/
public function __construct(protected readonly string $enum)
public function __construct(protected string $enum)
{
$this->inspector = new Inspector($enum);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Services/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Generator
/**
* The enum being generated.
*/
protected readonly GeneratingEnum $enum;
protected GeneratingEnum $enum;

/**
* Instantiate the class.
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Inspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Inspector
*
* @var ReflectionEnum<TEnum>
*/
protected readonly ReflectionEnum $reflection;
protected ReflectionEnum $reflection;

/**
* The method annotations.
Expand All @@ -49,7 +49,7 @@ class Inspector
*
* @param class-string<TEnum> $enum
*/
public function __construct(protected readonly string $enum)
public function __construct(protected string $enum)
{
$this->reflection = new ReflectionEnum($enum);

Expand Down
4 changes: 2 additions & 2 deletions src/Services/MethodAnnotations.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class MethodAnnotations implements IteratorAggregate
* @param Inspector<UnitEnum> $inspector
*/
public function __construct(
protected readonly Inspector $inspector,
protected readonly bool $includeExisting,
protected Inspector $inspector,
protected bool $includeExisting,
) {}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Services/TypeScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class TypeScript
/**
* The TypeScript enums path.
*/
protected readonly string $path;
protected string $path;

/**
* Instantiate the class.
*
* @param class-string<UnitEnum> $enum
*/
public function __construct(protected readonly string $enum)
public function __construct(protected string $enum)
{
$this->path = Enums::basePath(Enums::typeScript($enum));
}
Expand Down
4 changes: 2 additions & 2 deletions src/Services/UseStatements.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class UseStatements implements IteratorAggregate
* @param Inspector<\UnitEnum> $inspector
*/
public function __construct(
protected readonly Inspector $inspector,
protected readonly bool $includeExisting,
protected Inspector $inspector,
protected bool $includeExisting,
) {}

/**
Expand Down

0 comments on commit 0786fe6

Please sign in to comment.