Skip to content

Commit b9ba6b1

Browse files
author
Alex Westergaard
committed
Update names to display type
1 parent d39123c commit b9ba6b1

File tree

85 files changed

+239
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+239
-255
lines changed

src/Analytics.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
namespace AlexWestergaard\PhpGa4;
44

55
use GuzzleHttp\Client as Guzzle;
6-
use AlexWestergaard\PhpGa4\Helper\AbstractIO;
7-
use AlexWestergaard\PhpGa4\Facade\Type\UserProperty;
8-
use AlexWestergaard\PhpGa4\Facade\Type\Event;
9-
use AlexWestergaard\PhpGa4\Facade\Type\Analytics as TypeAnalytics;
6+
use AlexWestergaard\PhpGa4\Helper;
7+
use AlexWestergaard\PhpGa4\Facade;
108
use AlexWestergaard\PhpGa4\Exception\Ga4Exception;
119

12-
class Analytics extends AbstractIO implements TypeAnalytics
10+
class Analytics extends Helper\IOHelper implements Facade\Type\AnalyticsType
1311
{
1412
protected null|bool $non_personalized_ads = false;
1513
protected null|int $timestamp_micros;
@@ -85,7 +83,7 @@ public function setTimestampMicros(int|float $microOrUnix)
8583
return $this;
8684
}
8785

88-
public function addUserProperty(UserProperty ...$props)
86+
public function addUserProperty(Facade\Type\UserPropertyType ...$props)
8987
{
9088
foreach ($props as $prop) {
9189
$this->user_properties = array_replace($this->user_properties, $prop->toArray());
@@ -94,7 +92,7 @@ public function addUserProperty(UserProperty ...$props)
9492
return $this;
9593
}
9694

97-
public function addEvent(Event ...$events)
95+
public function addEvent(Facade\Type\EventType ...$events)
9896
{
9997
foreach ($events as $event) {
10098
$this->events[] = $event->toArray();
@@ -112,7 +110,7 @@ public function post(): void
112110
throw Ga4Exception::throwMissingApiSecret();
113111
}
114112

115-
$url = $this->debug ? TypeAnalytics::URL_DEBUG : TypeAnalytics::URL_LIVE;
113+
$url = $this->debug ? Facade\Type\AnalyticsType::URL_DEBUG : Facade\Type\AnalyticsType::URL_LIVE;
116114
$url .= '?' . http_build_query(['measurement_id' => $this->measurement_id, 'api_secret' => $this->api_secret]);
117115

118116
$body = $this->toArray();
@@ -141,7 +139,7 @@ public function post(): void
141139
$guzzle = new Guzzle();
142140
$res = $guzzle->request('POST', $url, ['json' => $body]);
143141

144-
if (!in_array(($code = $res?->getStatusCode() ?? 0), TypeAnalytics::ACCEPT_RESPONSE_HEADERS)) {
142+
if (!in_array(($code = $res?->getStatusCode() ?? 0), Facade\Type\AnalyticsType::ACCEPT_RESPONSE_HEADERS)) {
145143
Ga4Exception::throwRequestWrongResponceCode($code);
146144
}
147145

src/Event/AddPaymentInfo.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Item;
6-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
76
use AlexWestergaard\PhpGa4\Facade;
87

9-
class AddPaymentInfo extends AbstractEvent implements Facade\Group\AddPaymentInfo
8+
class AddPaymentInfo extends EventHelper implements Facade\Group\AddPaymentInfoFacade
109
{
1110
protected null|string $currency;
1211
protected null|int|float $value;
@@ -72,7 +71,7 @@ public function setPaymentType(null|string $type)
7271
return $this;
7372
}
7473

75-
public function addItem(Item $item)
74+
public function addItem(Facade\Type\ItemType $item)
7675
{
7776
$this->items[] = $item->toArray();
7877
return $this;

src/Event/AddShippingInfo.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Item;
6-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
76
use AlexWestergaard\PhpGa4\Facade;
87

9-
class AddShippingInfo extends AbstractEvent implements Facade\Group\AddShippingInfo
8+
class AddShippingInfo extends EventHelper implements Facade\Group\AddShippingInfoFacade
109
{
1110
protected null|string $currency;
1211
protected null|int|float $value;
@@ -72,7 +71,7 @@ public function setShippingTier(null|string $tier)
7271
return $this;
7372
}
7473

75-
public function addItem(Item $item)
74+
public function addItem(Facade\Type\ItemType $item)
7675
{
7776
$this->items[] = $item->toArray();
7877
return $this;

src/Event/AddToCart.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
6-
use AlexWestergaard\PhpGa4\Facade\Type\Item;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
76
use AlexWestergaard\PhpGa4\Facade;
87

9-
class AddToCart extends AbstractEvent implements Facade\Group\AddToCart
8+
class AddToCart extends EventHelper implements Facade\Group\AddToCartFacade
109
{
1110
protected null|string $currency;
1211
protected null|int|float $value;
@@ -56,7 +55,7 @@ public function setValue(null|int|float $val)
5655
return $this;
5756
}
5857

59-
public function addItem(Item $item)
58+
public function addItem(Facade\Type\ItemType $item)
6059
{
6160
$this->items[] = $item->toArray();
6261
return $this;

src/Event/AddToWishlist.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Item;
6-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
76
use AlexWestergaard\PhpGa4\Facade;
87

9-
class AddToWishlist extends AbstractEvent implements Facade\Group\AddToWishlist
8+
class AddToWishlist extends EventHelper implements Facade\Group\AddToWishlistFacade
109
{
1110
protected null|string $currency;
1211
protected null|int|float $value;
@@ -56,7 +55,7 @@ public function setValue(null|int|float $val)
5655
return $this;
5756
}
5857

59-
public function addItem(Item $item)
58+
public function addItem(Facade\Type\ItemType $item)
6059
{
6160
$this->items[] = $item->toArray();
6261
return $this;

src/Event/BeginCheckout.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Item;
6-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
76
use AlexWestergaard\PhpGa4\Facade;
87

9-
class BeginCheckout extends AbstractEvent implements Facade\Group\BeginCheckout
8+
class BeginCheckout extends EventHelper implements Facade\Group\BeginCheckoutFacade
109
{
1110
protected null|string $currency;
1211
protected null|int|float $value;
@@ -64,7 +63,7 @@ public function setCoupon(null|string $code)
6463
return $this;
6564
}
6665

67-
public function addItem(Item $item)
66+
public function addItem(Facade\Type\ItemType $item)
6867
{
6968
$this->items[] = $item->toArray();
7069
return $this;

src/Event/EarnVirtualCurrency.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
66
use AlexWestergaard\PhpGa4\Facade;
77

8-
class EarnVirtualCurrency extends AbstractEvent implements Facade\Group\EarnVirtualCurrency
8+
class EarnVirtualCurrency extends EventHelper implements Facade\Group\EarnVirtualCurrencyFacade
99
{
1010
protected null|string $virtual_currency_name;
1111
protected null|int|float $value;

src/Event/GenerateLead.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
66
use AlexWestergaard\PhpGa4\Facade;
77

8-
class GenerateLead extends AbstractEvent implements Facade\Group\GenerateLead
8+
class GenerateLead extends EventHelper implements Facade\Group\GenerateLeadFacade
99
{
1010
protected null|string $currency;
1111
protected null|int|float $value;

src/Event/JoinGroup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
66
use AlexWestergaard\PhpGa4\Facade;
77

8-
class JoinGroup extends AbstractEvent implements Facade\Group\JoinGroup
8+
class JoinGroup extends EventHelper implements Facade\Group\JoinGroupFacade
99
{
1010
protected null|string $group_id;
1111

src/Event/LevelUp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace AlexWestergaard\PhpGa4\Event;
44

5-
use AlexWestergaard\PhpGa4\Helper\AbstractEvent;
5+
use AlexWestergaard\PhpGa4\Helper\EventHelper;
66
use AlexWestergaard\PhpGa4\Facade;
77

8-
class LevelUp extends AbstractEvent implements Facade\Group\LevelUp
8+
class LevelUp extends EventHelper implements Facade\Group\LevelUpFacade
99
{
1010
protected null|int $level;
1111
protected null|string $character;

0 commit comments

Comments
 (0)