<commit_before><?php
namespace HealthCareAbroad\HelperBundle\Form\DataTransformer;

use Symfony\Component\Form\DataTransformerInterface;

class ContactNumberDataTransformer implements DataTransformerInterface
{
    public function transform($data)
    {
        $data = \json_decode($data, true);
        
        if (!$data) {
            $data = array('country_code' => '', 'area_code' => '', 'number' => '');
        }
        
        return $data;
    }
    
    public function reverseTransform($value)
    {
        return \json_encode($value);
    }
}<commit_msg>Fixed the contact number field for doctors<commit_after><?php
namespace HealthCareAbroad\HelperBundle\Form\DataTransformer;

use Symfony\Component\Form\DataTransformerInterface;

class ContactNumberDataTransformer implements DataTransformerInterface
{
    private $defaultValue = array('country_code' => '', 'area_code' => '', 'number' => '');
    
    public function transform($data)
    {
        $data = \json_decode($data, true);

        if (array_key_exists("country_code",$data)){
            
           return $data;
        }
        if (!$data) {
            
           return $data = $this->defaultValue;
        }else{
            
           return $data = $this->defaultValue;
        }
     
    }
    
    public function reverseTransform($value)
    {
        return \json_encode($value);
    }
}
{'fraction_non_alphanumeric': 0.11968276856524873, 'fraction_numerical': 0.0, 'mean_word_length': 2.47, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4903168', 'n_tokens_mistral': 383, 'n_tokens_neox': 382, 'n_words': 72}