This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Özelliğe ait asıl sınıf | |
class Originator | |
{ | |
private $id; | |
private $name; | |
public function __construct($id, $name) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface MediatorInterface | |
{ | |
public function notify(object $sender, string $event); | |
} | |
//Mediator | |
class ConcreteMediator implements MediatorInterface | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface StackIteratorInterface | |
{ | |
public function first(); | |
public function next(); | |
public function current(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//İstemci tarafından alınan bilgiyi ve çevirilmiş olan bilgiyi tutar. | |
class Context | |
{ | |
public string $input; | |
public int $total; | |
} | |
//RoleExpression. Ne tür bir çevirme işlemleri gerçekleştirilecekse fonksiyonlar belirlenir. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Command //Yapılabilecek işlevler | |
interface CommandInterface | |
{ | |
public function execute(); | |
} | |
//Command A //Özelliğe ait basit A işlevi | |
class FeatureACommand implements CommandInterface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Zinciri yapabilmek için gereklilikler zorunlu değildir yazılması. | |
*/ | |
interface Handler | |
{ | |
public function addChain(Handler $handler): Handler; //Handler'la alakalı sınıfları zincire ekleyebilmek için | |
public function next($request); //sıradaki sınıfı çağırması için |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Flyweight | |
abstract class FeatureAbstract | |
{ | |
//Intrinsic - Ortak paylaşılan veriler | |
protected $pi = 3.14; //Aynı değere sahip veriler aynı yerden çekilir. | |
protected $year = 2022; | |
//Extrinsic - sınıfa göre değişkenlik gösteren veriler. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Component(Bileşen) - Özellik | |
interface NotificationInterface | |
{ | |
public function send(); | |
} | |
//ConcreteComponent - Özelliğe ait basit sınıf. | |
class Notification implements NotificationInterface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
enum Position { | |
case MANAGER; | |
case TEAM_LEADER; | |
case BACKEND_TEAM_LEADER; | |
case FRONTEND_TEAM_LEADER; | |
case DEVELOPER; | |
case TESTER; | |
case DESIGNER; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Özellik 1 //Bridge 1 | |
interface ShapeInterface | |
{ | |
public function draw(); | |
} | |
//Dikdortgen sekli //Özellik 1 varsayonu 1 //ImplementationA | |
class Rectangle implements ShapeInterface |