Skip to content

Instantly share code, notes, and snippets.

Avatar
🌐
OSS Contributor

Alexander Miertsch codeliner

🌐
OSS Contributor
View GitHub Profile
@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 / 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 / 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 / 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 / OrgaState.php
Last active Sep 6, 2017
Workshop material
View OrgaState.php
<?php
declare(strict_types=1);
namespace App\Model\Organization;
final class OrgaState
{
public $orgaId;
public $orgaName;
@codeliner
codeliner / ExcludeBlacklistedFiles.php
Last active Nov 3, 2017
proophessor-do message flow analyzed with prooph/message-flow-analyzer
View ExcludeBlacklistedFiles.php
<?php
declare(strict_types=1);
namespace Prooph\ProophessorDo\Infrastructure\ProophAnalyzer;
use Prooph\MessageFlowAnalyzer\Filter\FileInfoFilter;
final class ExcludeBlacklistedFiles implements FileInfoFilter
{
@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)
}
}
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": [
{
You can’t perform that action at this time.