Advandz Notation is a lightweight collection of wrapper classes that provide a unified API for encoding, decoding and validating multiple data notations.
Helper functions in the style of json_encode and json_decode are provided for all supported notations. This allows fast onboarding with zero effort and without needing to learn class usage first.
$json = json_encode(['hello' => 'world']);
$data = json_decode($json, true);
$neon = neon_encode(['hello' => 'world']);
$data = neon_decode($neon, true);The same helper naming convention is available for all notations:
| Encode Helper | Decode Helper |
|---|---|
| csv_encode | csv_decode |
| json_encode | json_decode |
| yaml_encode | yaml_decode |
| neon_encode | neon_decode |
| php_encode | php_decode |
| toon_encode | toon_decode |
It brings support for multiple notation formats together under one unified API, eliminating the need to learn a different workflow for every standard.
Whether you prefer CSV, JSON, YAML, NEON, PHP serialization, or TOON notation, the package provides full support across all of them.
| Class | Notation |
|---|---|
Advandz\Notation\Csv |
CSV |
Advandz\Notation\Json |
JSON |
Advandz\Notation\Neon |
NEON |
Advandz\Notation\Php |
PHP (serialization) |
Advandz\Notation\Toon |
TOON |
Advandz\Notation\Yaml |
YAML |
Each one of the notation class exposes the same public and standardized static API:
public static function encode(mixed $data, int $flags = 0, int $depth = 512): ?string;
public static function decode(mixed $data, bool $associative = false, int $flags = 0, int $depth = 512): mixed;
public static function validate(string $data): bool;Thank you for considering contributing to this project! You can read the Contribution Guide.
This project follows a Code of Conduct that all community members and contributors are expected to adhere to. See CODE_OF_CONDUCT.md.
This project is open-source and available under the MIT License.