An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# DataClass

[![Tests](https://github.com/mako-framework/dataclass/actions/workflows/tests.yml/badge.svg)](https://github.com/mako-framework/dataclass/actions/workflows/tests.yml)
[![Static analysis](https://github.com/mako-framework/dataclass/actions/workflows/static-analysis.yml/badge.svg)](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']],
);
```