* * 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:----eJVekdLf6fnj077fLOuLh8L5zGRSbqEttzBygIoQE07aQun9M1SUsE/eYpGLOJve6LmoQP0OdOPw2giKGjMcxbpspR8W6KqtF+ncYHzlj50xr4ws6OPu/+htPG5PWIpnvcrCZPBwW74TjINsfeag27LabvV2WfaBMfKDpRVygbYQfijODy4h4/gGJfqtvtDcXczcLO5E+GN5BuRrerd9OZpAFTszL/maMBd0/lkNWYrA2pDeWsyMWaPwRlZgVnv4+JGQd96hXhF/uJPVkCt60mvz82VsIFD8Vyy46qDXgq4Gu3PK6vuAs6BDLoLdKvXiaw6/SqsVwnYcqCeCYMQjvZafCzgyfEATCf3xDJU2Mzl5xy5lbojLhLRvREB/EY2VSY4JeBiWevBiDSbxD8UOz4ywvc55rYKue/18tp3UrjKbUBqT/FXFtBuLfX6rH4uexNBMJdmdUFFFg0geNZzGBxoMJ1lOroEwFWwCEhPVaZ51W8b4a91Es+bRKD704rUnZrb0A4Zq+l9CR2/RxNb1gDy8AUTGgqmkFp74I3Mrx5vKIHCPrD2jSDc7sS+3n1j8YChPaaUa9SZPUGtBdgkclJox29e/zru3gqhFf8PE3Q0M0llP5jkXFVtlcIDOAUEEgF4Ih1XfIRwPLTdXA8h/7rhd7BKlvVp6zhEeaNfbJas=----ATTACHMENT:----ODMxMjg0ODIxNjgzMTAwMyAyOTc0MjYxODE1MDM4NTc1IDkwNTA5MDQ4Njk5ODIzOQ==