Skip to content

Commit

Permalink
Made all setters fluent
Browse files Browse the repository at this point in the history
  • Loading branch information
andy committed Jan 30, 2019
1 parent fde1c4c commit 0900db6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/Message/Request/AbstractPaynlRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,29 @@ public function getApiToken()

/**
* @param string $value
* @return $this
*/
public function setTokenCode($value)
{
$this->setParameter('tokenCode', $value);
return $this->setParameter('tokenCode', $value);
}

/**
* @param string $value
* @return $this
*/
public function setApiToken($value)
{
$this->setParameter('apiToken', $value);
return $this->setParameter('apiToken', $value);
}

/**
* @param string $value
* @return $this
*/
public function setServiceId($value)
{
$this->setParameter('serviceId', $value);
return $this->setParameter('serviceId', $value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Message/Request/CaptureRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CaptureRequest extends AbstractPaynlRequest

/**
* @param string $trackTrace
* @return CaptureRequest
* @return $this
*/
public function setTrackTrace($trackTrace)
{
Expand Down
15 changes: 10 additions & 5 deletions src/Message/Request/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ public function sendData($data)

/**
* @param $value array
* @return $this
*/
public function setStatsData($value)
{
$this->setParameter('statsData', $value);
return $this->setParameter('statsData', $value);
}

/**
Expand All @@ -167,10 +168,11 @@ public function getStatsData()

/**
* @param $value string
* @return $this
*/
public function setInvoiceDate($value)
{
$this->setParameter('invoiceDate', $value);
return $this->setParameter('invoiceDate', $value);
}

/**
Expand All @@ -183,10 +185,11 @@ public function getInvoiceDate()

/**
* @param $value string
* @return $this
*/
public function setDeliveryDate($value)
{
$this->setParameter('deliveryDate', $value);
return $this->setParameter('deliveryDate', $value);
}

/**
Expand All @@ -199,10 +202,11 @@ public function getDeliveryDate()

/**
* @param $value string
* @return $this
*/
public function setCustomerReference($value)
{
$this->setParameter('customerReference', $value);
return $this->setParameter('customerReference', $value);
}

public function getCustomerReference()
Expand All @@ -212,10 +216,11 @@ public function getCustomerReference()

/**
* @param $value int Between -10 and 10
* @return $this
*/
public function setCustomerTrust($value)
{
$this->setParameter('customerTrust', $value);
return $this->setParameter('customerTrust', $value);
}

/**
Expand Down

0 comments on commit 0900db6

Please sign in to comment.