Skip to content

Commit

Permalink
Fix: warning undefined $USER_AGENT (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdumontier authored Jan 4, 2024
1 parent d2f5513 commit 428e8c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions QuickChart.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

$USER_AGENT = 'quickchart-php (1.0.0)';

class QuickChart {
public $protocol;
public $host;
Expand All @@ -16,6 +14,8 @@ class QuickChart {
public $apiKey;
public $version;

const USER_AGENT = 'quickchart-php (1.0.0)';

function __construct($options = array()) {
$this->protocol = isset($options['protocol']) ? $options['protocol'] : 'https';
$this->host = isset($options['host']) ? $options['host'] : 'quickchart.io';
Expand Down Expand Up @@ -111,7 +111,7 @@ function getShortUrl() {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postData));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json',
"User-Agent:$USER_AGENT",
"User-Agent:" . QuickChart::USER_AGENT,
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
Expand Down

0 comments on commit 428e8c4

Please sign in to comment.