Skip to content

Instantly share code, notes, and snippets.

View localheinz's full-sized avatar

Andreas Möller localheinz

View GitHub Profile
@localheinz
localheinz / Dominoes.php
Created February 20, 2017 11:52
Dominoes Length of Longest Chain Solution (PHP)
<?php
declare(strict_types=1);
final class Dominoes
{
public function maxLength(string $string): int
{
/** @var Tile[] $tiles */
$tiles = \array_map(function ($tile) {
@localheinz
localheinz / docker-after.yml
Last active September 8, 2019 09:42
GitHub Actions Feature Request: Run job only on `push` to configured branch
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
on:
push:
branch: master
name: Docker
jobs:
docker:
@localheinz
localheinz / actual-events.md
Last active October 30, 2019 07:47
List of interesting events for the PHPUnit event sub-system

Actual Events

  • Application\Started (in Command::main())

  • Application\Configured (in Command::handleArguments())

  • Bootstrap\Finished (in Command::handleBootstrap())

  • TestSuite\Loaded (in BaseTestRunner::getTest())

  • TestSuite\Configured (in TestRunner::doRun(), after handleConfiguration())

  • TestSuite\Sorted (in TestRunner::doRun())

  • Extension\Loaded (in TestRunner::doRun())

@localheinz
localheinz / documentation.yml
Last active January 17, 2020 15:15
Workflow for regenerating the documentation on a push to master
name: Regenerate documentation
on:
push:
branches:
- master
jobs:
setup:
name: Regenerate documentation
<?php
interface Sleeper
{
public function sleep(int $seconds): void;
}
final class SystemSleeper implements Sleeper
{
public function sleep(int $seconds): void