Skip to content

Commit e2ad417

Browse files
committed
Add RequestInterface
1 parent 5242851 commit e2ad417

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

src/Client/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Psr\Log\LoggerAwareInterface;
1414
use Psr\Log\LoggerInterface;
1515
use Psr\Log\NullLogger;
16-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Request;
16+
use Setono\GoogleAnalyticsMeasurementProtocol\Request\RequestInterface;
1717

1818
final class Client implements ClientInterface, LoggerAwareInterface
1919
{
@@ -38,7 +38,7 @@ public function __construct()
3838
$this->logger = new NullLogger();
3939
}
4040

41-
public function sendRequest(Request $request): void
41+
public function sendRequest(RequestInterface $request): void
4242
{
4343
try {
4444
$uri = sprintf(

src/Client/ClientInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Setono\GoogleAnalyticsMeasurementProtocol\Client;
66

7-
use Setono\GoogleAnalyticsMeasurementProtocol\Request\Request;
7+
use Setono\GoogleAnalyticsMeasurementProtocol\Request\RequestInterface;
88

99
interface ClientInterface
1010
{
11-
public function sendRequest(Request $request): void;
11+
public function sendRequest(RequestInterface $request): void;
1212
}

src/Request/Request.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Setono\GoogleAnalyticsEvents\Event\Event;
88

9-
final class Request
9+
final class Request implements RequestInterface
1010
{
1111
/**
1212
* Measurement ID. The identifier for a Data Stream. Found in the Google Analytics UI under:

src/Request/RequestInterface.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Setono\GoogleAnalyticsMeasurementProtocol\Request;
6+
7+
interface RequestInterface
8+
{
9+
public function getMeasurementId(): string;
10+
11+
public function getApiSecret(): string;
12+
13+
public function getPayload(): array;
14+
}

0 commit comments

Comments
 (0)