Skip to content

Commit

Permalink
Merge 8d474b5 into 0f8252d
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Nov 16, 2017
2 parents 0f8252d + 8d474b5 commit 389f50c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ script:

after_success:
- travis_retry php vendor/bin/coveralls

- travis_retry php vendor/bin/codacycoverage clover build/logs/clover.xml
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,16 @@ This allows to skip type checks for return values if one has no results to retur

Returns a generator with all values currently in the pipeline. Allows to connect pipelines freely.

$a = new Simple();
$a->map(function () {
$foo = new Simple();
$foo->map(function () {
yield 1;
yield 2;
});

$b = new Simple();
$b->map($a);
var_dump($b->reduce());
$bar = new Simple();
$bar->map($foo);
$this->assertEquals(3, $bar->reduce());
var_dump($bar->reduce());
// int(3)

# Showcase
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"require-dev": {
"phpunit/phpunit": "^6.1",
"satooshi/php-coveralls": "^1.0",
"friendsofphp/php-cs-fixer": "^2.4"
"friendsofphp/php-cs-fixer": "^2.4",
"codacy/coverage": "^1.4"
},
"license": "Apache-2.0",
"minimum-stability": "dev",
Expand Down
10 changes: 5 additions & 5 deletions tests/Pipeline/SimpleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ public function testPipelineInPipeline()

$this->assertEquals(3 + 5 + 7 + 11, $pipeline2->reduce());

$a = new Simple();
$a->map(function () {
$foo = new Simple();
$foo->map(function () {
yield 1;
yield 2;
});

$b = new Simple();
$b->map($a);
$this->assertEquals(3, $b->reduce());
$bar = new Simple();
$bar->map($foo);
$this->assertEquals(3, $bar->reduce());
}

private $double;
Expand Down

0 comments on commit 389f50c

Please sign in to comment.