-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
55 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ vendor | |
target | ||
.idea | ||
composer.lock | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
language: php | ||
php: | ||
- 5.2 | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
before_script: | ||
- wget http://getcomposer.org/composer.phar | ||
- php composer.phar install --dev | ||
- wget https://raw.github.com/ehough/throwback/develop/src/main/bash/travis-setup.sh | ||
- chmod a+x travis-setup.sh | ||
- ./travis-setup.sh | ||
script: "phpunit -c src/test/resources/phpunit.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
chaingang [![Build Status](https://secure.travis-ci.org/ehough/chaingang.png)](http://travis-ci.org/ehough/chaingang) | ||
===== | ||
# chaingang [![Build Status](https://secure.travis-ci.org/ehough/chaingang.png)](http://travis-ci.org/ehough/chaingang) | ||
|
||
[Chain-of-Responsibility pattern](http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) in PHP. | ||
[Chain-of-Responsibility/Chain-of-Command pattern](http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern) for PHP 5.2+ | ||
|
||
/* | ||
* Build some commands. | ||
*/ | ||
$command1 = new MyCommand1(); //implements ehough_chaingang_api_Command | ||
$command2 = new MyCommand2(); //implements ehough_chaingang_api_Command | ||
### Sample Usage | ||
|
||
/* | ||
* Build and assemble the chain. | ||
*/ | ||
$chain = new ehough_chaingang_impl_StandardChain(); | ||
$chain->addCommand($command1); | ||
$chain->addCommand($command2); | ||
```php | ||
/* | ||
* Build some commands. | ||
*/ | ||
$command1 = new MyCommand1(); //implements ehough_chaingang_api_Command | ||
$command2 = new MyCommand2(); //implements ehough_chaingang_api_Command | ||
|
||
/* | ||
* Build the execution context. | ||
*/ | ||
$context = new ehough_chaingang_impl_StandardContext(); | ||
$context->put('foo', 'bar'); | ||
/* | ||
* Build and assemble the chain. | ||
*/ | ||
$chain = new ehough_chaingang_impl_StandardChain(); | ||
$chain->addCommand($command1); | ||
$chain->addCommand($command2); | ||
|
||
/* | ||
* Execute the chain. | ||
*/ | ||
$successfullyHandled = $chain->execute($context); | ||
/* | ||
* Build the execution context. | ||
*/ | ||
$context = new ehough_chaingang_impl_StandardContext(); | ||
$context->put('foo', 'bar'); | ||
|
||
/* | ||
* Execute the chain. | ||
*/ | ||
$successfullyHandled = $chain->execute($context); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,26 @@ | ||
{ | ||
"name": "ehough/chaingang", | ||
|
||
"description": "Chain of Responsibility pattern in PHP.", | ||
|
||
"description": "Chain-of-Responsibility / Chain-of-Command pattern in PHP.", | ||
"homepage": "https://github.com/ehough/chaingang", | ||
|
||
"license": "GPL-3.0+", | ||
|
||
"type": "library", | ||
"license": "MPL-2.0", | ||
"authors": [ | ||
{ | ||
"name": "Eric Hough", | ||
"email": "[email protected]", | ||
"homepage": "http://ehough.com" | ||
} | ||
], | ||
|
||
"require": { | ||
|
||
"php": ">=5.1.0" | ||
"php": ">=5.2.0" | ||
}, | ||
|
||
"require-dev": { | ||
|
||
"ehough/pulsar": "1.*", | ||
"mockery/mockery": ">=0.7.2" | ||
"ehough/mockery": "~1.0.0" | ||
}, | ||
|
||
"autoload": { | ||
|
||
"psr-0": { | ||
|
||
"ehough_chaingang": "src/main/php" | ||
} | ||
} | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
__throwback::$config = array( | ||
|
||
'name' => 'ehough_chaingang', | ||
'autoload' => dirname(__FILE__) . '/../../main/php', | ||
'dependencies' => array( | ||
|
||
array('ehough/mockery', 'https://github.com/ehough/mockery.git', 'src/main/php') | ||
) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters