Download the PHP package matthiasnoback/broadway-serialization without Composer

On this page you can find all versions of the php package matthiasnoback/broadway-serialization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package broadway-serialization

Broadway Serialization helper library

By Matthias Noback

Event-sourcing framework Broadway requires a lot of your objects (like domain events and often view models as well) to be serializable because they have to be stored in plain text and later be reconstituted.

Making an object serializable requires you to write lots of pretty simple code. Even though that code is simple, you are likely to make mistakes in it. It's also a bit boring to write. To alleviate the pain, this library helps you to make objects serializable with in a few simple steps.

Installation

Just run

composer require matthiasnoback/broadway-serialization

Conventions

This library is very simple and it just works because of a few simple and yet assumptions:

  1. Serializable objects have at least one property. Properties can have any kind of scope.
  2. Serializable objects implements Broadway's Serializable interface.
  3. Properties contain scalar values, serializable objects, or arrays of serializable objects.

Example

By implementing deserializationCallbacks() you can define callables that should be called in order to deserialize the provided data. The callable will be called once for single values or multiple times for arrays of values.

Setup

The Serializable trait depends on a little bit of setup. Before calling its deserialize() method, make sure you have properly set up a Reconstitute service, like this:

Note that this package ships with different implementations of the hydrator. Depending on your setup and preferences, you can also use the HydrateUsingClosure class. The former generally performs better than the HydrateUsingReflection.

Performance

When using this library, your personal performance will increase significantly. Of course, runtime performance will be worse (not noticeably though, unless you're actually deserializing millions of objects).


All versions of broadway-serialization with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^8.0
doctrine/instantiator Version ^1.0
broadway/broadway Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package matthiasnoback/broadway-serialization contains the following files

Loading the files please wait ....