3 Commits
4.2.1 ... 4.4

Author SHA1 Message Date
User
aba089db5e 20250218#1 2025-02-18 02:39:16 +03:00
User
43e529dcad 20250128#2 2025-01-28 14:21:33 +03:00
User
5bef4f577e 20250128#1 2025-01-28 13:23:44 +03:00
3 changed files with 24 additions and 2 deletions

View File

@@ -9,5 +9,5 @@ composer create-project rmphp/skeleton project-name
```
```bash
composer create-project rmphp/skeleton:"^4.2" project-name
composer create-project rmphp/skeleton:"^4.4" project-name
```

View File

@@ -6,6 +6,27 @@ use ReflectionClass;
abstract class AbstractDTO {
/**
* @param object $data
* @return static
*/
static function fromObject(object $data) : static {
return static::fromArray(get_object_vars($data));
}
/**
* @param array|object ...$data
* @return static
*/
static function fromData(array|object ...$data) : static {
$array = array_map(function($item) {
return (is_object($item)) ? get_object_vars($item) : $item;
}, $data);
return static::fromArray(array_merge(...$array));
}
/**
* @param array $data
* @return static
@@ -24,4 +45,5 @@ abstract class AbstractDTO {
}
return $self;
}
}

View File

@@ -17,7 +17,7 @@
"rmphp/router": "^1.2",
"rmphp/session": "^1.1",
"rmphp/redis": "^1.0",
"rmphp/storage": "^4.1",
"rmphp/storage": "^6.0",
"symfony/dotenv": "^6.2"
},
"autoload": {