mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 09:42:24 +01:00
31 lines
429 B
PHP
31 lines
429 B
PHP
<?php
|
|
namespace DesignPatterns\Behavioral\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;
|
|
}
|
|
}
|