return ArrayCollection instead of array list
This commit is contained in:
parent
e7d6ef416f
commit
c2e0717445
10
src/Entities/SubscriberList.php
Normal file
10
src/Entities/SubscriberList.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace D3\KlicktippPhpClient\Entities;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
class SubscriberList extends ArrayCollection
|
||||
{
|
||||
|
||||
}
|
10
src/Entities/SubscriptionList.php
Normal file
10
src/Entities/SubscriptionList.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace D3\KlicktippPhpClient\Entities;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
class SubscriptionList extends ArrayCollection
|
||||
{
|
||||
|
||||
}
|
10
src/Entities/TagList.php
Normal file
10
src/Entities/TagList.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace D3\KlicktippPhpClient\Entities;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
class TagList extends ArrayCollection
|
||||
{
|
||||
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
namespace D3\KlicktippPhpClient\Resources;
|
||||
|
||||
use D3\KlicktippPhpClient\Entities\Subscriber as SubscriberEntity;
|
||||
use D3\KlicktippPhpClient\Entities\SubscriberList;
|
||||
use D3\KlicktippPhpClient\Exceptions\BaseException;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
@ -12,12 +13,14 @@ class Subscriber extends Model
|
||||
/**
|
||||
* @throws BaseException|GuzzleException
|
||||
*/
|
||||
public function index(): array
|
||||
public function index(): SubscriberList
|
||||
{
|
||||
return $this->connection->requestAndParse(
|
||||
$data = $this->connection->requestAndParse(
|
||||
'GET',
|
||||
'subscriber'
|
||||
);
|
||||
|
||||
return new SubscriberList($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace D3\KlicktippPhpClient\Resources;
|
||||
|
||||
use D3\KlicktippPhpClient\Entities\Subscription as SubscriptionEntity;
|
||||
use D3\KlicktippPhpClient\Entities\SubscriptionList;
|
||||
use D3\KlicktippPhpClient\Exceptions\BaseException;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
@ -12,12 +13,14 @@ class SubscriptionProcess extends Model
|
||||
/**
|
||||
* @throws BaseException|GuzzleException
|
||||
*/
|
||||
public function index(): array
|
||||
public function index(): SubscriptionList
|
||||
{
|
||||
return $this->connection->requestAndParse(
|
||||
$data = $this->connection->requestAndParse(
|
||||
'GET',
|
||||
'list'
|
||||
);
|
||||
|
||||
return new SubscriptionList($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace D3\KlicktippPhpClient\Resources;
|
||||
|
||||
use D3\KlicktippPhpClient\Entities\Tag as TagEntity;
|
||||
use D3\KlicktippPhpClient\Entities\TagList;
|
||||
use D3\KlicktippPhpClient\Exceptions\BaseException;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
@ -12,12 +13,14 @@ class Tag extends Model
|
||||
/**
|
||||
* @throws BaseException|GuzzleException
|
||||
*/
|
||||
public function index(): array
|
||||
public function index(): TagList
|
||||
{
|
||||
return $this->connection->requestAndParse(
|
||||
$data = $this->connection->requestAndParse(
|
||||
'GET',
|
||||
'tag'
|
||||
);
|
||||
|
||||
return new TagList($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user