for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Betfair\Model\PlaceOrders;
use Betfair\Exception\ModelException;
class LimitOrder
{
/**
* @param float $size
* @param float $price
* @param string $persistenceType
*/
public function __construct($size, $price, $persistenceType)
$this->size = $size;
$this->price = $price;
$this->setValidPersistenceType($persistenceType);
}
/** @var float */
private $size;
private $price;
/** @var PersistenceType */
private $persistenceType;
private function setValidPersistenceType($persistenceType)
if(!in_array($persistenceType, PersistenceType::toArray())) {
throw new ModelException(
sprintf("Not valid persistence type %s. Valid ones are %s",
$persistenceType,
implode(",", PersistenceType::toArray())
));
$this->persistenceType = $persistenceType;
* @return \Betfair\Model\PlaceOrders\PersistenceType
public function getPersistenceType()
return $this->persistenceType;
* @return float
public function getPrice()
return $this->price;
public function getSize()
return $this->size;