-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Steeven Andrian
committed
Apr 29, 2019
1 parent
e4173a4
commit 96bf277
Showing
17 changed files
with
1,197 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Creational\Factory; | ||
|
||
/** | ||
* Class AbstractFactory | ||
* @package O2System\Spl\Patterns\Factory | ||
*/ | ||
abstract class AbstractFactory implements PrototypeInterface | ||
{ | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Creational\Factory; | ||
|
||
/** | ||
* Interface PrototypeInterface | ||
* @package O2System\Spl\Patterns\Creational\Factory | ||
*/ | ||
interface PrototypeInterface | ||
{ | ||
/** | ||
* PrototypeInterface::create | ||
* | ||
* @param array $config | ||
* | ||
* @return mixed | ||
*/ | ||
public function create(array $config = []); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Creational\Singleton; | ||
|
||
/** | ||
* Class AbstractSingleton | ||
* @package O2System\Spl\Patterns\Creational\Singleton | ||
*/ | ||
class AbstractSingleton implements InstanceInterface | ||
{ | ||
/** | ||
* AbstractSingleton::$instance | ||
* | ||
* Singleton Instance | ||
* | ||
* @var static | ||
*/ | ||
protected static $instance; | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* AbstractSingleton::__construct | ||
* | ||
* Protected constructor to prevent creating a new instance of the | ||
* *Singleton* via the `new` operator from outside of this class. | ||
*/ | ||
protected function __construct() | ||
{ | ||
static::$instance =& $this; | ||
} | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* AbstractSingleton::getInstance | ||
* | ||
* Returns the *Singleton* instance of this class. | ||
* | ||
* @return static Returns the instance class | ||
*/ | ||
public static function getInstance() | ||
{ | ||
if (empty(static::$instance)) { | ||
$className = get_called_class(); | ||
|
||
static::$instance = new $className(); | ||
|
||
if (method_exists(static::$instance, '__reconstruct')) { | ||
call_user_func_array([&static::$instance, '__reconstruct'], func_get_args()); | ||
} | ||
} | ||
|
||
return static::$instance; | ||
} | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* AbstractSingleton::__clone | ||
* | ||
* Application of __clone magic method with private visibility to prevent cloning of | ||
* the *Singleton* instance. | ||
* | ||
* @return void | ||
*/ | ||
protected function __clone() | ||
{ | ||
} | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* AbstractSingleton::__wakeup | ||
* | ||
* Application of __wakeup magic method with private visibiliry to prevent unserializing of | ||
* the *Singleton* instance. | ||
* | ||
* @return void | ||
*/ | ||
protected function __wakeup() | ||
{ | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Creational\Singleton; | ||
|
||
/** | ||
* Interface InstanceInterface | ||
* @package O2System\Spl\Patterns\Creational\Singleton | ||
*/ | ||
interface InstanceInterface | ||
{ | ||
/** | ||
* InstanceInterface::getInstance | ||
* | ||
* @return object | ||
*/ | ||
public static function getInstance(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Structural\Assemble; | ||
|
||
/** | ||
* Class AbstractAssemble | ||
* @package O2System\Spl\Patterns\Assemble | ||
*/ | ||
abstract class AbstractAssemble implements CollectorInterface | ||
{ | ||
protected $collection = []; | ||
|
||
public function collect() | ||
{ | ||
|
||
} | ||
|
||
public function &getCollection($offset) | ||
{ | ||
|
||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Structural\Assemble; | ||
|
||
/** | ||
* Interface CollectorInterface | ||
* @package O2System\Spl\Patterns\Assemble | ||
*/ | ||
interface CollectorInterface | ||
{ | ||
/** | ||
* CollectorInterface::collect | ||
* | ||
* Collection process. | ||
* | ||
* @return void | ||
*/ | ||
public function collect(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Structural\Composite; | ||
|
||
/** | ||
* Class AbstractBuilder | ||
* @package O2System\Spl\Patterns\Builder | ||
*/ | ||
abstract class AbstractComposite implements RenderableInterface | ||
{ | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Structural\Composite; | ||
|
||
/** | ||
* Interface RenderableInterface | ||
* @package O2System\Spl\Patterns\Structural\Composite | ||
*/ | ||
interface RenderableInterface | ||
{ | ||
/** | ||
* RenderableInterface::render | ||
* | ||
* @param array $options | ||
* | ||
* @return mixed | ||
*/ | ||
public function render(array $options = []); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Structural\Facade; | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Class AbstractFacade | ||
* @package O2System\Spl\Patterns\Structural\Facade | ||
*/ | ||
abstract class AbstractFacade implements ProcessorInterface | ||
{ | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* This file is part of the O2System Framework package. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @author Steeve Andrian Salim | ||
* @copyright Copyright (c) Steeve Andrian Salim | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
namespace O2System\Spl\Patterns\Structural\Facade; | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
/** | ||
* Interface ProcessorInterface | ||
* @package O2System\Spl\Patterns\Structural\Facade | ||
*/ | ||
interface ProcessorInterface | ||
{ | ||
/** | ||
* ProcessorInterface::process | ||
* | ||
* Processor process. | ||
* | ||
* @return void | ||
*/ | ||
public function process(); | ||
} |
Oops, something went wrong.