File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 ],
3535 "require" : {
3636 "php" : " ^8.2" ,
37- "dragon-code/simple-dto" : " ^2.3" ,
3837 "dragon-code/support" : " ^6.0"
3938 },
4039 "require-dev" : {
Original file line number Diff line number Diff line change 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+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44
55namespace DragonCode \WhichColor \Helpers ;
66
7- use DragonCode \WhichColor \Dto \RGB ;
7+ use DragonCode \WhichColor \Data \RGB ;
88
99class Weight
1010{
Original file line number Diff line number Diff line change 44
55namespace DragonCode \WhichColor \Services ;
66
7- use DragonCode \WhichColor \Dto \RGB ;
7+ use DragonCode \WhichColor \Data \RGB ;
88use DragonCode \WhichColor \Helpers \Weight ;
99
1010class Color
Original file line number Diff line number Diff line change 77use DragonCode \Support \Facades \Helpers \Arr ;
88use DragonCode \Support \Facades \Helpers \Str ;
99use DragonCode \Support \Facades \Instances \Instance ;
10- use DragonCode \WhichColor \Dto \RGB ;
10+ use DragonCode \WhichColor \Data \RGB ;
1111use ReflectionException ;
1212
1313class 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 /**
You can’t perform that action at this time.
0 commit comments