Skip to content

Commit

Permalink
- Reformat all class with Symfony formatting style
Browse files Browse the repository at this point in the history
- Add Contacts PHPDocs
  • Loading branch information
Siavash Habil committed May 7, 2020
1 parent c731855 commit c38005b
Show file tree
Hide file tree
Showing 9 changed files with 448 additions and 201 deletions.
42 changes: 22 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"name": "habil/resellerclub-php-api",
"description": "PHP SDK for ResellerClub API",
"license": "MIT",
"authors": [
{
"name": "Siavash Habil",
"email": "[email protected]"
}
],
"require": {
"ext-curl": "*",
"guzzlehttp/guzzle": "~6"
},
"autoload": {
"psr-4": {
"habil\\ResellerClub\\": "src/"
}
},
"config": {
"bin-dir": "bin"
"name": "habil/resellerclub-php-api",
"description": "PHP SDK for ResellerClub API",
"license": "MIT",
"authors": [
{
"name": "Siavash Habil",
"email": "[email protected]"
}
],
"require": {
"ext-curl": "*",
"guzzlehttp/guzzle": "~6",
"ext-simplexml": "*",
"ext-json": "*"
},
"autoload": {
"psr-4": {
"habil\\ResellerClub\\": "src/"
}
},
"config": {
"bin-dir": "bin"
}
}
79 changes: 40 additions & 39 deletions src/APIs/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* Class Actions
*
* @package habil\ResellerClub\APIs
*/
class Actions
Expand Down Expand Up @@ -51,39 +52,6 @@ public function current(
return $this->get('search-current', $dataToSend);
}

/**
* @param array|null $eaqIds Array of Integers
* @param array|null $orderIds Array of Integers
* @param array|null $entityTypeIds Array of Integers
* @param array|null $actionStatus Array of Strings
* @param array|null $actionType Array of Strings
* @param int $noOfRecords
* @param int $pageNo
*
* @return Exception|array
*/
public function archived(
array $eaqIds = [],
array $orderIds = [],
array $entityTypeIds = [],
array $actionStatus = [],
array $actionType = [],
$noOfRecords = 10,
$pageNo = 1
) {
$dataToSend = $this->formatData(
$eaqIds,
$orderIds,
$entityTypeIds,
$actionStatus,
$actionType,
$noOfRecords,
$pageNo
);

return $this->get('search-archived', $dataToSend);
}

/**
* @param array $eaqIds
* @param array $orderIds
Expand All @@ -106,29 +74,62 @@ private function formatData(
) {
$dataToSend = [
'no-of-records' => $noOfRecords,
'page-no' => $pageNo
'page-no' => $pageNo,
];

if (!empty($eaqIds)) {
if ( ! empty($eaqIds)) {
$dataToSend['eaq-id'] = $eaqIds;
}

if (!empty($orderIds)) {
if ( ! empty($orderIds)) {
$dataToSend['order-id'] = $orderIds;
}

if (!empty($entityTypeIds)) {
if ( ! empty($entityTypeIds)) {
$dataToSend['entity-type-id'] = $entityTypeIds;
}

if (!empty($actionStatus)) {
if ( ! empty($actionStatus)) {
$dataToSend['action-status'] = $actionStatus;
}

if (!empty($actionType)) {
if ( ! empty($actionType)) {
$dataToSend['action-type'] = $actionType;
}

return $dataToSend;
}

/**
* @param array|null $eaqIds Array of Integers
* @param array|null $orderIds Array of Integers
* @param array|null $entityTypeIds Array of Integers
* @param array|null $actionStatus Array of Strings
* @param array|null $actionType Array of Strings
* @param int $noOfRecords
* @param int $pageNo
*
* @return Exception|array
*/
public function archived(
array $eaqIds = [],
array $orderIds = [],
array $entityTypeIds = [],
array $actionStatus = [],
array $actionType = [],
$noOfRecords = 10,
$pageNo = 1
) {
$dataToSend = $this->formatData(
$eaqIds,
$orderIds,
$entityTypeIds,
$actionStatus,
$actionType,
$noOfRecords,
$pageNo
);

return $this->get('search-archived', $dataToSend);
}
}
Loading

0 comments on commit c38005b

Please sign in to comment.