Added Specification pattern

This commit is contained in:
martin
2013-11-24 22:30:06 +00:00
parent 1e76d98540
commit 6edac3f229
9 changed files with 384 additions and 0 deletions

31
Specification/Item.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
namespace DesignPatterns\Specification;
/**
* An trivial item
*/
class Item
{
protected $price;
/**
* An item must have a price
*
* @param int $price
*/
public function __construct($price)
{
$this->price = $price;
}
/**
* Get the items price
*
* @return int
*/
public function getPrice()
{
return $this->price;
}
}