This commit is contained in:
2025-07-03 23:46:08 +03:00
parent 7fe2402ff3
commit ab4499a305
39 changed files with 453 additions and 56 deletions

View File

@@ -22,4 +22,4 @@ interface AbstractFactoryInterface
* @return PackageInterface
*/
public function createPackage(): PackageInterface;
}
}

View File

@@ -14,4 +14,4 @@ namespace Pattern\Creational\AbstractFactory;
interface DeliveryServiceInterface
{
public function sendPackage(PackageInterface $package): void;
}
}

View File

@@ -18,4 +18,4 @@ class JustinDeliveryService implements DeliveryServiceInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Sending package via Justin...");
}
}
}

View File

@@ -18,4 +18,4 @@ class JustinPackage implements PackageInterface
/** @noinspection ForgottenDebugOutputInspection */
dump('Checking package from Justin...');
}
}
}

View File

@@ -19,4 +19,4 @@ class MeestDeliveryService implements DeliveryServiceInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Sending package via Meest...");
}
}
}

View File

@@ -18,4 +18,4 @@ class MeestPackage implements PackageInterface
/** @noinspection ForgottenDebugOutputInspection */
dump('Checking package from Meest...');
}
}
}

View File

@@ -18,4 +18,4 @@ class NovapostDeliveryService implements DeliveryServiceInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Sending package via Novapost...");
}
}
}

View File

@@ -18,4 +18,4 @@ class NovapostPackage implements PackageInterface
/** @noinspection ForgottenDebugOutputInspection */
dump('Checking package from Novapost...');
}
}
}

View File

@@ -14,4 +14,4 @@ namespace Pattern\Creational\AbstractFactory;
interface PackageInterface
{
public function getConsist(): void;
}
}

View File

@@ -18,4 +18,4 @@ class UkrpostDeliveryService implements DeliveryServiceInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Sending package via Ukrpost...");
}
}
}

View File

@@ -18,4 +18,4 @@ class UkrpostPackage implements PackageInterface
/** @noinspection ForgottenDebugOutputInspection */
dump('Checking package from Ukrpost...');
}
}
}

View File

@@ -18,4 +18,4 @@ class CashPayment implements PaymentInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Cash payment success, amount: {$order->getSum()}");
}
}
}

View File

@@ -18,4 +18,4 @@ class IngPayment implements PaymentInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("ING Bank payment success, amount: {$order->getSum()}");
}
}
}

View File

@@ -17,4 +17,4 @@ class IngPaymentFactory implements PaymentFactoryInterface
{
return new IngPayment();
}
}
}

View File

@@ -18,4 +18,4 @@ class OtpPayment implements PaymentInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Otp Bank payment success, amount: {$order->getSum()}");
}
}
}

View File

@@ -17,4 +17,4 @@ class OtpPaymentFactory implements PaymentFactoryInterface
{
return new OtpPayment();
}
}
}

View File

@@ -14,4 +14,4 @@ namespace Pattern\Creational\FactoryMethod;
interface PaymentInterface
{
public function pay(Order $order): void;
}
}

View File

@@ -18,4 +18,4 @@ class PrivatPayment implements PaymentInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Privatbank payment success, amount: {$order->getSum()}");
}
}
}

View File

@@ -18,4 +18,4 @@ class RaiffeisenPayment implements PaymentInterface
/** @noinspection ForgottenDebugOutputInspection */
dump("Raiffeisen Bank payment success, amount: {$order->getSum()}");
}
}
}

View File

@@ -17,4 +17,4 @@ class RaiffeisenPaymentFactory implements PaymentFactoryInterface
{
return new RaiffeisenPayment();
}
}
}

View File

@@ -14,4 +14,4 @@ namespace Pattern\Creational\Singleton;
interface Loggable
{
public static function getInstance(): static;
}
}

View File

@@ -9,6 +9,7 @@
//phpcs:ignore
declare(strict_types = 1);
namespace Pattern\Creational\Singleton;
class Single extends Singleton implements SingleInterface
@@ -18,4 +19,4 @@ class Single extends Singleton implements SingleInterface
/** @noinspection ForgottenDebugOutputInspection */
dump(__METHOD__);
}
}
}

View File

@@ -101,5 +101,3 @@ class Singleton
return $this;
}
}