if (is_array($options) === false
) { throw InvalidArgument::
create(5, '$options', 'array',
gettype($options));
} if (empty($options['type'
])) { $options['type'
] =
$type;
} $options =
array_merge(self::
get_default_options(),
$options);
self::
set_defaults($url,
$headers,
$data,
$type,
$options);
$options['hooks'
]->
dispatch('requests.before_request',
[&
$url, &
$headers, &
$data, &
$type, &
$options]);
if (!
empty($options['transport'
])) { $transport =
$options['transport'
];
if (is_string($options['transport'
])) { $transport =
new $transport();
} } else { $need_ssl =
(stripos($url, 'https://'
) === 0
);