Skip to content

Instantly share code, notes, and snippets.

@mageekguy
mageekguy / eastIterator.php
Last active November 12, 2015 10:21
East iterator
<?php
interface consumer
{
function dataHasName(data $data, name $name);
}
interface aggregator
{
function recipientOfDataConsumerIs(consumer $consumer, recipient $recipient);
@mageekguy
mageekguy / gist:f873ffaf0cdc5f69d108
Created May 12, 2015 15:20
Extends and private properties are in a boat…
<?php
namespace
{
class abscisse
{
private $value;
function __construct($value)
{
@mageekguy
mageekguy / gist:f96066782bf2d742e75b
Last active August 29, 2015 14:20
An east pizza!
<?php
namespace world;
use
cli
;
abstract class human
{
@mageekguy
mageekguy / gist:6f7339723c12b75bfb2d
Last active August 29, 2015 14:19
A teenager want alcool in east oriented manner!
<?php
/*
Un barman peut servir un verre d'alcool à un client :
1) s'il a plus de 18 ans
2) s'il dispose du ou des alcools nécessaires (dans le cas d'un cocktail) en stock.
*/
interface barman
{
@mageekguy
mageekguy / gist:6d68dc736f19108732a6
Created April 23, 2015 08:14
HTTP Request matcher
<?php
namespace east\request;
interface http
{
function methodIsAskedByHttpRequestMatcher(http\matcher $matcher);
function pathIsAskedByHttpRequestMatcher(http\matcher $matcher);
}
@mageekguy
mageekguy / gist:a0df0ac63dcda686da0d
Created April 8, 2015 08:38
the-4-rules-of-east-oriented-code-rule-4
<?php
abstract class data
{
private
$value
;
function __construct($value)
{
@mageekguy
mageekguy / gist:30598b826bdd93b60774
Last active August 29, 2015 14:18
East oriented movie lister
<?php
namespace east\movie\library\finder;
use
east,
east\movie,
east\movie\library
;
@mageekguy
mageekguy / gist:77a1f5a08d22fbd00554
Last active August 29, 2015 14:17
east oriented mailqueue management [WIP]
<?php
namespace api\data;
final class data
{
private
$value
;
@mageekguy
mageekguy / gist:0bd0a5be9632ff1b62e0
Last active August 29, 2015 14:17
Immutability vs. mutability
<?php
interface console
{
function newData($data);
function noMoreData();
function dataGeneratorIs(dataGenerator $dataGenerator);
}
interface dataGenerator
@mageekguy
mageekguy / gist:f6e78ae0c6c8bbd0b92b
Last active August 29, 2015 14:17
east oriented game of life
<?php
namespace gol;
interface cell
{
function isAtAbscissaAndOrdinateInView($x, $y, view $view);
function isAtAbscissaAndOrdinateInGrid($x, $y, grid $grid);
function cellNeighborIs(cell $cell);
function cellNeighborIsDead();