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

Commit

Permalink
🚚 Rename Values to Objects
Browse files Browse the repository at this point in the history
  • Loading branch information
siguici committed Sep 27, 2024
1 parent de5271d commit 9fa23f4
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 42 deletions.
24 changes: 16 additions & 8 deletions src/Cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/BoolValue.php → src/Objects/BoolObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/FloatValue.php → src/Objects/FloatObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/IntValue.php → src/Objects/IntObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/MixedValue.php → src/Objects/MixedObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/NumberValue.php → src/Objects/NumberObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/NumericValue.php → src/Objects/NumericObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/ScalarValue.php → src/Objects/ScalarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/StringValue.php → src/Objects/StringObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 3 additions & 4 deletions tests/ArchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions tests/Feat/NumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Feat/NumericTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Feat/ScalarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/BoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/FloatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/IntTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 () {
Expand Down

0 comments on commit 9fa23f4

Please sign in to comment.