Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit b8a572a

Browse files
committed
♻️ Refactor objects constructor
1 parent 7ad3d62 commit b8a572a

7 files changed

+7
-28
lines changed

src/BoolValue.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class BoolValue implements BoolType
1111
{
1212
use AsBool;
1313

14-
public function __construct(protected bool $value)
15-
{
16-
$this->value = $value;
17-
}
14+
public function __construct(protected bool $value) {}
1815

1916
public function get(): bool
2017
{

src/FloatValue.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class FloatValue implements FloatType
1111
{
1212
use AsFloat;
1313

14-
public function __construct(protected float $value)
15-
{
16-
$this->value = $value;
17-
}
14+
public function __construct(protected float $value) {}
1815

1916
public function get(): float
2017
{

src/IntValue.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class IntValue implements IntType
1111
{
1212
use AsInt;
1313

14-
public function __construct(protected int $value)
15-
{
16-
$this->value = $value;
17-
}
14+
public function __construct(protected int $value) {}
1815

1916
public function get(): int
2017
{

src/NumberValue.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class NumberValue implements NumberType
1111
{
1212
use AsNumber;
1313

14-
public function __construct(protected int|float $value)
15-
{
16-
$this->value = $value;
17-
}
14+
public function __construct(protected int|float $value) {}
1815

1916
public function get(): int|float
2017
{

src/NumericValue.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class NumericValue implements NumericType
1111
{
1212
use AsNumeric;
1313

14-
public function __construct(protected int|float|string $value)
15-
{
16-
$this->value = $value;
17-
}
14+
public function __construct(protected int|float|string $value) {}
1815

1916
public function get(): int|float|string
2017
{

src/ScalarValue.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class ScalarValue implements ScalarType
1111
{
1212
use AsScalar;
1313

14-
public function __construct(protected bool|int|float|string $value)
15-
{
16-
$this->value = $value;
17-
}
14+
public function __construct(protected bool|int|float|string $value) {}
1815

1916
public function get(): bool|int|float|string
2017
{

src/StringValue.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class StringValue implements StringType
1111
{
1212
use AsString;
1313

14-
public function __construct(protected string $value)
15-
{
16-
$this->value = $value;
17-
}
14+
public function __construct(protected string $value) {}
1815

1916
public function get(): string
2017
{

0 commit comments

Comments
 (0)