Factory Method
This commit is contained in:
22
src/Pattern/Creational/FactoryMethod/Order.php
Normal file
22
src/Pattern/Creational/FactoryMethod/Order.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package: patterns
|
||||
* @author: Yevhen Odynets
|
||||
* @date: 2025-07-03
|
||||
* @time: 12:08
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace Pattern\Creational\FactoryMethod;
|
||||
|
||||
final readonly class Order
|
||||
{
|
||||
public function __construct(private float $sum) {}
|
||||
|
||||
public function getSum(): float
|
||||
{
|
||||
return $this->sum;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user