From b2de4b2c2ce558a1a24ecc0fccfb74325895dc02 Mon Sep 17 00:00:00 2001 From: Claudio-Emmolo Date: Wed, 31 Jul 2024 16:03:56 +0000 Subject: [PATCH] Fix styling --- src/CloudflareAnalytics.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/CloudflareAnalytics.php b/src/CloudflareAnalytics.php index be44c02..b547150 100755 --- a/src/CloudflareAnalytics.php +++ b/src/CloudflareAnalytics.php @@ -2,17 +2,20 @@ namespace The3LabsTeam\PhpCloudflareAnalytics; -class CloudflareAnalytics { - +class CloudflareAnalytics +{ public string $api_token; + public string $endpoint; - public function __construct() { + public function __construct() + { $this->api_token = env('CLOUDFLARE_API_TOKEN'); - $this->endpoint = "https://api.cloudflare.com/client/v4/graphql"; + $this->endpoint = 'https://api.cloudflare.com/client/v4/graphql'; } - protected function graphQLQuery($query) { + protected function graphQLQuery($query) + { $ch = curl_init($this->endpoint); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, @@ -20,8 +23,8 @@ protected function graphQLQuery($query) { CURLOPT_POSTFIELDS => json_encode(['query' => $query]), CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', - 'Authorization: Bearer ' . $this->api_token - ] + 'Authorization: Bearer '.$this->api_token, + ], ]); $response = curl_exec($ch); @@ -32,12 +35,11 @@ protected function graphQLQuery($query) { /** * Get the views between two dates - Returns an array with the date as key and the views as value - * @param $startDate - * @param $endDate - * @param $zoneTag + * * @return array */ - public function getViewsBetweenDates($startDate, $endDate, $zoneTag) { + public function getViewsBetweenDates($startDate, $endDate, $zoneTag) + { $query = <<