more simple an concise example of AbstractFactory

This commit is contained in:
Dominik Liebler
2019-02-25 21:48:29 +01:00
parent dc64f24600
commit 8dd39599e7
14 changed files with 159 additions and 167 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace DesignPatterns\Creational\AbstractFactory;
class DigitalProduct implements Product
{
/**
* @var int
*/
private $price;
public function __construct(int $price)
{
$this->price = $price;
}
public function calculatePrice(): int
{
return $this->price;
}
}