From 9fa23f42a6f0973bcc771ce56405ea78214c9e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigui=20Kess=C3=A9=20Emmanuel?= Date: Fri, 27 Sep 2024 17:27:15 +0100 Subject: [PATCH] :truck: Rename `Values` to `Objects` --- src/Cast.php | 24 ++++++++++++------- src/{BoolValue.php => Objects/BoolObject.php} | 4 ++-- .../FloatObject.php} | 4 ++-- src/{IntValue.php => Objects/IntObject.php} | 4 ++-- .../MixedObject.php} | 4 ++-- .../NumberObject.php} | 4 ++-- .../NumericObject.php} | 4 ++-- .../ScalarObject.php} | 4 ++-- .../StringObject.php} | 4 ++-- tests/ArchTest.php | 7 +++--- tests/Feat/NumberTest.php | 4 ++-- tests/Feat/NumericTest.php | 4 ++-- tests/Feat/ScalarTest.php | 4 ++-- tests/Unit/BoolTest.php | 4 ++-- tests/Unit/FloatTest.php | 4 ++-- tests/Unit/IntTest.php | 4 ++-- tests/Unit/StringTest.php | 4 ++-- 17 files changed, 49 insertions(+), 42 deletions(-) rename src/{BoolValue.php => Objects/BoolObject.php} (78%) rename src/{FloatValue.php => Objects/FloatObject.php} (78%) rename src/{IntValue.php => Objects/IntObject.php} (78%) rename src/{MixedValue.php => Objects/MixedObject.php} (78%) rename src/{NumberValue.php => Objects/NumberObject.php} (78%) rename src/{NumericValue.php => Objects/NumericObject.php} (79%) rename src/{ScalarValue.php => Objects/ScalarObject.php} (79%) rename src/{StringValue.php => Objects/StringObject.php} (78%) diff --git a/src/Cast.php b/src/Cast.php index 0611dc8..d58ee83 100644 --- a/src/Cast.php +++ b/src/Cast.php @@ -4,6 +4,14 @@ namespace Sikessem\Values; +use Sikessem\Values\Objects\BoolObject; +use Sikessem\Values\Objects\FloatObject; +use Sikessem\Values\Objects\IntObject; +use Sikessem\Values\Objects\MixedObject; +use Sikessem\Values\Objects\NumberObject; +use Sikessem\Values\Objects\NumericObject; +use Sikessem\Values\Objects\ScalarObject; +use Sikessem\Values\Objects\StringObject; use Sikessem\Values\Types\BoolType; use Sikessem\Values\Types\FloatType; use Sikessem\Values\Types\IntType; @@ -24,42 +32,42 @@ public static function from(mixed $value): self public function intoBool(): BoolType { - return BoolValue::of($this->value); + return BoolObject::of($this->value); } public function intoInt(): IntType { - return IntValue::of($this->value); + return IntObject::of($this->value); } public function intoFloat(): FloatType { - return FloatValue::of($this->value); + return FloatObject::of($this->value); } public function intoString(): StringType { - return StringValue::of($this->value); + return StringObject::of($this->value); } public function intoNumber(): NumberType { - return NumberValue::of($this->value); + return NumberObject::of($this->value); } public function intoNumeric(): NumericType { - return NumericValue::of($this->value); + return NumericObject::of($this->value); } public function intoScalar(): ScalarType { - return ScalarValue::of($this->value); + return ScalarObject::of($this->value); } public function intoMixed(): MixedType { - return MixedValue::of($this->value); + return MixedObject::of($this->value); } public static function toBool(mixed $value): BoolType diff --git a/src/BoolValue.php b/src/Objects/BoolObject.php similarity index 78% rename from src/BoolValue.php rename to src/Objects/BoolObject.php index f3a3fd6..2d5301d 100644 --- a/src/BoolValue.php +++ b/src/Objects/BoolObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsBool; use Sikessem\Values\Types\BoolType; -class BoolValue implements BoolType +class BoolObject implements BoolType { use AsBool; diff --git a/src/FloatValue.php b/src/Objects/FloatObject.php similarity index 78% rename from src/FloatValue.php rename to src/Objects/FloatObject.php index e5c1b74..d29de56 100644 --- a/src/FloatValue.php +++ b/src/Objects/FloatObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsFloat; use Sikessem\Values\Types\FloatType; -class FloatValue implements FloatType +class FloatObject implements FloatType { use AsFloat; diff --git a/src/IntValue.php b/src/Objects/IntObject.php similarity index 78% rename from src/IntValue.php rename to src/Objects/IntObject.php index 4ce617f..74755ec 100644 --- a/src/IntValue.php +++ b/src/Objects/IntObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsInt; use Sikessem\Values\Types\IntType; -class IntValue implements IntType +class IntObject implements IntType { use AsInt; diff --git a/src/MixedValue.php b/src/Objects/MixedObject.php similarity index 78% rename from src/MixedValue.php rename to src/Objects/MixedObject.php index a2ac360..7a2c259 100644 --- a/src/MixedValue.php +++ b/src/Objects/MixedObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsMixed; use Sikessem\Values\Types\MixedType; -class MixedValue implements MixedType +class MixedObject implements MixedType { use AsMixed; diff --git a/src/NumberValue.php b/src/Objects/NumberObject.php similarity index 78% rename from src/NumberValue.php rename to src/Objects/NumberObject.php index accae09..269de8c 100644 --- a/src/NumberValue.php +++ b/src/Objects/NumberObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsNumber; use Sikessem\Values\Types\NumberType; -class NumberValue implements NumberType +class NumberObject implements NumberType { use AsNumber; diff --git a/src/NumericValue.php b/src/Objects/NumericObject.php similarity index 79% rename from src/NumericValue.php rename to src/Objects/NumericObject.php index d16d02e..95cbe0f 100644 --- a/src/NumericValue.php +++ b/src/Objects/NumericObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsNumeric; use Sikessem\Values\Types\NumericType; -class NumericValue implements NumericType +class NumericObject implements NumericType { use AsNumeric; diff --git a/src/ScalarValue.php b/src/Objects/ScalarObject.php similarity index 79% rename from src/ScalarValue.php rename to src/Objects/ScalarObject.php index 93aad96..80c9dc0 100644 --- a/src/ScalarValue.php +++ b/src/Objects/ScalarObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsScalar; use Sikessem\Values\Types\ScalarType; -class ScalarValue implements ScalarType +class ScalarObject implements ScalarType { use AsScalar; diff --git a/src/StringValue.php b/src/Objects/StringObject.php similarity index 78% rename from src/StringValue.php rename to src/Objects/StringObject.php index 912348c..f866afa 100644 --- a/src/StringValue.php +++ b/src/Objects/StringObject.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Sikessem\Values; +namespace Sikessem\Values\Objects; use Sikessem\Values\Concerns\AsString; use Sikessem\Values\Types\StringType; -class StringValue implements StringType +class StringObject implements StringType { use AsString; diff --git a/tests/ArchTest.php b/tests/ArchTest.php index 6b9873a..0505064 100644 --- a/tests/ArchTest.php +++ b/tests/ArchTest.php @@ -16,11 +16,10 @@ ->toBeAbstract() ->toHavePrefix('Abstract'); -test('base classes') - ->expect('Sikessem\Values\Bases') +test('objects') + ->expect('Sikessem\Values\Objects') ->classes() - ->toBeAbstract() - ->toHavePrefix('Base') + ->toHaveSuffix('Object') ->toHaveConstructor(); test('types') diff --git a/tests/Feat/NumberTest.php b/tests/Feat/NumberTest.php index 2e6bdcb..8cece0a 100644 --- a/tests/Feat/NumberTest.php +++ b/tests/Feat/NumberTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Sikessem\Values\Cast; -use Sikessem\Values\NumberValue; +use Sikessem\Values\Objects\NumberObject; use Sikessem\Values\Types\NumberType; use Sikessem\Values\Types\NumericType; @@ -12,7 +12,7 @@ }); it('should be instantiable', function () { - expect($this->number)->toBeInstanceOf(NumberValue::class); + expect($this->number)->toBeInstanceOf(NumberObject::class); }); it('should be an instance of NumberType', function () { diff --git a/tests/Feat/NumericTest.php b/tests/Feat/NumericTest.php index 2eac68f..18d8e1f 100644 --- a/tests/Feat/NumericTest.php +++ b/tests/Feat/NumericTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Sikessem\Values\Cast; -use Sikessem\Values\NumericValue; +use Sikessem\Values\Objects\NumericObject; use Sikessem\Values\Types\NumericType; use Sikessem\Values\Types\ScalarType; @@ -12,7 +12,7 @@ }); it('should be instantiable', function () { - expect($this->numeric)->toBeInstanceOf(NumericValue::class); + expect($this->numeric)->toBeInstanceOf(NumericObject::class); }); it('should be an instance of NumericType', function () { diff --git a/tests/Feat/ScalarTest.php b/tests/Feat/ScalarTest.php index 6cf1add..a70bc50 100644 --- a/tests/Feat/ScalarTest.php +++ b/tests/Feat/ScalarTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Sikessem\Values\Cast; -use Sikessem\Values\ScalarValue; +use Sikessem\Values\Objects\ScalarObject; use Sikessem\Values\Types\MixedType; use Sikessem\Values\Types\ScalarType; @@ -12,7 +12,7 @@ }); it('should be instantiable', function () { - expect($this->scalar)->toBeInstanceOf(ScalarValue::class); + expect($this->scalar)->toBeInstanceOf(ScalarObject::class); }); it('should be an instance of ScalarType', function () { diff --git a/tests/Unit/BoolTest.php b/tests/Unit/BoolTest.php index 0b264e6..f085784 100644 --- a/tests/Unit/BoolTest.php +++ b/tests/Unit/BoolTest.php @@ -2,8 +2,8 @@ declare(strict_types=1); -use Sikessem\Values\BoolValue; use Sikessem\Values\Cast; +use Sikessem\Values\Objects\BoolObject; use Sikessem\Values\Types\BoolType; use Sikessem\Values\Types\ScalarType; @@ -12,7 +12,7 @@ }); it('should be instantiable', function () { - expect($this->bool)->toBeInstanceOf(BoolValue::class); + expect($this->bool)->toBeInstanceOf(BoolObject::class); }); it('should be an instance of BoolType', function () { diff --git a/tests/Unit/FloatTest.php b/tests/Unit/FloatTest.php index 99ed5ca..994e890 100644 --- a/tests/Unit/FloatTest.php +++ b/tests/Unit/FloatTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Sikessem\Values\Cast; -use Sikessem\Values\FloatValue; +use Sikessem\Values\Objects\FloatObject; use Sikessem\Values\Types\FloatType; use Sikessem\Values\Types\NumberType; @@ -12,7 +12,7 @@ }); it('should be instantiable', function () { - expect($this->float)->toBeInstanceOf(FloatValue::class); + expect($this->float)->toBeInstanceOf(FloatObject::class); }); it('should be an instance of FloatType', function () { diff --git a/tests/Unit/IntTest.php b/tests/Unit/IntTest.php index 189116e..eee02c0 100644 --- a/tests/Unit/IntTest.php +++ b/tests/Unit/IntTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Sikessem\Values\Cast; -use Sikessem\Values\IntValue; +use Sikessem\Values\Objects\IntObject; use Sikessem\Values\Types\IntType; use Sikessem\Values\Types\NumberType; @@ -12,7 +12,7 @@ }); it('should be instantiable', function () { - expect($this->int)->toBeInstanceOf(IntValue::class); + expect($this->int)->toBeInstanceOf(IntObject::class); }); it('should be an instance of IntType', function () { diff --git a/tests/Unit/StringTest.php b/tests/Unit/StringTest.php index f993345..6a01829 100644 --- a/tests/Unit/StringTest.php +++ b/tests/Unit/StringTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use Sikessem\Values\Cast; -use Sikessem\Values\StringValue; +use Sikessem\Values\Objects\StringObject; use Sikessem\Values\Types\ScalarType; use Sikessem\Values\Types\StringType; @@ -12,7 +12,7 @@ }); it('should be instantiable', function () { - expect($this->string)->toBeInstanceOf(StringValue::class); + expect($this->string)->toBeInstanceOf(StringObject::class); }); it('should be an instance of StringType', function () {