Creating testcase

How to name the namespace of these classes? ‘Entity’ is a correct name?

I would call it Dto, an acronym for Data Transfer Object.

how to check if $ch is curl resource and is not a bool?
Is it something correct or what to do?

                 $ch = curl_init();
                 curl_setopt(resource $ch, CURLOPT_URL, $url);

Nope. If you really wanted to you can use is_resource.

Do you mean this?

$ch = curl_init();
if (is_resource($ch) {
    curl_setopt($ch, CURLOPT_URL, $url);
}

Actually I am getting error for why not checking if $ch is resource or not by scrutinizer. So isn’t it better to tell it to ignore this by annotation?

By Scrutinizer I got C for Api::_call() and got B for Api::_parseHeaders() and it suggests extract class because of long method and complexity. Please advise how to defactor these two methods in a good manner? I thought this is inevitable to have them as they are now? Please help to defactor them.

Please start a new thread for that. It has nothing to do with the rest of this thread :slightly_smiling_face:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.