https://github.com/mako-framework/dataclass
(Experimental) An easy to use data class implementation inspired by Pydantic.
https://github.com/mako-framework/dataclass
mako-framework php
Last synced: about 1 year ago
JSON representation
(Experimental) An easy to use data class implementation inspired by Pydantic.
- Host: GitHub
- URL: https://github.com/mako-framework/dataclass
- Owner: mako-framework
- License: bsd-3-clause
- Archived: true
- Created: 2023-03-07T19:45:27.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-07T14:38:05.000Z (almost 2 years ago)
- Last Synced: 2025-03-13T00:42:44.533Z (over 1 year ago)
- Topics: mako-framework, php
- Language: PHP
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# DataClass
[](https://github.com/mako-framework/dataclass/actions/workflows/tests.yml)
[](https://github.com/mako-framework/dataclass/actions/workflows/static-analysis.yml)
## Examples
### Basic usage
```php
'freost',
'email' => 'freost@example.org',
];
$user = new User(...$array);
// Instantiation from JSON
$json = << 'https://example.org/avatar.png'],
);
```
### Arrays of nested data classes
```php
'https://example.org/avatar.png']],
);
```