Skip to content

Commit d75f603

Browse files
Remove deprecated dragon-code/simple-dto dependency
1 parent fbac198 commit d75f603

6 files changed

Lines changed: 27 additions & 30 deletions

File tree

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
],
3535
"require": {
3636
"php": "^8.2",
37-
"dragon-code/simple-dto": "^2.3",
3837
"dragon-code/support": "^6.0"
3938
},
4039
"require-dev": {

src/Data/RGB.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DragonCode\WhichColor\Data;
6+
7+
class RGB
8+
{
9+
public function __construct(
10+
public int $red = 0,
11+
public int $green = 0,
12+
public int $blue = 0,
13+
) {}
14+
15+
public function toArray(): array
16+
{
17+
return [
18+
$this->red,
19+
$this->green,
20+
$this->blue,
21+
];
22+
}
23+
}

src/Dto/RGB.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Helpers/Weight.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace DragonCode\WhichColor\Helpers;
66

7-
use DragonCode\WhichColor\Dto\RGB;
7+
use DragonCode\WhichColor\Data\RGB;
88

99
class Weight
1010
{

src/Services/Color.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace DragonCode\WhichColor\Services;
66

7-
use DragonCode\WhichColor\Dto\RGB;
7+
use DragonCode\WhichColor\Data\RGB;
88
use DragonCode\WhichColor\Helpers\Weight;
99

1010
class Color

src/Services/Converter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use DragonCode\Support\Facades\Helpers\Arr;
88
use DragonCode\Support\Facades\Helpers\Str;
99
use DragonCode\Support\Facades\Instances\Instance;
10-
use DragonCode\WhichColor\Dto\RGB;
10+
use DragonCode\WhichColor\Data\RGB;
1111
use ReflectionException;
1212

1313
class Converter
@@ -27,7 +27,7 @@ public function hex2rgb(array|RGB|string|null $hex = '#000000'): RGB
2727

2828
[$red, $green, $blue] = $this->parseArray($hex);
2929

30-
return RGB::make(compact('red', 'green', 'blue'));
30+
return new RGB($red, $green, $blue);
3131
}
3232

3333
/**

0 commit comments

Comments
 (0)