Причин возникновения ошибки с текстом No temporary folder was configured in php.ini может быть несколько. Например, в конфиге указана несуществующая директория, но…
The following is more correct:
$class = get_class($objectToTest);
switch($class) {
case TreeRequest::class:
echo "tree request";
break;
case GroundRequest::class:
echo "ground request";
break;
}
This way namespaces are properly compared (you don’t have to type them out) and if anything changes such as the namespace or class name you’ll get a decent IDE error informing you that your code is broken.