made some refactoring

This commit is contained in:
2025-07-09 05:28:39 +03:00
parent f76eb08fe0
commit 38676bc9fd
69 changed files with 3075 additions and 355 deletions

View File

@@ -0,0 +1,23 @@
<?php
/**
* @package: patterns
* @author: Yevhen Odynets
* @date: 2025-07-07
* @time: 05:52
*/
declare(strict_types = 1);
// Separate extensible behaviour behind an interface, and flip the dependencies
use Pattern\SOLID\OpenClosed\Figures\AreaCalculator;
use Pattern\SOLID\OpenClosed\Figures\Circle;
use Pattern\SOLID\OpenClosed\Figures\Square;
$circle = new Circle(3);
$square = new Square(2, 5);
$areaCalculator = new AreaCalculator;
/** @noinspection ForgottenDebugOutputInspection */
dump('Circle(3)', $areaCalculator->calculate([$circle, $square]));