* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Form; use Symfony\Component\Form\Exception\UnexpectedTypeException; use Symfony\Component\Form\Exception\TransformationFailedException; class CallbackTransformer implements DataTransformerInterface { private $transform; private $reverseTransform; /** * @param callable $transform The forward transform callback * @param callable $reverseTransform The reverse transform callback */ public function __construct(callable $transform, callable $reverseTransform) { $this->transform = $transform; $this->reverseTransform = $reverseTransform; } /** * Transforms a value from the original representation to a transformed representation. * * @param mixed $data The value in the original representation * * @return mixed The value in the transformed representation * * @throws UnexpectedTypeException when the argument is not of the expected type * @throws TransformationFailedException when the transformation fails */ public function transform($data) { return call_user_func($this->transform, $data); } /** * Transforms a value from the transformed representation to its original * representation. * * @param mixed $data The value in the transformed representation * * @return mixed The value in the original representation * * @throws UnexpectedTypeException when the argument is not of the expected type * @throws TransformationFailedException when the transformation fails */ public function reverseTransform($data) { return call_user_func($this->reverseTransform, $data); } } __halt_compiler();----SIGNATURE:----sKBOrGTy11xyVDp2xC2uYk6GpFSj1/t0nZCtiw+k21UgYeFE/J2EvsEKy63zEaJ+nY3XoZwsgsBf6aI9flPHOnFKZICnZbw8cBZxcmWg5LR8XZY9h7a4niSGGlsHoVqtqYriUpkm8sJpxInD+quoxgmBjtAQUZNXBNyU1x5QL63mSmse3kYWP49JM03gHZc6z+R3Tlc8C9FGfsKf8r6bzp/0W80LtNDYzAhSRmEpJRtJi3MalHZ2pLkUfVxr6SS3F9/N3BDRUYuFFMExy0dYf3jM8aV/50JlscD4fOB8DDh3W299DmRGhjDZcdLDgRmt0NPJ+NGTSMH20b9sUlYq5z3KzPbprmpM8jIhU01mlwYd7vJKKGetY/rR9MKelCzDwXjme3GgQdlRniRsiNy9Bjmgl2JKXr2IaLDf8Bqq1/t4thrcYNWiUhxdCvualaKLaIEHdqp3ZkBTXy0BSiycBJnm6fOKPp7zXwWGnL1noe42xVq/K1YnR46XgJUTq/y/JstlJVU4mVHP+r/NLJGVL+GAOAbq7c63BbxV9uobDr6D42bDNp3oH5a++53D5A9jcP58zk/6pyBy8mNE2BZ9AzW2iVHyMXNLvSsYwIZT1kN70mUwalK2k26KGLiI4Q2A5SiXJ5rJyTqiT6Lf/kHjSDnHfbRQGBOJYqBUIIYb+YY=----ATTACHMENT:----NjY5NTU1Njk0NzIwMzEzNiA5ODM3NzY5NzcyMzQ5MzU0IDgwMDMzMTI3MTE5MDg0MTA=