Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
Changed the markdown in README a bit and added "whats next"
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyone-crazycoders committed Jul 20, 2013
1 parent fdb631f commit 2225427
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ This package contains facilities to easily filter data from any enumerable sour
This class features, for now, a single iterator that you can use to filter out data as you iterate it. It offers slightly more complex features that the ones of a SPL FilterIterator in a sense that you can manage multiple filters at once, clear the lot, dynamically add new conditions to it as you go, etc.

Quick documentation
===================
-------------------

1. The filter class is an iterator and filters out data live as you iterate.
2. You can change the filter conditions live since it doesn't pre-process the inner iterator
3. Calling `where()` allows you to add conditions to the filter class, you can chain `where()` as long as you want
4. You can clear all filters by calling `clearFilters()` whenever you want

Whats next
----------

1. Create "any()" and "all()" functions that accept groups of closures

Examples
========
--------

Using prepared conditions just in time
--------------------------------------
**Using prepared conditions just in time**

The fun aspect of this class is that you can prepare filtering closures in advance, they could be
simple closures in another file that you test using unit tests. In this case, we prepare those closures
Expand Down Expand Up @@ -47,8 +51,7 @@ in advance and add the right closures to the filtering process.

```

Chaining support
----------------
**Chaining support**

CrazyCodr Data Filter supports chaining of filter functions so you can skip repeating over and over
again the original object that you called when creating a filter.
Expand All @@ -63,8 +66,7 @@ $filteredData
->where(function($data, $key){ return $data->user != 'crazycone'; });
```

Dynamically adding constraints
------------------------------
**Dynamically adding constraints**

You can add constraint as you loop. The CrazyCodr Data Filter is not a preprocessor filter,
it filters as you iterate. Thus, you can add filters to it as we go. Although not the best method
Expand Down

0 comments on commit 2225427

Please sign in to comment.