View README.md

Draft for a simple PSR providing a trivial abstraction of the local system environment.

Why? So we can stop using hacks to work around dependencies on system state - so that these dependencies can be made visible as (constructor) dependencies, and so we can mock the implementations under test.

View ubuntu.md

Introduction

With the Windows 10 Creators Update comes an awesome new opportunity to run a lighweight Ubuntu Linux environment as a subsystem of Windows. This is officially known as Windows Subsystem for Linux (WSL) or Bash on Windows.

This is great news for PHP developers using Windows - we can now get access to native Linux builds of PHP, PECL extensions, ImageMagick, NGINX and other server components and tools, without having to migrate to a Linux desktop environment!

In this guide, we'll get you set up with WSL itself, a working PHP 7.2 environment with OpCache, XDebug and task/terminal integration with Php Storm, and working NGINX configuration - as well as various tools, including PEAR/PECL, Composer and Node.JS.

Before you begin, skim over the [official FAQ](https://msdn.microsoft.co

View collections.md

You can have a linear workflow with the array functions.

The following is unreadable:

$output = array_reduce(
  array_map(
    function($n) { return $n ** 2; }
    array_filter($input, function($n) { return $n % 2 == 0; })
  ),
View middleware-host.php
<?php
// an ultra-simple middleware host that works for middleware callables with any signature.
// the last argument is always the `$next` function, which delegates to the next middleware.
class Host
{
/**
* @var callable[]
*/
View MiddlewareDelegateInterface.php
<?php
namespace Psr\Middleware;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* This interface defines the formal method common to HTTP Middleware components.
*/
View scribe-plugin-smart-lists.js
/**
* Automatically create ordered/unordered lists when detecting content like "* " or "1. "
*/
define(function () {
"use strict";
return function () {
return function (scribe) {
/**
View shared-toolbar.js
define(function () {
"use strict";
var active_scribe = null;
function create_handler_for(button) {
return function (event) {
if (!active_scribe) {
return;
}
View anonymous.php
<?php
// anonymous classes are both instances and types. huh? what?
$type = new class {
public function foo() {
echo "YAY";
}
};
View dafuq.php
<?php
function kthxbai() {
$result = "hey";
try {
return $result;
} finally {
$result = "dafuq";
}
View Container.php
<?php
class Container
{
/** @var Closure[] */
private $factories = [];
/** @var array */
private $components = [];