Create a new issue given an array of $params
The issue is assigned to the authenticated user.

@see http://www.redmine.org/projects/redmine/wiki/Rest_Issues#Creating-an-issue

@param array $params the new issue data

@return \SimpleXMLElement
961227
public function create(array $params = [])
    {
        $defaults = [
            'subject' => null,
            'description' => null,
            'project_id' => null,
            'category_id' => null,
            'priority_id' => null,
            'status_id' => null,
            'tracker_id' => null,
            'assigned_to_id' => null,
            'author_id' => null,
            'due_date' => null,
            'start_date' => null,
            'watcher_user_ids' => null,
            'fixed_version_id' => null,
        ];
        $params = $this->cleanParams($params);
        $params = $this->sanitizeParams($defaults, $params);

        $xml = $this->buildXML($params);

        return $this->post('/issues.xml', $xml->asXML());
    }
658553
public function create(string $name, array $params = array())
    {
        if (empty($name)) {
            throw new FactoryException ('create() requires a non-empty form name as first argument');
        }

        $className = $this->getFactoryNamespace() . '\\' . $name . $this->getFactoryPostfix();

        if (!class_exists($className)) {
            throw new FactoryException ('Form class "' . $className . '" does not exist');
        }

        $result = $this->createFormInstance($className, $params);

        return $result;
    }
1344095
public function params($params) {

		if(false === is_array($params)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		$this -> params = $params;

		return $this;
	}
964556
protected function performRequest(array $params)
    {
        $this->setRawResponse($this->rawResponse);
        $response = explode("\n", $this->rawResponse);

        return $response;
    }
286749
public static function factory($params = [])
    {
        $required = ['base_url', 'client_id', 'client_secret', 'token_uri', 'refresh_token'];

        $config = Collection::fromConfig($params, [], $required);
        $config->set('curl.options', [CURLOPT_PROXY => getenv('HTTPS_PROXY'), CURLOPT_TIMEOUT => 30]);

        $client = new self($config->get('base_url'), $config);

        // The refresh grant type needs its own client
        $refreshClient    = new Http\Client($config->get('token_uri'), $config);
        $refreshGrantType = new Oauth2\GrantType\RefreshToken($refreshClient, $config->toArray());

        // add refresh strategy
        $client->addSubscriber(new Oauth2\Oauth2Plugin($refreshGrantType));

        return $client;
    }
907908
protected static function create($params = null)
    {
        $url = static::classUrl();
        list($response) = static::staticRequest('post', $url, $params);
        return $response;
    }
138072
private function createDefaultClient(array $params)
    {
        $stack = HandlerStack::create();

        if (isset($params['cache']) && $params['cache'] === true) {
            $cache = new CacheMiddleware($this->getCacheStrategy());

            $stack->push($cache, 'snorlax-cache');
        }

        if (isset($params['log']) && $params['log'] === true) {
            $logger = new Logger($this->getLogger());
            $logger->setLogLevel(LogLevel::DEBUG);
            $logger->setRequestLoggingEnabled();
            $logger->setFormatter(new MessageFormatter(
                'REQ "{method} {target} HTTP/{version}"',
                'RES "{method} {target} HTTP/{version}" {code}'
            ));

            $stack->push($logger, 'snorlax-logger');
        }

        $params = array_merge($params, ['handler' => $stack]);

        return new Client($params);
    }
34902
public function create($params, $optParams = [])
    {
        if (!$params instanceof AccessToken) {
            throw new InvalidParamException(AccessToken::class . ' is required!');
        }
        $class = get_class($params);

        return $this->sendRequest([], [
            'restAction' => 'create',
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) use ($class) {
            return isset($response->data) ? new $class($response->data) : $response;
        });
    }
1204230
private function request(array $params = array())
  {
    $request = $this->client->createRequest('POST', $this->url);

    $body = $request->getBody();
    foreach ($params as $key => $value) {
      $body->setField($key, $value);
    }

    try {
      $response = $this->client->send($request);
    } catch (\Exception $e) {
      throw new \ScottRobertson\Premailer\Exception\Request($e->getMessage());
    }

    return new Response(
      $response->json(),
      $this->client
    );
  }
1279962
private function createJsonBody(array $params)
    {
        return (0 === \count($params)) ? null : \json_encode($params, empty($params) ? \JSON_FORCE_OBJECT : 0);
    }
882711
public function create(array $params)
    {
        if (!array_key_exists('amount', $params) ||
            !array_key_exists('currency', $params) ||
            !array_key_exists('description', $params) ||
            !array_key_exists('order_id', $params) ||
            !array_key_exists('payment_options', $params) ||
            !array_key_exists('type', $params)
        ) {
            throw new \InvalidArgumentException('Invalid data provided.');
        }

        return $this->post('/orders', [], $params);
    }
158743
private function buildXML(array $params = [])
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0"?><issue></issue>');

        foreach ($params as $k => $v) {
            if ('custom_fields' === $k && is_array($v)) {
                $this->attachCustomFieldXML($xml, $v);
            } elseif ('watcher_user_ids' === $k && is_array($v)) {
                $watcherUserIds = $xml->addChild('watcher_user_ids', '');
                $watcherUserIds->addAttribute('type', 'array');
                foreach ($v as $watcher) {
                    $watcherUserIds->addChild('watcher_user_id', (int) $watcher);
                }
            } elseif ('uploads' === $k && is_array($v)) {
                $uploadsItem = $xml->addChild('uploads', '');
                $uploadsItem->addAttribute('type', 'array');
                foreach ($v as $upload) {
                    $upload_item = $uploadsItem->addChild('upload', '');
                    foreach ($upload as $upload_k => $upload_v) {
                        $upload_item->addChild($upload_k, $upload_v);
                    }
                }
            } else {
                // "addChild" does not escape text for XML value, but the setter does.
                // http://stackoverflow.com/a/555039/99904
                $xml->$k = $v;
            }
        }

        return $xml;
    }
844554
public function show(string $issue, array $params = [])
    {
        $path = $this->buildIssuesPath($issue);

        return $this->get($path, $params);
    }
493055
public function createOrder(Array $params)
    {
        $createOrderRequest = $this->getRequestParam('CreateOrderRequestParam', $params, $this->config, $this->sign);

        $formContent = $this->executeFormRequest($createOrderRequest);

        echo $formContent;
    }
778344
public function issues(array $parameters = [])
    {
        $data = $this->client->issues()->all($this->id, $parameters);

        $issues = array();
        foreach ($data as $issue) {
            $issues[] = Issue::fromArray($this->getClient(), $this, $issue);
        }

        return $issues;
    }
1371344
public function create(array $params = array())
    {
        $defaults = array(
            'name'      => null,
            'devurl'    => null,
            'is_active' => true,
            'is_public' => false,
        );

        $params = array_filter(
            array_merge($defaults, $params),
            array($this, 'isNotNull')
        );

        if(
            !isset($params['name'])
         || !isset($params['devurl'])
        ) {
            throw new \Exception('Missing mandatory parameters');
        }
        $data = array('project'=>$params);

        return $this->post('/projects.json', $data);
    }
294165
protected function createContext(array $params)
    {
        $options = $this->contextOptions;
        $this->context = $this->createResource(function () use ($params, $options) {
            return stream_context_create($options, $params);
        });
    }