<commit_before><?php
/**
 * Created by PhpStorm.
 * User: cbping-user
 * Date: 2017/5/5
 * Time: 10:17
 */

namespace FFMpegPush\FFProbe;


use FFMpegPush\Exception\InvalidArgumentException;

class DataHandler
{
    /**
     * @param $type
     * @param $data
     * @return Format|StreamCollection
     */
    public function map($type, $data)
    {
        switch ($type) {
            case FFProbeCommand::TYPE_FORMAT:
                return $this->mapFormat($data);
            case FFProbeCommand::TYPE_STREAMS:
                return $this->mapStreams($data);
            default:
                throw new InvalidArgumentException(sprintf(
                    'Invalid type `%s`.', $type
                ));
        }
    }

    private function mapFormat($data)
    {
        return new Format($data['format']);
    }<commit_msg>missing use namespace<commit_after><?php
/**
 * Created by PhpStorm.
 * User: cbping-user
 * Date: 2017/5/5
 * Time: 10:17
 */

namespace FFMpegPush\FFProbe;


use FFMpegPush\Exception\InvalidArgumentException;
use FFMpegPush\Command\FFProbeCommand;

class DataHandler
{
    /**
     * @param $type
     * @param $data
     * @return Format|StreamCollection
     */
    public function map($type, $data)
    {
        switch ($type) {
            case FFProbeCommand::TYPE_FORMAT:
                return $this->mapFormat($data);
            case FFProbeCommand::TYPE_STREAMS:
                return $this->mapStreams($data);
            default:
                throw new InvalidArgumentException(sprintf(
                    'Invalid type `%s`.', $type
                ));
        }
    }

    private function mapFormat($data)
    {
        return new Format($data['format']);
    }
{'fraction_non_alphanumeric': 0.11911679256246369, 'fraction_numerical': 0.011621150493898896, 'mean_word_length': 1.9947826086956522, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6704705', 'n_tokens_mistral': 521, 'n_tokens_neox': 493, 'n_words': 104}