diff --git a/src/MD_STD.php b/src/MD_STD.php index 2f938c7..a4cb03a 100644 --- a/src/MD_STD.php +++ b/src/MD_STD.php @@ -237,7 +237,7 @@ final class MD_STD { * @param string $url URL to query. * @param integer $timeout Timeout in milliseconds. * - * @return resource + * @return CurlHandle */ public static function curl_init(string $url, int $timeout) { @@ -300,9 +300,7 @@ final class MD_STD { */ public static function runCurlMulti(array $urls, int $timeout = 1200):array { - if (!($mh = curl_multi_init())) { - throw new Exception("Failed to set up multi handle"); - } + $mh = curl_multi_init(); $curl_array = []; foreach($urls as $i => $url) { @@ -322,7 +320,7 @@ final class MD_STD { $res = []; foreach($urls as $i => $url) { - $res[$i] = curl_multi_getcontent($curl_array[$i]); + $res[$i] = curl_multi_getcontent($curl_array[$i]) ?: ''; } foreach($urls as $i => $url){ @@ -508,9 +506,6 @@ final class MD_STD { public static function openssl_random_pseudo_bytes(int $length):string { $output = \openssl_random_pseudo_bytes($length); - if ($output === false) { - throw new Exception("Failed generating random pseudo bytes using openssl_random_pseudo_bytes"); - } return $output; } @@ -579,7 +574,7 @@ final class MD_STD { /** * Wrapper around the finfo functions to get the mime content type of a file. * - * @param string $filepath Expected file path. + * @param string $url Expected file path. * * @return string */