Serializer
A PHP serialization component focused on performance
Install / Use
/learn @tsantos84/SerializerREADME
TSantos Serializer
TSantos Serializer is a library to encode/decode PHP objects to some string representation. Because of its exclusive serialization strategy, this library is the faster serialization component to PHP.
Instalation
You can install this library through composer:
composer require tsantos/serializer
or just add tsantos/serializer to your composer file and then
composer update
Usage
The best way to get start with TSantos Serializer is by using the builder.
With a few configurations you are ready to serialize your data:
use TSantos\Serializer\SerializerBuilder;
class Post {
public $title;
public $summary;
}
$serializer = (new SerializerBuilder())
->setHydratorDir('/path/to/generated/hydrators')
->build();
$person = new Post('Post title', 'Post summary');
echo $serializer->serialize($person); // {"title":"Post title", "summary":"Post summary"}
This is the simplest example to get you started with TSantos Serializer. There are a lot of capabilities which you should know in order to master your serializer instance and take advantage of all library's power.
Features
Main features currently supported by TSantos Serializer:
- No need to mapping classes for simple use cases ...
- ... but supports
YAML,XMLandAnnotationsmapping formats for advanced mapping - Supports
JSONencoders - (De-)serializes objects of any depth
- Virtual properties
- Properties grouping
- Event listeners to hook into serialization operations
- (De-)serializes interfaces and abstract classes
Documentation
Please refer to the documentation page to see all allowed configurations.
Licence
MIT
Tests
vendor/bin/phpunit -c phpunit.xml.dist
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
