Skip to content

Instantly share code, notes, and snippets.

View uri-query-string.php
use League\Uri\UriTemplate;
use League\Uri\Components\Query;
require 'vendor/autoload.php';
$template = '{version}/{?q*}';
Mattin / ProjectionCommand.php
Created June 7, 2021 19:11
Prooph Projection with GapDetection
View ProjectionCommand.php
* @copyright Copyright (c) 2019 TRIFFT ME s.r.o. (
* @author Matus Nickel <>
Ocramius / Day.php
Created April 3, 2020 14:13
Example abstraction that only allows a resolution of "day" for time inside a specific business domain
View Day.php
namespace Core\Domain\Time;
use DateTimeImmutable;
use DateTimeZone;
use Generator;
use Iterator;
basz /
Last active December 18, 2020 08:23


Projectors fail with contraint errors when rebuilding read models.

Setup description

Implementations of Prooph\EventStore\Projection\AbstractReadModel are used to build read-models. We are using Doctrine Entities for these models. ReadModelProjector::OPTION_PERSIST_BLOCK_SIZE is set to 1000 The persist method of Prooph\EventStore\Projection\AbstractReadModel has been adapted to wrap the stack of changes inside a transaction. (see ReadModelTrait.php)

View CombinedReadModel.php
namespace Funct\Ion\Microsite\Base\ReadModel\MicrositeCollections;
use Prooph\EventStore\Projection\AbstractReadModel;
use RuntimeException;
final class CombinedReadModel extends AbstractReadModel
View BigIdSingelStreamStrategy.php
final class BigIdSingleStreamStrategy implements PersistenceStrategy, HasQueryHint
* @param string $tableName
* @return string[]
public function createSchema(string $tableName): array
kai101 /
Last active August 24, 2023 09:10
How to Install Wkhtmltopdf 12.4 with patched Qt?

How to Install Wkhtmltopdf 12.4 with patched Qt?

For earlier version whos suffering from versionlock syndrome. Please follow the instructions to rollback to older SSL interface. Do not alarm by the fallback ssl interface, they received security patches for vulnerability discovered.

Current version of apt-get wkhtmltopdf does not come with Qt patch. There are some issue going with both Qt patched and non-patched. Most common use case is compatible with the patched Qt.

View ddl_prooph.sql
# Event Stream
CREATE TABLE `event_streams` (
`real_stream_name` VARCHAR(150) NOT NULL,
`stream_name` CHAR(41) NOT NULL,
`metadata` TEXT NOT NULL,
`category` VARCHAR(150),
CHECK (`metadata` IS NOT NULL OR JSON_VALID(`metadata`)),
UNIQUE KEY `ix_rsn` (`real_stream_name`),
codeliner / MongoConnection.php
Last active May 9, 2022 14:55
prooph MongoEventStore v7
View MongoConnection.php
declare(strict_types = 1);
namespace Acme\Infrastructure\MongoDb;
use MongoDB\Client;
use MongoDB\Collection;
class MongoConnection
chalasr / splat_operator.php
Last active April 11, 2016 13:26
function with dynamic number of type-hinted arguments using the splat operator PHP 5.6
View splat_operator.php
function splat(array ...$args) {
foreach ($args as $arg) {
splat(['firstArray'], ['secondArray']);
// Output: Array( [0] => firstArray ) Array( [0] => secondArray )