getContent($this->getUrl($qrText, $size)); } public function getUrl(string $qrText, int $size): string { $queryParameters = array( 'chs' => $size . 'x' . $size, 'chld' => strtoupper($this->errorcorrectionlevel) . '|' . $this->margin, 'cht' => 'qr', 'choe' => $this->encoding, 'chl' => $qrText, ); return 'https://chart.googleapis.com/chart?' . http_build_query($queryParameters); } }