PHP7 Specification

This commit is contained in:
Dominik Liebler
2016-09-22 12:54:03 +02:00
parent 09797dd553
commit ce1b53847d
12 changed files with 134 additions and 324 deletions

View File

@@ -2,29 +2,19 @@
namespace DesignPatterns\Behavioral\Specification;
/**
* An trivial item.
*/
class Item
{
protected $price;
/**
* An item must have a price.
*
* @param int $price
* @var float
*/
public function __construct($price)
private $price;
public function __construct(float $price)
{
$this->price = $price;
}
/**
* Get the items price.
*
* @return int
*/
public function getPrice()
public function getPrice(): float
{
return $this->price;
}