Skip to content

Releases: byjg/php-serializer

Release 5.0.0

27 Oct 15:47
4d5e54d
Compare
Choose a tag to compare

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 added ext-simplexml and vimeo/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 and ObjectCopyInterface 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 and BindableInterface with ObjectCopy in BaseModel 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

30 May 15:37
029c07f
Compare
Choose a tag to compare

What's Changed

  • 4.9 Next by @byjg in #8
  • Added PropertyPatternInterface::prepare()
  • Added SerializerObject::withIgnoreProperties(array $properties)

Full Changelog: 4.9.1...4.9.2

Release 4.9.1

03 Jan 23:54
Compare
Choose a tag to compare

Add CamelToSnakeCase and SnakeToCamelCase property patterns

What's Changed

  • preparing to create new major version by @byjg in #5
  • 4.9 by @byjg in #6

Full Changelog: 4.9.0...4.9.1

Release 4.9.0

21 May 19:56
25cb786
Compare
Choose a tag to compare

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

09 Mar 06:01
Compare
Choose a tag to compare

Changed the Generic Exception to InvalidArgumentException

Release 1.0.6

09 Mar 02:38
Compare
Choose a tag to compare

Removed Backward compatibility PHPUnit

Release 1.0.5

19 Oct 15:09
Compare
Choose a tag to compare
  • Added setBuildNull(boolean)

Release 1.0.4

19 Apr 19:06
Compare
Choose a tag to compare
  • 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

17 Feb 12:33
Compare
Choose a tag to compare

Added the method Serializer::setDoNotParse to avoid serialize some classes

Release 1.0.2

09 Feb 13:35
Compare
Choose a tag to compare

Added PlainTextFormatter