Download the PHP package crazycodr/data-filter without Composer

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

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

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

This class features a filtering iterator accompagnied by different filters/filter groups that you can use to filter incoming data from any iteratable data-source. With this class package, you can create simple or complex groups of filters and filters an even be modified on the fly because it is an iterator over an iterator.

Table of contents

  1. Installation
  2. Creating a basic filtering iterator
  3. Supporting many filters at once
  4. Building complex filtering groups
  5. Using components outside of the iterator context
  6. 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 filtering iterator

Creating a filtering iterator requires at least three items:

  1. A FilterGroup used to contain the different filters for your iterator
  2. A FilterIterator used to iterate your data and provide filtering features
  3. A Filter used to detect if the current data should be kept or discarded from the iteration

(Note: This code assumes that you have an array based datasource with columns: Name, Type, Sex and Age)

Supporting many filters at once

The library supports multiple filters at once and will also respect the short-circuiting pattern. (A condition is only fully evaluated if necessary)

In this case, we have to switch the FilterGroup to "ANY" mode or else nothing will go through.

Building complex filtering groups

Last example showed us a closure filter that add many conditions. What if you want to explode that or combine many different closure filters in groups and sub groups such as:

The important aspect to remember is that, by default, FilterGroups are "ALL" groups and must be changed to "ANY" groups when necessary.

Using components outside of the iterator context

You don't need to use a filtering iterator... The ClosureFilter and FilterGroup can be used outside of a loop. Build conditions normally using concrete/non-concrete classes and call "shouldKeep" 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-filter 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-filter contains the following files

Loading the files please wait ....