src/Module.php
private function addField(array $args, $type = null)
    {
        if (count($args) !== 2) {
            throw new InvalidFieldParametersException('You need pass only name, and title parameters to field');
        }

        return $this->fields->put($args[0], new Field($this, $args[0], $type, $args[1]));
    }
private function addField(array $args, $type = null)
    {
        if (count($args) !== 2) {
            throw new InvalidFieldParametersException('You need pass only name, and title parameters to field');
        }

        return $this->fields->put($args[0], new Field($this, $args[0], $type, $args[1]));
    }
Put a field object in the collection.

@param array  $args
@param string $type

@throws InvalidFieldParametersException

@return Field