rc\Buscador.php:30 PhanUndeclaredClassMethod Call to method getBody from undeclared class \Psr\Http\Message\ResponseInterface (Did you mean to configure a stub with https://github.com/phan/phan/wiki/How-To-Use-Stubs#internal-stubs or to enable the extension providing the class.) src\Buscador.php:34 PhanPossiblyUndeclaredVariable Variable $html is possibly undeclared
public function buscar(string $url): array
{
$resposta = $this->httpClient->request('GET', $url);
$html = $resposta->getBody();
$this->crawler->addHtmlContent($html);
$elementosCursos = $this->crawler->filter('span.card-curso__nome');
$cursos = [];
foreach ($elementosCursos as $elemento) {
$cursos[] = $elemento->textContent;
}
return $cursos;
}