<commit_before><commit_msg>Added transformer for stripping  tags.<commit_after><?php

namespace Ilios\CoreBundle\Form\DataTransformer;

use Symfony\Component\Form\DataTransformerInterface;

/**
 * Data sanitation transformer.
 *
 * Class RemoveMarkupTransformer
 * @package Ilios\CoreBundle\Form\DataTransformer
 */
class RemoveMarkupTransformer implements DataTransformerInterface
{
    /**
     * Strips all tags from a given string and returns it.
     * @param mixed $value
     * @return mixed
     */
    public function transform($value)
    {
        if (! is_string($value)) {
            return $value;
        }
        return strip_tags($value);
    }

    /**
     * Does nothing, it just returns the given value.
     *
     * @param string $value
     * @return string
     */
    public function reverseTransform($value)
    {
        return $value;
    }
}
{'fraction_non_alphanumeric': 0.09736540664375716, 'fraction_numerical': 0.0, 'mean_word_length': 2.672268907563025, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4941103', 'n_tokens_mistral': 247, 'n_tokens_neox': 241, 'n_words': 62}