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 |