Skip to content

Commit

Permalink
Fix styling 💄
Browse files Browse the repository at this point in the history
  • Loading branch information
DevRaeph authored and github-actions[bot] committed May 9, 2024
1 parent 99f481c commit f6c6113
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 103 deletions.
30 changes: 20 additions & 10 deletions src/Concerns/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ class Filter
protected Carbon $to;

protected string $tz;

protected Carbon $from_time;

protected Carbon $to_time;

protected string $event = '';

protected string $event_meta_key = '';

protected Scale $scale = Scale::SCALE_DAY;

public function __construct()
Expand All @@ -30,7 +34,6 @@ public function __construct()

/**
* Building up the query params for the api call
* @return string
*/
public function toQuery(): string
{
Expand All @@ -49,7 +52,6 @@ public function toQuery(): string

/**
* Generation a md5 hash out of the filter object for caching.
* @return string
*/
public function hash(): string
{
Expand All @@ -58,89 +60,97 @@ public function hash(): string

/**
* The from date filter
* @param Carbon $from
*
* @return $this
*/
public function setFrom(Carbon $from): Filter
{
$this->from = $from;

return $this;
}

/**
* The to date filter
* @param Carbon $to
*
* @return $this
*/
public function setTo(Carbon $to): Filter
{
$this->to = $to;

return $this;
}

/**
* Sets the start time to group results by minute in the format of Carbon. This only applies if the start and end date (to and from) are equal.
* @param Carbon $from_time
*
* @return $this
*/
public function setFromTime(Carbon $from_time): Filter
{
$this->from_time = $from_time;

return $this;
}

/**
* Sets the end time to group results by minute in the format of Carbon. This only applies if the start and end date (to and from) are equal.
* @param Carbon $to_time
*
* @return $this
*/
public function setToTime(Carbon $to_time): Filter
{
$this->to_time = $to_time;

return $this;
}

/**
* The domain ID. Use the list endpoint to get the domain ID for the client. (Default set by PirschClient)
* @param string $id
*
* @return $this
*/
public function setId(string $id): Filter
{
$this->id = $id;

return $this;
}

/**
* The name of an event to filter for.
* @param string $event
*
* @return $this
*/
public function setEvent(string $event): Filter
{
$this->event = $event;

return $this;
}

/**
* The event meta key to filter for. This field is used to break down a single event.
* @param string $event_meta_key
*
* @return $this
*/
public function setEventMetaKey(string $event_meta_key): Filter
{
$this->event_meta_key = $event_meta_key;

return $this;
}

/**
* The scale to group results. Can either be day (default), week, month, or year.
* @param Scale $scale
*
* @return $this
*/
public function setScale(Scale $scale): Filter
{
$this->scale = $scale;

return $this;
}
}
7 changes: 7 additions & 0 deletions src/Concerns/PirschClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ class PirschClient
const ACTIVE_VISITORS_ENDPOINT = '/api/v1/statistics/active';

const VISITORS_ENDPOINT = '/api/v1/statistics/visitor';

const EVENTS_ENDPOINT = '/api/v1/statistics/events';

const EVENT_METADATA_ENDPOINT = '/api/v1/statistics/event/meta';

const LANGUAGE_ENDPOINT = '/api/v1/statistics/language';

const REFERRER_ENDPOINT = '/api/v1/statistics/referrer';

const OS_ENDPOINT = '/api/v1/statistics/os';

const PLATFORM_ENDPOINT = '/api/v1/statistics/platform';

const KEYWORDS_ENDPOINT = '/api/v1/statistics/keywords';

private string $clientID;
Expand Down
2 changes: 1 addition & 1 deletion src/Enums/Scale.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Devlogx\FilamentPirsch\Enums;

enum Scale:string
enum Scale: string
{
case SCALE_DAY = 'day';
case SCALE_WEEK = 'week';
Expand Down
Loading

0 comments on commit f6c6113

Please sign in to comment.