src/SnooPHP/Curl/Curl.php
public static function create($method, $url, $data = "", array $headers = [], array $options = [], $initOnly = false)
	{
		// Null if method is not valid
		$curl = null;

		// Compare method
		if (!strcasecmp($method, "GET"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "GET",
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);
		else if (!strcasecmp($method, "POST"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "POST",
				CURLOPT_POSTFIELDS		=> $data,
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);
		else if (!strcasecmp($method, "PUT"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "PUT",
				CURLOPT_POSTFIELDS		=> $data,
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);
		else if (!strcasecmp($method, "DELETE"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "DELETE",
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);

		return $curl;
	}
public static function create($method, $url, $data = "", array $headers = [], array $options = [], $initOnly = false)
	{
		// Null if method is not valid
		$curl = null;

		// Compare method
		if (!strcasecmp($method, "GET"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "GET",
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);
		else if (!strcasecmp($method, "POST"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "POST",
				CURLOPT_POSTFIELDS		=> $data,
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);
		else if (!strcasecmp($method, "PUT"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "PUT",
				CURLOPT_POSTFIELDS		=> $data,
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);
		else if (!strcasecmp($method, "DELETE"))
			$curl = new static($url, $options + [
				CURLOPT_CUSTOMREQUEST	=> "DELETE",
				CURLOPT_RETURNTRANSFER	=> true
			], $headers, $initOnly);

		return $curl;
	}
public static function create ( $ method , $ url , $ data = "" , array $ headers = [ ] , array $ options = [ ] , $ initOnly = false ) { // Null if method is not valid $ curl = null ; // Compare method if ( ! strcasecmp ( $ method , "GET" ) ) $ curl = new static ( $ url , $ options + [ CURLOPT_CUSTOMREQUEST => "GET" , CURLOPT_RETURNTRANSFER => true ] , $ headers , $ initOnly ) ; else if ( ! strcasecmp ( $ method , "POST" ) ) $ curl = new static ( $ url , $ options + [ CURLOPT_CUSTOMREQUEST => "POST" , CURLOPT_POSTFIELDS => $ data , CURLOPT_RETURNTRANSFER => true ] , $ headers , $ initOnly ) ; else if ( ! strcasecmp ( $ method , "PUT" ) ) $ curl = new static ( $ url , $ options + [ CURLOPT_CUSTOMREQUEST => "PUT" , CURLOPT_POSTFIELDS => $ data , CURLOPT_RETURNTRANSFER => true ] , $ headers , $ initOnly ) ; else if ( ! strcasecmp ( $ method , "DELETE" ) ) $ curl = new static ( $ url , $ options + [ CURLOPT_CUSTOMREQUEST => "DELETE" , CURLOPT_RETURNTRANSFER => true ] , $ headers , $ initOnly ) ; return $ curl ; }
Create appropriate session

@param string		$method		method string
@param string		$url		transfer url
@param string|array	$data		data to post [default: ""]
@param array			$headers	set of additional headers [default: []]
@param array			$options	set of additional options [default: []]
@param bool			$initOnly	if true don't send request on creation [default: false]

@return Get|Post|Put|Delete|null null if $method doesn't match any available method
Create appropriate session