for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @category Brownie/ExchangeRate
* @author Brownie <[email protected]>
* @license https://opensource.org/licenses/MIT
*/
namespace Brownie\ExchangeRate\Model;
* A currency model.
class Currency
{
* Currency name.
*
* @var string
private $currency;
* Currency code.
private $code;
* Currency number.
* @var int
private $num;
* Sets the input values.
* @param string $currency Currency name.
* @param string $code Currency code.
* @param int $num Currency number.
public function __construct($currency, $code, $num)
$this
->setCurrency($currency)
->setCode($code)
->setNum($num);
}
* Sets currency name.
* Returns the current object.
* @return self
private function setCurrency($currency)
$this->currency = $currency;
return $this;
* Sets currency code.
private function setCode($code)
$this->code = $code;
* Sets currency number.
private function setNum($num)
$this->num = $num;
* Gets currency name.
* @return string
public function getCurrency()
return $this->currency;
* Gets currency code.
public function getCode()
return $this->code;
* Gets currency number.
* @return int
public function getNum()
return $this->num;
* Gets currency data as an associative array.
* @return array
public function toArray()
return [
'currency' => $this->getCurrency(),
'code' => $this->getCode(),
'num' => $this->getNum(),
];