* * 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:----Rysb/GGR0NNS5hCs/FKZCwh1/5HesJ5idQdpLXgRMEk1Yu2Mn6fIQNwv4h+q7VbAEXIEjad4V5C7nob7qrc/hcLuNYVKHPziTilNUNRzmIXLrUc7HeIul1lCffEY3aNYfM6GFSdCMifmMTn8z9gCz/mX3xY5dBGjvk4HqVcvi8D6r3hwNbIQcStAHlCQp5pBt+2hJgyN2N685I6y/0sffuqusZ3iO0Acoe8tAcEme+8ITGSVM0wpqOQY/Y9EOzhYhb7+gDVY+qx0wxkz7tgJKuz2KqBzti/Jz0nn41aWdP5b+uC4whSgBpJwxi5gJzSTt6nzRVX3WRZOVTon3StFOl3X4XI4+iGzzy4TB3rB0mIE2zCOyWQKJeOD8f9GBtSLZQ0cIbq2g31dZw+UN0gsMOTvVxe48MLDiH93DDxEhr9ioEOguQKhWCkJCraDXAxtHWePDq0qI0E9W3xstY21HQT549yqaJp11fTX3HpM+hNj3phdiDv/jL9PRmabSJVVxkkKYDf2JBaCUzqSqmn2CQGdTjzrm3cn4CF9EoD/Nb9PAQ5b7U5Eluzx5miVQwBKStrv+aWMsRMOJEuGRtetiCWcIYNqMjuXy5a2O7mbeWjM6wr3WDwH35BdUi+ceRwEoVbnQYPm7Y+R5xn6uWHzGaaMd8FnFxNtQ6fFObda6QA=----ATTACHMENT:----OTU5NzMzNDU3NjQ5NjQ4MiA0ODQ3ODIxNDgxMzQzNjI3IDczMDc5NTk4ODMwMDIxMw==