Download the PHP package bernard/normalt without Composer

On this page you can find all versions of the php package bernard/normalt. 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 normalt

Normalt

Build Status

Normalt contains additional normalizers for use with the serializer component found in Symfony. It also implements a normalizer delegator that will look at the data you want normalized and/or denormalized and call the normalizer which supports it.

In the context of Normalt normalization is the act of converting an object into an array. Denormalization is the opposite direction (converting array into an object). This is to my knowledge the same concept Symfony serializer uses.

Table of Contents

Getting Started

Getting started is as easy as requiring the library with composer.

Normalizers

Theese normalizers can be used with the serializer component directly or through the AggregateNormalizer.

AggregateNormalizer

AggregateNormalizer is a delegator and aggregator as it aggregates multiple normalizers and denormalizers which it will delegate the process to.

It have a list of normalizers and denormalizers. It will ask each of theese if they support the data/object and use the first found.

It implements a subset of the full serializer and its only focus is normalizing to arrays and denormalize arrays into objects. This lets you focus on normalization instead of converting into a specific format such as xml, json etc.

Usage

You need to instantiate the normalizer and the list of normalizer/denormalizers you want to use. For this example we use GetSetMethodNormalizer which is distributed with the symfony package.

This is the class we are going to use. GetSetMethodNormalizer uses getters and setters to do its job.

Lets normalize and denormalize it again.

In contrast to the other normalizers in this package, it does not make sense to use this with the serializer as the Serializer already does most of the functionality already.

DoctrineNormalizer

DoctrineNormalizer normalizes mapped objects (Entities, Documents etc.) into arrays and back again.

It usage is very simple. The following example assume a mapped object of $user and that you are using the doctrine orm (other doctrine projects work aswell!).

RecursiveReflectionNormalizer

This normalizes also delegates like the AggregateNormalizer, but delegates for each property in the object you are normalizing to normalize. It does this with recursion, so if a normalizer does not support a given property and is an array it will loop through that array and look for more objects.

The same thing happens when denormalizing, except it will try and find a supporting denormalizer for the property structure before looping.

Using is simple as the other, the example utilises DoctrineNormalizer and assumes we have a $profile object that contains a reference to a user with $profile->user.

License

Please refer to the included LICENSE file.


All versions of normalt with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6||^7.0
symfony/serializer Version ^2.3 || ^3.0 || ^4.0
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 bernard/normalt contains the following files

Loading the files please wait ....