Download the PHP package crazycodr/data-transform without Composer

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

Latest Stable Version Total Downloads Build Status CrazyCodr/Data/Transform

This package contains facilities to easily transform live iterated data from any enumerable source.

This class features a transforming iterator accompagnied by different classes that you can use to transform incoming data from any iteratable data-source.

Table of contents

  1. Installation
  2. Creating a basic transforming iterator
  3. Supporting many transformers at once
  4. Using components outside of the iterator context
  5. Creating your own testable classes

Installation

To install it, just include this requirement into your composer.json

And then run composer install/update as necessary.

Creating a basic transforming iterator

Creating a transforming iterator requires at least three items:

  1. A TransformerContainer used to contain the different transformers for your iterator
  2. A TransformingIterator used to iterate your data and provide transforming features
  3. A Transformer used to transform the current data into something new

(Note: This code assumes that you have an array based datasource with columns: name, type, sex and birthdate)

(Note: This code assumes that you have a class called Employe that mimics the previous datasource + a new property called age)

Supporting many transformers at once

You can add many transformers at once to the transformer container. The goal being to separate the different transformation aspects.

This example demonstrate that the first transformer creates the employee but the second initializes some other property manually. (Age vs Birthdate) Just note that the second transformer must use the $previous variable to obtain the current state of the transformed object, you don't want to recreate the object again.

Using components outside of the iterator context

You don't need to use a transforming iterator... The ClosureTransformer and TransformerContainer can be used outside of a loop. Build transformers normally using concrete/non-concrete classes and call "transform" with some data.

Creating your own testable classes

The point of this library is not to have to create the iterators and they sub-components each time and be able to test the lot easily. To this end, simply create concrete extensions of your iterators and sub-components and then test them.

It might look extreme but this way you are creating a concrete functional class that can be reused and tested. Note that DataProviders are a great way to test your components but it will look strange to use a DataProvider when testing the iterators.


All versions of data-transform with dependencies

PHP Build Version
Package Version
No informations.
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 crazycodr/data-transform contains the following files

Loading the files please wait ....