protected function getAllowedTypes(array $options)
    {
        $types = null;

        if (isset($options['file_types'])) {

            $types = $options['file_types'];
            $self  = $this;

            if (!is_array($types)) {
                $types = explode(',', $types);
                $types = array_map('trim', $types);
            }

            array_walk(
                $types,
                function (&$val) use ($self) {
                    if (false == preg_match('#^([^/]+)/([\w|\.|\-]+)#', $val)) {
                        $val = $self->getMimeType($val);
                    }
                }
            );
        }

        return $types;
    }
protected function getAllowedTypes(array $options)
    {
        $types = null;

        if (isset($options['file_types'])) {

            $types = $options['file_types'];
            $self  = $this;

            if (!is_array($types)) {
                $types = explode(',', $types);
                $types = array_map('trim', $types);
            }

            array_walk(
                $types,
                function (&$val) use ($self) {
                    if (false == preg_match('#^([^/]+)/([\w|\.|\-]+)#', $val)) {
                        $val = $self->getMimeType($val);
                    }
                }
            );
        }

        return $types;
    }
protected function getAllowedTypes ( array $ options ) { $ types = null ; if ( isset ( $ options [ 'file_types' ] ) ) { $ types = $ options [ 'file_types' ] ; $ self = $ this ; if ( ! is_array ( $ types ) ) { $ types = explode ( ',' , $ types ) ; $ types = array_map ( 'trim' , $ types ) ; } array_walk ( $ types , function ( & $ val ) use ( $ self ) { if ( false == preg_match ( '#^([^/]+)/([\w|\.|\-]+)#' , $ val ) ) { $ val = $ self -> getMimeType ( $ val ) ; } } ) ; } return $ types ; }
Update options field file_types
so if only extension is given it
will try to determine mime type

@param array $options
@return null | mixed;
Update options field file_types so if only extension is given it will try to determine mime type