* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @version 1.1 * @copyright 2020-2022 Kristuff */ namespace Kristuff\AbuseIPDB; /** * cURL helper functions */ trait CurlTrait { /** * helper to configure cURL option * * @access protected * @param resource $ch * @param int $option * @param mixed $value * * @return void * @throws \RuntimeException */ protected function setCurlOption($ch, int $option, $value): void { if(!curl_setopt($ch,$option,$value)){ throw new \RuntimeException('curl_setopt failed! '.curl_error($ch)); } } }