Skip to content

Instantly share code, notes, and snippets.

View jsor's full-sized avatar
💨

Jan Sorgalla jsor

💨
View GitHub Profile
@jsor
jsor / Entity.php
Created December 2, 2017 13:08
Example setup for jsor/doctrine-postgis working with geometry objects
<?php
namespace DoctrinePostGISExample;
use Doctrine\ORM\Mapping as ORM;
use GeoIO\Geometry\Point;
/**
* @ORM\Entity
* @ORM\Table(
<?php
function resolve($promiseOrValue = null)
{
if ($promiseOrValue instanceof ReactPromiseInterface) {
return $promiseOrValue;
}
// Create a React\Promise from a foreign promise
if ($promiseOrValue instanceof FigPromiseInterface) {
@jsor
jsor / gist:b77fe49e08b8c9ffb7e9
Last active December 17, 2015 09:36
ReactPHP needs improving, any ideas?
<?php
namespace App\ProcessManager\Billing;
use App\Read\Billing\Queries\GetDefaultPlan;
use App\Read\Identity\Queries\UserWithId;
use App\Read\Identity\UserDto;
use App\Services\Bus\BillingCommandBus;
use App\Services\Bus\BillingQueryBus;
use App\Services\Bus\IdentityQueryBus;
@jsor
jsor / ReactLoopQueue.php
Created May 5, 2015 14:29
ReactLoopQueue
<?php
namespace React\Promise\Queue;
use React\EventLoop\LoopInterface;
class ReactLoopQueue implements QueueInterface
{
private $loop;

Keybase proof

I hereby claim:

  • I am jsor on github.
  • I am jsor (https://keybase.io/jsor) on keybase.
  • I have a public key whose fingerprint is 4C8B 04C1 C4F3 8711 3ECC D939 8708 F3EE CCA6 FDFA

To claim this, I am signing this object:

@jsor
jsor / CoroutineTest.php
Last active July 31, 2017 12:16
React/Promise coroutine
<?php
namespace React\Promise;
class CoroutineTest extends \PHPUnit_Framework_TestCase
{
public function testResolvedValueEqualsFinalYield()
{
$gen = function () {
$a = (yield 21);
@jsor
jsor / test.php
Last active August 29, 2015 14:06 — forked from anonymous/test.php
<?php
require 'vendor/autoload.php';
$loop = \React\EventLoop\Factory::create();
$filesystem = new \React\Filesystem\Filesystem($loop);
$loop->addTimer(0.0001, function() use ($filesystem) {
$file = $filesystem->file(__FILE__);
$file->exists()->then(function() use ($file) {
echo __FILE__ . ' exists', PHP_EOL;
@jsor
jsor / ddd_cqrs_event-sourcing_in_php.md
Last active July 30, 2024 11:28
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@jsor
jsor / settle.php
Created December 18, 2013 09:04
React\Promise\settle()
<?php
namespace React\Promise;
function settle($promisesOrValues)
{
return resolve($promisesOrValues)
->then(function ($array) {
if (!is_array($array) || !$array) {
return resolve([]);
@jsor
jsor / example.php
Last active December 20, 2015 04:18
Interfaces for functions.
<?php
require __DIR__.'/function_interfaces.php';
interface foo {}
interface interfaces {
function my_function();
function my_function2(callable $callable, $string, \Traversable $traversable, foo $foo, $constant = DIRECTORY_SEPARATOR);
}