for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Arcanedev\Currencies\Entities;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Jsonable;
/**
* Class Rate
*
* @package Arcanedev\Currencies\Entities
* @author ARCANEDEV <[email protected]>
*/
class Rate implements Arrayable, Jsonable
{
/* ------------------------------------------------------------------------------------------------
| Properties
| ------------------------------------------------------------------------------------------------
* @var string
public $from;
public $to;
* @var double
public $ratio;
| Constructor
* Rate constructor.
* @param string $from
* @param string $to
* @param double $ratio
public function __construct($from, $to, $ratio)
$this->from = $from;
$this->to = $to;
$this->ratio = $ratio;
}
| Main Functions
* Make a rate instance.
* @return self
public static function make($from, $to, $ratio)
return new self($from, $to, $ratio);
* Get the instance as an array.
* @return array
public function toArray()
return [
'from' => $this->from,
'to' => $this->to,
'ratio' => $this->ratio,
];
* Convert the object to its JSON representation.
* @param int $options
* @return string
public function toJson($options = 0)
return json_encode($this->toArray(), $options);