Skip to content

Commit ae2ad46

Browse files
Adding basic debug transformer
1 parent 52ffad0 commit ae2ad46

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Transformer/DebugTransformer.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of the CleverAge/ProcessBundle package.
4+
*
5+
* Copyright (C) 2017-2019 Clever-Age
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
namespace CleverAge\ProcessBundle\Transformer;
12+
13+
use Symfony\Component\VarDumper\VarDumper;
14+
15+
/**
16+
* Simple dump in a transformer, passthrough for value
17+
*
18+
* @author Vincent Chalnot <[email protected]>
19+
*/
20+
class DebugTransformer implements TransformerInterface
21+
{
22+
/**
23+
* @inheritDoc
24+
*/
25+
public function transform($value, array $options = [])
26+
{
27+
if (class_exists(VarDumper::class)) {
28+
VarDumper::dump($value);
29+
}
30+
31+
return $value;
32+
}
33+
34+
/**
35+
* @inheritDoc
36+
*/
37+
public function getCode()
38+
{
39+
return 'dump';
40+
}
41+
}

0 commit comments

Comments
 (0)