Skip to content

Commit

Permalink
Added AnonymousTransformer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilge committed Feb 4, 2017
1 parent 7c16a70 commit 29fe442
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Transform/AnonymousTransformer.php
@@ -0,0 +1,19 @@
<?php
namespace ScriptFUSION\Porter\Transform;

use ScriptFUSION\Porter\Collection\RecordCollection;

class AnonymousTransformer implements Transformer
{
private $transformer;

public function __construct(callable $transformer)
{
$this->transformer = $transformer;
}

public function transform(RecordCollection $records, $context)
{
return call_user_func($this->transformer, $records, $context);
}
}

0 comments on commit 29fe442

Please sign in to comment.