Skip to content

Commit

Permalink
Release v2.x - Version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hungnguyenhp committed Sep 26, 2021
1 parent 4a058d0 commit 8fa9608
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
php-versions: [ '5.6', '7.0', '7.1', '7.2', '7.3' , '7.4', '8.0' ]
php-versions: [ '7.0', '7.1', '7.2', '7.3' , '7.4', '8.0' ]
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.0",
"ext-json": "*",
"omnisend/php-sdk": "^1.2",
"nguyenanhung/my-debug": "^2.0"
"nguyenanhung/my-debug": "^3.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion helpers/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Function arrayToObject
*
* @param array $array
* @param false $strToLower
* @param bool $strToLower
*
* @return array|false|\stdClass
* @author : 713uk13m <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion src/BaseCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class BaseCore implements Environment
* @author : 713uk13m <[email protected]>
* @copyright: 713uk13m <[email protected]>
*/
public function __construct($options = array())
public function __construct(array $options = array())
{
$this->options = $options;
$this->logger = new Logger();
Expand Down
6 changes: 3 additions & 3 deletions src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
interface Environment
{
const VERSION = '1.0.3';
const VERSION = '2.0.0';
const AUTHOR_NAME = 'Hung Nguyen';
const AUTHOR_EMAIL = '[email protected]';
const AUTHOR_URL = 'https://nguyenanhung.com';
Expand All @@ -28,10 +28,10 @@ interface Environment
/**
* Function getVersion
*
* @return mixed
* @return string
* @author : 713uk13m <[email protected]>
* @copyright: 713uk13m <[email protected]>
* @time : 08/11/2021 41:29
*/
public function getVersion();
public function getVersion(): string;
}
60 changes: 30 additions & 30 deletions src/Services/Omnisend.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Omnisend extends BaseCore
* @author : 713uk13m <[email protected]>
* @copyright: 713uk13m <[email protected]>
*/
public function __construct($options = array())
public function __construct(array $options = array())
{
parent::__construct($options);
$this->logger->setLoggerSubPath(__CLASS__);
Expand All @@ -53,7 +53,7 @@ public function __construct($options = array())
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 58:02
*/
public function setApiKey($key)
public function setApiKey($key): Omnisend
{
$this->apiKey = $key;

Expand All @@ -68,7 +68,7 @@ public function setApiKey($key)
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 58:10
*/
public function getApiKey()
public function getApiKey(): string
{
return $this->apiKey;
}
Expand All @@ -81,7 +81,7 @@ public function getApiKey()
* @copyright: 713uk13m <[email protected]>
* @time : 09/08/2021 39:16
*/
public function getMethod()
public function getMethod(): string
{
return $this->method;
}
Expand All @@ -96,7 +96,7 @@ public function getMethod()
* @copyright: 713uk13m <[email protected]>
* @time : 09/08/2021 40:04
*/
public function setMethod($method = 'POST')
public function setMethod(string $method = 'POST'): Omnisend
{
$method = strtoupper($method);
$this->method = $method;
Expand All @@ -112,7 +112,7 @@ public function setMethod($method = 'POST')
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 11:17
*/
public function withPostRequest()
public function withPostRequest(): Omnisend
{
$this->method = 'POST';

Expand All @@ -127,7 +127,7 @@ public function withPostRequest()
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 11:12
*/
public function withGetRequest()
public function withGetRequest(): Omnisend
{
$this->method = 'GET';

Expand All @@ -142,7 +142,7 @@ public function withGetRequest()
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 11:09
*/
public function withPutRequest()
public function withPutRequest(): Omnisend
{
$this->method = 'PUT';

Expand All @@ -157,7 +157,7 @@ public function withPutRequest()
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 11:05
*/
public function withPatchRequest()
public function withPatchRequest(): Omnisend
{
$this->method = 'PATCH';

Expand All @@ -172,7 +172,7 @@ public function withPatchRequest()
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 11:02
*/
public function withDeleteRequest()
public function withDeleteRequest(): Omnisend
{
$this->method = 'DELETE';

Expand All @@ -187,7 +187,7 @@ public function withDeleteRequest()
* @copyright: 713uk13m <[email protected]>
* @time : 09/09/2021 10:59
*/
public function withOptionsRequest()
public function withOptionsRequest(): Omnisend
{
$this->method = 'OPTIONS';

Expand Down Expand Up @@ -238,7 +238,7 @@ public function init()
public function contracts(array $params = array(), array $body = array())
{
$endpoint = 'contacts';
$id = isset($params['contractId']) ? $params['contractId'] : null;
$id = $params['contractId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down Expand Up @@ -283,11 +283,11 @@ public function contracts(array $params = array(), array $body = array())
*
* @see https://api-docs.omnisend.com/v3/carts
*/
public function carts($params = array(), $body = array())
public function carts(array $params = array(), array $body = array())
{
$endpoint = 'carts';
$id = isset($params['cartId']) ? $params['cartId'] : null;
$productId = isset($params['productId']) ? $params['productId'] : null;
$id = $params['cartId'] ?? null;
$productId = $params['productId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down Expand Up @@ -359,10 +359,10 @@ public function carts($params = array(), $body = array())
*
* @see https://api-docs.omnisend.com/v3/orders
*/
public function orders($params = array(), $body = array())
public function orders(array $params = array(), array $body = array())
{
$endpoint = 'orders';
$id = isset($params['orderId']) ? $params['orderId'] : null;
$id = $params['orderId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down Expand Up @@ -416,11 +416,11 @@ public function orders($params = array(), $body = array())
*
* @see https://api-docs.omnisend.com/v3/campaigns
*/
public function campaigns($params = array(), $body = array())
public function campaigns(array $params = array(), array $body = array())
{
$endpoint = 'campaigns';
$id = isset($params['campaignId']) ? $params['campaignId'] : null;
$contactId = isset($params['contactId']) ? $params['contactId'] : null;
$id = $params['campaignId'] ?? null;
$contactId = $params['contactId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down Expand Up @@ -469,10 +469,10 @@ public function campaigns($params = array(), $body = array())
*
* @see https://api-docs.omnisend.com/v3/products
*/
public function products($params = array(), $body = array())
public function products(array $params = array(), array $body = array())
{
$endpoint = 'products';
$id = isset($params['productId']) ? $params['productId'] : null;
$id = $params['productId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down Expand Up @@ -523,10 +523,10 @@ public function products($params = array(), $body = array())
*
* @see https://api-docs.omnisend.com/v3/categories
*/
public function categories($params = array(), $body = array())
public function categories(array $params = array(), array $body = array())
{
$endpoint = 'products';
$id = isset($params['categoryId']) ? $params['categoryId'] : null;
$id = $params['categoryId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down Expand Up @@ -577,10 +577,10 @@ public function categories($params = array(), $body = array())
*
* @see https://api-docs.omnisend.com/v3/events
*/
public function events($params = array(), $body = array())
public function events(array $params = array(), array $body = array())
{
$endpoint = 'events';
$id = isset($params['eventId']) ? $params['eventId'] : null;
$id = $params['eventId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down Expand Up @@ -630,7 +630,7 @@ public function events($params = array(), $body = array())
*
* @see https://api-docs.omnisend.com/v3/events
*/
public function event($params = array(), $body = array())
public function event(array $params = array(), array $body = array())
{
return $this->events($params, $body);
}
Expand All @@ -649,11 +649,11 @@ public function event($params = array(), $body = array())
*
* @see https://api-docs.omnisend.com/v3/batches
*/
public function batches($params = array(), $body = array(), $item = false)
public function batches(array $params = array(), array $body = array(), bool $item = false)
{
$endpoint = 'batches';
$id = isset($params['batchId']) ? $params['batchId'] : null;
$itemId = isset($params['itemId']) ? $params['itemId'] : null;
$id = $params['batchId'] ?? null;
$itemId = $params['itemId'] ?? null;
$omnisend = $this->init();
if ($omnisend === null) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait Version
* @copyright: 713uk13m <[email protected]>
* @time : 08/11/2021 43:59
*/
public function getVersion()
public function getVersion(): string
{
return self::VERSION;
}
Expand Down

0 comments on commit 8fa9608

Please sign in to comment.