private static function instantiate(array $declaration)
    {
        $fieldType = array_shift($declaration);

        $class = "\\Zerg\\Field\\" . ucfirst(strtolower($fieldType));
        if (class_exists($class)) {
            $reflection = new \ReflectionClass($class);
            return $reflection->newInstanceArgs($declaration);
        }

        throw new ConfigurationException("Field {$fieldType} doesn't exist");
    }
private static function instantiate(array $declaration)
    {
        $fieldType = array_shift($declaration);

        $class = "\\Zerg\\Field\\" . ucfirst(strtolower($fieldType));
        if (class_exists($class)) {
            $reflection = new \ReflectionClass($class);
            return $reflection->newInstanceArgs($declaration);
        }

        throw new ConfigurationException("Field {$fieldType} doesn't exist");
    }
private static function instantiate ( array $ declaration ) { $ fieldType = array_shift ( $ declaration ) ; $ class = "\\Zerg\\Field\\" . ucfirst ( strtolower ( $ fieldType ) ) ; if ( class_exists ( $ class ) ) { $ reflection = new \ ReflectionClass ( $ class ) ; return $ reflection -> newInstanceArgs ( $ declaration ) ; } throw new ConfigurationException ( "Field {$fieldType} doesn't exist" ) ; }
Create field instance by its declaration.

@param array $declaration Field declaration.
@return AbstractField Field instance.
@throws ConfigurationException If invalid declaration is presented.
Create field instance by its declaration .