aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-04 17:50:34 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-04 17:50:34 +0200
commit46b77928f746a4231d064774b5b67fd892c7ce86 (patch)
treee3ea690b3f0def1744ddae758923cf92171ef985 /vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php
parent68abd9c71b1d2f7bb2e9d21819584d1d15005b25 (diff)
downloadwallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.gz
wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.tar.zst
wallabag-46b77928f746a4231d064774b5b67fd892c7ce86.zip
rm vendor
Diffstat (limited to 'vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php')
-rw-r--r--vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php70
1 files changed, 0 insertions, 70 deletions
diff --git a/vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php b/vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php
deleted file mode 100644
index 1dfe8900..00000000
--- a/vendor/symfony/form/Symfony/Component/Form/CallbackTransformer.php
+++ /dev/null
@@ -1,70 +0,0 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Form;
13
14class CallbackTransformer implements DataTransformerInterface
15{
16 /**
17 * The callback used for forward transform
18 * @var \Closure
19 */
20 private $transform;
21
22 /**
23 * The callback used for reverse transform
24 * @var \Closure
25 */
26 private $reverseTransform;
27
28 /**
29 * Constructor.
30 *
31 * @param \Closure $transform The forward transform callback
32 * @param \Closure $reverseTransform The reverse transform callback
33 */
34 public function __construct(\Closure $transform, \Closure $reverseTransform)
35 {
36 $this->transform = $transform;
37 $this->reverseTransform = $reverseTransform;
38 }
39
40 /**
41 * Transforms a value from the original representation to a transformed representation.
42 *
43 * @param mixed $data The value in the original representation
44 *
45 * @return mixed The value in the transformed representation
46 *
47 * @throws UnexpectedTypeException when the argument is not a string
48 * @throws TransformationFailedException when the transformation fails
49 */
50 public function transform($data)
51 {
52 return call_user_func($this->transform, $data);
53 }
54
55 /**
56 * Transforms a value from the transformed representation to its original
57 * representation.
58 *
59 * @param mixed $data The value in the transformed representation
60 *
61 * @return mixed The value in the original representation
62 *
63 * @throws UnexpectedTypeException when the argument is not of the expected type
64 * @throws TransformationFailedException when the transformation fails
65 */
66 public function reverseTransform($data)
67 {
68 return call_user_func($this->reverseTransform, $data);
69 }
70}