Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Small changes relative to PR
  • Loading branch information
Marc Serrat authored and Marc Serrat committed Mar 17, 2020
commit 6ae2db25b6246e7200a4ed43940614ef31a57ebd
1 change: 1 addition & 0 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class Constants
const GENERIC_CONVERSATION_ERROR_MESSAGE = 'Error while saving result on conversation for request ';
const SUBSCRIPTIONS_ASSETS_PATH = '/subscriptions/assets/';
const SUBSCRIPTIONS_REQUESTS_PATH = '/subscriptions/requests/';
const ASSETS_PATH = '/assets/';
}
2 changes: 1 addition & 1 deletion src/FulfillmentAutomation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function dispatchTierConfig($tierConfigRequest)
if ($this->config->products && !in_array(
$tierConfigRequest->configuration->product->id,
$this->config->products
)) {
)) {
return 'Invalid product';
}

Expand Down
7 changes: 6 additions & 1 deletion src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ public static function modelize($key, $value)
switch (gettype($value)) {
case 'object':

$namespaces = ['\Connect\\', '\Connect\Usage\\', '\Connect\Product\Capabilities\\', 'Connect\Product\Actions\\', 'Connect\Subscription\\'];
$namespaces = ['\Connect\\',
'\Connect\Usage\\',
'\Connect\Product\Capabilities\\',
'Connect\Product\Actions\\',
'Connect\Subscription\\'
];

/**
* if the item is an object search if there are any model that match with it:
Expand Down
10 changes: 5 additions & 5 deletions src/Modules/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function listAssets($filters = null)
: explode(',', $this->config->products));
}

$body = $this->sendRequest('GET', '/assets' . $query->compile());
$body = $this->sendRequest('GET', \Connect\Constants::ASSETS_PATH . $query->compile());

/** @var Asset[] $models */
return Model::modelize('assets', json_decode($body));
Expand All @@ -72,7 +72,7 @@ public function listAssets($filters = null)
*/
public function getAssetById($assetID)
{
$body = $this->sendRequest('GET', '/assets/' . $assetID);
$body = $this->sendRequest('GET', \Connect\Constants::ASSETS_PATH . $assetID);
/** @var Asset $model */
return Model::modelize('asset', json_decode($body));
}
Expand All @@ -91,7 +91,7 @@ public function listProducts($filters = null)
$query = new \Connect\RQL\Query();
}

$body = $this->sendRequest('GET', '/products' . $query->compile());
$body = $this->sendRequest('GET', \Connect\Constants::PRODUCTS_PATH . $query->compile());

/** @var \Connect\Product[] $models */
return Model::modelize('products', json_decode($body));
Expand All @@ -105,7 +105,7 @@ public function listProducts($filters = null)

public function getProduct($productID)
{
$body = $this->sendRequest('GET', '/products/' . $productID);
$body = $this->sendRequest('GET', \Connect\Constants::PRODUCTS_PATH . $productID);
/** @var Product $model */
return Model::modelize('product', json_decode($body));
}
Expand All @@ -131,7 +131,7 @@ public function listTierConfigs($filters = null)
: explode(',', $this->config->products));
}

$body = $this->sendRequest('GET', '/tier/configs' . $query->compile());
$body = $this->sendRequest('GET', \Connect\Constants::TIER_CONFIG_PATH . $query->compile());

/** @var \Connect\TierConfig[] $models */
return Model::modelize('tierConfig', json_decode($body));
Expand Down