Skip to content

Commit

Permalink
BUG Fix parameter order
Browse files Browse the repository at this point in the history
  • Loading branch information
flamerohr committed Nov 21, 2017
1 parent 266b830 commit 1e96989
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Transformer/YamlTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ function ($document) use ($flag) {
// and check their filename and maybe their document name, depending on the pattern.
// We don't want to do any pattern matching after the first hash as the document name
// is assumed to follow it.
$firstHash = strpos('#', $pattern);
$firstHash = strpos($pattern, '#');
$documentName = false;
if ($firstHash !== false) {
$documentName = substr($pattern, $firstHash + 1);
Expand All @@ -445,6 +445,7 @@ function ($part) {
explode('*', $pattern)
)
).'%';

$matchedDocuments = [];
foreach ($documents as $document) {
// Ensure filename is relative
Expand Down
3 changes: 2 additions & 1 deletion tests/Transformer/YamlTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public function testBeforeAfterStatementWithPath()
$content = <<<'YAML'
---
name: test2
before: 'test/*'
before: 'test/*#test'
---
test: 'should not overwrite'
YAML;
Expand All @@ -289,6 +289,7 @@ public function testBeforeAfterStatementWithPath()

$this->assertEquals('test', $collection->get('test'));

// this one is kind of moot because if the matching fails, it'll go after anyway...
$content = <<<'YAML'
---
name: test3
Expand Down

0 comments on commit 1e96989

Please sign in to comment.