<commit_before># chippyash/builder-pattern

## What?

Provides an implementation of the [Builder Pattern](http://en.wikipedia.org/wiki/Builder_pattern) 
for PHP.

*  Everything has a test case
*  It's PHP 5.5+

The library is released under the [GNU GPL V3 or later license](http://www.gnu.org/copyleft/gpl.html)

If you have [PlantUML](http://plantuml.sourceforge.net/) installed, you can view the UML diagrams in the docs folder

## QA

[![Build Status](https://travis-ci.org/chippyash/Builder-Pattern.svg?branch=master)](https://travis-ci.org/chippyash/Builder-Pattern)
[![Coverage Status](https://coveralls.io/repos/chippyash/Builder-Pattern/badge.png)](https://coveralls.io/r/chippyash/Builder-Pattern)
## Why

Solve the problem once!  The requirement was to have a builder pattern implementation 
that can:

* be used to build test data sets
* be used to control mock servers with the data sets
* allow test scripts to modify builder behaviour via the directors

## How

The solution breaks the problem into parts:

* Builders build a data set
* Modifiers utilise events to communicate changes in the builder behaviour
* Renderers are responsible for doing something with the built data
* Directors control the process (as per the builder pattern) and can communicate to
builders via the Modifier

### Coding Basics

Please see the example script, Builders and Director in the examples folder.  They
demonstrate all the principles of using the library.  Try changing the Director
to use a different Renderer.  Add some additional data items to a builder.  Add a
modification into a builder, with a Director method that allows the client script
to control the build.

### Creating Builders

Extend your builder from AbstractBuilder and add a protected function setBuildItems()
to add items to the $this->buildItems associative array.  Items can be simple<commit_msg>add most recent coveralls badge<commit_after># chippyash/builder-pattern

## What?

Provides an implementation of the [Builder Pattern](http://en.wikipedia.org/wiki/Builder_pattern) 
for PHP.

*  Everything has a test case
*  It's PHP 5.5+

The library is released under the [GNU GPL V3 or later license](http://www.gnu.org/copyleft/gpl.html)

If you have [PlantUML](http://plantuml.sourceforge.net/) installed, you can view the UML diagrams in the docs folder

## QA

[![Build Status](https://travis-ci.org/chippyash/Builder-Pattern.svg?branch=master)](https://travis-ci.org/chippyash/Builder-Pattern)
[![Coverage Status](https://coveralls.io/repos/chippyash/Builder-Pattern/badge.png?branch=master)](https://coveralls.io/r/chippyash/Builder-Pattern?branch=master)

## Why

Solve the problem once!  The requirement was to have a builder pattern implementation 
that can:

* be used to build test data sets
* be used to control mock servers with the data sets
* allow test scripts to modify builder behaviour via the directors

## How

The solution breaks the problem into parts:

* Builders build a data set
* Modifiers utilise events to communicate changes in the builder behaviour
* Renderers are responsible for doing something with the built data
* Directors control the process (as per the builder pattern) and can communicate to
builders via the Modifier

### Coding Basics

Please see the example script, Builders and Director in the examples folder.  They
demonstrate all the principles of using the library.  Try changing the Director
to use a different Renderer.  Add some additional data items to a builder.  Add a
modification into a builder, with a Director method that allows the client script
to control the build.

### Creating Builders

Extend your builder from AbstractBuilder and add a protected function setBuildItems()
to add items to the $this->buildItems associative array.  Items can be simple
{'fraction_non_alphanumeric': 0.0754816574294009, 'fraction_numerical': 0.001583531274742676, 'mean_word_length': 4.707831325301205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5023653', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1016, 'n_words': 461}