Adapter
This commit is contained in:
@@ -22,4 +22,4 @@ interface AbstractFactoryInterface
|
||||
* @return PackageInterface
|
||||
*/
|
||||
public function createPackage(): PackageInterface;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace Pattern\Creational\AbstractFactory;
|
||||
interface DeliveryServiceInterface
|
||||
{
|
||||
public function sendPackage(PackageInterface $package): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class JustinDeliveryService implements DeliveryServiceInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Sending package via Justin...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class JustinPackage implements PackageInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump('Checking package from Justin...');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ class MeestDeliveryService implements DeliveryServiceInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Sending package via Meest...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class MeestPackage implements PackageInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump('Checking package from Meest...');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class NovapostDeliveryService implements DeliveryServiceInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Sending package via Novapost...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class NovapostPackage implements PackageInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump('Checking package from Novapost...');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace Pattern\Creational\AbstractFactory;
|
||||
interface PackageInterface
|
||||
{
|
||||
public function getConsist(): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class UkrpostDeliveryService implements DeliveryServiceInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Sending package via Ukrpost...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class UkrpostPackage implements PackageInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump('Checking package from Ukrpost...');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class CashPayment implements PaymentInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Cash payment success, amount: {$order->getSum()} ₴");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class IngPayment implements PaymentInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("ING Bank payment success, amount: {$order->getSum()} ₴");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ class IngPaymentFactory implements PaymentFactoryInterface
|
||||
{
|
||||
return new IngPayment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class OtpPayment implements PaymentInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Otp Bank payment success, amount: {$order->getSum()} ₴");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ class OtpPaymentFactory implements PaymentFactoryInterface
|
||||
{
|
||||
return new OtpPayment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace Pattern\Creational\FactoryMethod;
|
||||
interface PaymentInterface
|
||||
{
|
||||
public function pay(Order $order): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class PrivatPayment implements PaymentInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Privatbank payment success, amount: {$order->getSum()} ₴");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ class RaiffeisenPayment implements PaymentInterface
|
||||
/** @noinspection ForgottenDebugOutputInspection */
|
||||
dump("Raiffeisen Bank payment success, amount: {$order->getSum()} ₴");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ class RaiffeisenPaymentFactory implements PaymentFactoryInterface
|
||||
{
|
||||
return new RaiffeisenPayment();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace Pattern\Creational\Singleton;
|
||||
interface Loggable
|
||||
{
|
||||
public static function getInstance(): static;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,5 +101,3 @@ class Singleton
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user