Skip to content

Commit 06fa86d

Browse files
committed
Merge branch 'hotfix/2.3.1'
2 parents 0ae4b74 + ff00515 commit 06fa86d

File tree

8 files changed

+22
-16
lines changed

8 files changed

+22
-16
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
2626
- Nothing
2727

2828

29-
## 2.3.0 - 2024-12-22
29+
## 2.3.1 - 2025-01-15
30+
31+
### Changed
32+
- Removed unneeded readonly modifiers
33+
34+
35+
## 2.3.0 - 2025-01-12
3036

3137
### Added
3238
- Enums discoverability

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ BackedEnum::Two->color(); // green
149149
```
150150

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

@@ -319,7 +319,7 @@ BackedEnum::One(); // 1
319319
```
320320

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

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

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

@@ -500,7 +500,7 @@ php artisan enum:make App/Enums/Enum CaseOne CaseTwo --force
500500
php artisan enum:make App/Enums/Enum CaseOne CaseTwo -f
501501
```
502502

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

505505
```bash
506506
php artisan enum:make App/Enums/Enum CaseOne CaseTwo --typescript

src/Services/Annotator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ class Annotator
4242
*
4343
* @var Inspector<TEnum>
4444
*/
45-
protected readonly Inspector $inspector;
45+
protected Inspector $inspector;
4646

4747
/**
4848
* Instantiate the class.
4949
*
5050
* @param class-string<TEnum> $enum
5151
* @throws InvalidArgumentException
5252
*/
53-
public function __construct(protected readonly string $enum)
53+
public function __construct(protected string $enum)
5454
{
5555
$this->inspector = new Inspector($enum);
5656
}

src/Services/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Generator
1717
/**
1818
* The enum being generated.
1919
*/
20-
protected readonly GeneratingEnum $enum;
20+
protected GeneratingEnum $enum;
2121

2222
/**
2323
* Instantiate the class.

src/Services/Inspector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Inspector
2828
*
2929
* @var ReflectionEnum<TEnum>
3030
*/
31-
protected readonly ReflectionEnum $reflection;
31+
protected ReflectionEnum $reflection;
3232

3333
/**
3434
* The method annotations.
@@ -49,7 +49,7 @@ class Inspector
4949
*
5050
* @param class-string<TEnum> $enum
5151
*/
52-
public function __construct(protected readonly string $enum)
52+
public function __construct(protected string $enum)
5353
{
5454
$this->reflection = new ReflectionEnum($enum);
5555

src/Services/MethodAnnotations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class MethodAnnotations implements IteratorAggregate
3232
* @param Inspector<UnitEnum> $inspector
3333
*/
3434
public function __construct(
35-
protected readonly Inspector $inspector,
36-
protected readonly bool $includeExisting,
35+
protected Inspector $inspector,
36+
protected bool $includeExisting,
3737
) {}
3838

3939
/**

src/Services/TypeScript.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ class TypeScript
1818
/**
1919
* The TypeScript enums path.
2020
*/
21-
protected readonly string $path;
21+
protected string $path;
2222

2323
/**
2424
* Instantiate the class.
2525
*
2626
* @param class-string<UnitEnum> $enum
2727
*/
28-
public function __construct(protected readonly string $enum)
28+
public function __construct(protected string $enum)
2929
{
3030
$this->path = Enums::basePath(Enums::typeScript($enum));
3131
}

src/Services/UseStatements.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class UseStatements implements IteratorAggregate
3131
* @param Inspector<\UnitEnum> $inspector
3232
*/
3333
public function __construct(
34-
protected readonly Inspector $inspector,
35-
protected readonly bool $includeExisting,
34+
protected Inspector $inspector,
35+
protected bool $includeExisting,
3636
) {}
3737

3838
/**

0 commit comments

Comments
 (0)