Releases: byjg/php-serializer
Release 5.0.0
Major Refactory
Summary
This pull request includes several important changes to the project, focusing on updating dependencies, and improving documentation. The most significant changes include rewriting the base objects by adding new features and tools, updating the PHP version, adding Psalm for static analysis, and revising the README and documentation files.
Dependency and Tooling Updates:
- Updated the PHP version in the workflow to include 8.3 and removed older versions (7.4, 8.0) in
.github/workflows/phpunit.yml
. - Added Psalm static analysis tool to the workflow and configuration files (
.github/workflows/phpunit.yml
,.run/Psalm.run.xml
,psalm.xml
) [1] [2] [3]. - Updated
composer.json
to require PHP 8.1 or higher and addedext-simplexml
andvimeo/psalm
as dependencies.
Documentation Improvements:
- Overhauled the
README.md
to provide a more comprehensive description of the Serializer library's capabilities and updated usage examples [1] [2] [3]. - Added new documentation files for
ObjectCopy
andObjectCopyInterface
to explain their usage and provide examples (docs/objectcopy.md
,docs/objectcopyinterface.md
) [1] [2]. - Created a detailed guide for the
Serialize
class, including examples and customization options (docs/serialize.md
).
Codebase Simplification:
- Replaced
BindableObject
andBindableInterface
withObjectCopy
inBaseModel
and removed the old classes (src/BaseModel.php
,src/BindableInterface.php
,src/BindableObject.php
) [1] [2] [3].
Configuration Updates:
- Updated
phpunit.xml.dist
to include the latest PHPUnit schema and coverage configuration. - Added a run configuration for PHPUnit in
.run/PHPUnit.run.xml
.
These changes collectively improve the project's compatibility with newer PHP versions, enhance code quality through static analysis, and provide clearer documentation for users and developers.
The list of Breaking Changes Methodos
SerializerObject to Serialize
From | To |
---|---|
class SerializerObject | class Serialize |
SerializerObject::isSerializingNull | Serialize::isCopyingNullValues |
SerializerObject::withDoNotSerializeNull | Serialize:withDoNotParseNullValues |
SerializerObject::serialize | Serialize::toArray |
SerializerObject::instance() | Serialize::from() |
- | Serialize::fromJson() |
- | Serialize::fromYaml() |
- | Serialize::fromPhpSerialize() |
- | Serialize::toJson() |
- | Serialize::toYaml() |
- | Serialize::toXml() |
- | Serialize::toPhpSerialize() |
BindableInterface, BinderObject and BindableObject to ObjectCopy
From | To |
---|---|
interface BindableInterface | interface ObjectCopyInterface |
BindableInterface::bindFrom | ObjectCopyInterface::copyFrom |
BindableInterface::bindTo | ObjectCopyInterface::copyTo |
class BindableObject | class ObjectCopy |
class BinderObject | class ObjectCopy |
4.9.2
Release 4.9.1
Add CamelToSnakeCase and SnakeToCamelCase property patterns
What's Changed
Full Changelog: 4.9.0...4.9.1
Release 4.9.0
What's Changed
New Class/Method | Status | More Info |
---|---|---|
BindableInterface | New | |
BindableObject | New | split of BinderObject |
DumpToArrayInterface | Removed | |
SerializerObject::instance() | New | |
SerializerObject::serialize() | Renamed | from SerializerObject::build() |
BinderObject::bind() | Renamed | from BinderObject::bindObject() |
SerializerObject::serialize() | Replace | replace BinderObject::toArrayFrom() |
SerializerObject::serializeProperties() | Renamed and change to private | from SerializerObject::buildProperty() |
SerializerObject::serializeArray() | Renamed and change to private | from SerializerObject::buildArray() |
SerializerObject::serializeStdClass() | Renamed and change to private | from SerializerObject::buildStdClass() |
SerializerObject::serializeObject() | Renamed and change to private | from SerializerObject::buildObject() |
SerializerObject getter and setter | Renamed | All getters and setters |
Plus:
- Formatter supported only arrays, now support any kind of object
- Added some customization properties for the Formatters
Full Changelog: 1.0.7...4.9.0
Release 1.0.7
Changed the Generic Exception to InvalidArgumentException
Release 1.0.6
Removed Backward compatibility PHPUnit
Release 1.0.5
- Added setBuildNull(boolean)
Release 1.0.4
- Explicit remove bindTo($array)
- Added the ProperyPattern
- Added the ProperyPattern to method toArrayFro
- Fix serializer to get the value from the getter method instead the value of the private/protected property
Release 1.0.3
Added the method Serializer::setDoNotParse to avoid serialize some classes
Release 1.0.2
Added PlainTextFormatter