Skip to content

Instantly share code, notes, and snippets.

🌐
OSS Contributor

Alexander Miertsch codeliner

🌐
OSS Contributor
Block or report user

Report or block codeliner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@codeliner
codeliner / bc_interaction_sample.php
Created Apr 15, 2014
Sample to show interaction between two bounded contexts
View bc_interaction_sample.php
<?php
/**
* This file is an example gist to show the interaction between an ArticleContext and a LikeContext
*
* @example:
*
* We have to bounded contexts: ArticleContext and LikeContext and show the simplified process of following use case:
*
* In order to create a valid article Like, I should validate the article ID given to the LikeContext.
*
@codeliner
codeliner / ObjectSelect.php
Last active Aug 29, 2015
DoctrineModule\Form\ObjectSelect fix to define custom value property
View ObjectSelect.php
<?php
namespace Application\Form\Element;
use Application\Form\Element\ObjectSelect\Proxy;
use DoctrineModule\Form\Element\ObjectSelect as DoctrineObjectSelect;
/**
* Class ObjectSelect
*
* Extends doctrines ObjectSelect to provide own Proxy implementation
@codeliner
codeliner / DDD_avoid_large_cluster_example.php
Created Jul 7, 2015
This example illustrates modelling small aggregates instead of a large cluster: See discussion: https://groups.google.com/forum/#!topic/dddinphp/WBKuPAT0OS8
View DDD_avoid_large_cluster_example.php
<?php
/*
* This example illustrates modelling the following use cases:
*
* - A user can write and publish an article, with the title, description.etc.
* - X users can then respond to said article by posting comments,
* - and responding to one another.
* - it is very common for an Article to be 'locked' when it becomes older.
*
* Note: The example is an incomplete draft.
@codeliner
codeliner / DoctrineSharedConnectionAdapter.php
Last active Feb 14, 2016
An example of a decorated Prooph\EventStore\Adapter\DoctrineEventStoreAdapter that uses a shared database connection between write and read model. This can be useful if you want to avoid eventual consistency issues (only possible if same database is used for write/read).
View DoctrineSharedConnectionAdapter.php
<?php
namespace App\Infrastructure\EventStore;
use DateTimeInterface;
use Iterator;
use Prooph\EventStore\Adapter\Adapter;
use Prooph\EventStore\Adapter\Doctrine\DoctrineEventStoreAdapter;
use Prooph\EventStore\Exception\StreamNotFoundException;
use Prooph\EventStore\Stream\Stream;
@codeliner
codeliner / MongoConnection.php
Last active Apr 6, 2017
prooph MongoEventStore v7
View MongoConnection.php
<?php
declare(strict_types = 1);
namespace Acme\Infrastructure\MongoDb;
use MongoDB\Client;
use MongoDB\Collection;
class MongoConnection
@codeliner
codeliner / Message.php
Last active Dec 10, 2016
Single prooph message class
View Message.php
<?php
declare(strict_types = 1);
namespace Acme\Model;
use Prooph\Common\Messaging\DomainMessage;
use Prooph\Common\Messaging\Message as ProophMessage;
class Message extends DomainMessage
{
@codeliner
codeliner / CargoRouteListner.php
Last active Apr 27, 2019
getprooph.org sample snippet
View CargoRouteListner.php
<?php
declare(strict_types=1);
class CargoRouteListener extends ProcessManager
{
function listenOn(DestiniationWasChanged $event)
{
$rerouteCargo = RerouteCargo::to(
$event->newDestination(),
$event->cargoId()
View EventMachine_Example.postman_collection.json
{
"variables": [],
"info": {
"name": "EventMachine Example",
"_postman_id": "89698ba0-98f0-cc94-2f71-9f19c183e3f3",
"description": "",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
@codeliner
codeliner / ReactTest.tsx
Created Aug 9, 2017
React TS app to reproduce TS inspection errors in PhpStorm
View ReactTest.tsx
import React from 'react'
interface ReactTestProps {foo: string, bar: string}
class ReactTest extends React.Component<ReactTestProps, {}> {
constructor(props: ReactTestProps) {
super(props)
}
}
You can’t perform that action at this time.