Skip to content

Instantly share code, notes, and snippets.

View wouterj's full-sized avatar

Wouter de Jong wouterj

View GitHub Profile
<?php
namespace Wj\Stoffer\Scissors;
class Line
{
private $input;
public function __construct($input)
{
<?php
namespace spec\Wj\Stoffer;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Wj\Stoffer\Scissors\ScissorsInterface;
class KernelSpec extends ObjectBehavior
{
<?php
namespace Wj\Stoffer;
use Wj\Stoffer\Event\LineEvent;
use Wj\Stoffer\Scissors\ScissorsInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* @author Wouter J <wouter@wouterj.nl>
<!doctype html>
<html lang="en">
<head>
<!-- ... -->
</head>
<body class="page">
<!-- ... -->
{% block hero_unit_wrapper -%}
<section class="page__sub-header article--featured grid grid--center">
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services">
<parameters>
<parameter key="wj_rst.typer.class">Wj\RstExtension\EventListener\RstTyper</parameter>
</parameters>
<services>
<service id="wj_rst.typer" class="%wj_rst.typer.class%">
<tag name="stoffer.event_subscriber" />
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services">
<parameters>
<parameter key="wj_rst.linter.code_shorthand.class">Wj\RstExtension\Linter\CodeShortHand</parameter>
<parameter key="wj_rst.linter.heading_level.class">Wj\RstExtension\Linter\HeadingLevel</parameter>
<parameter key="wj_rst.linter.md_markup.class">Wj\RstExtension\Linter\MdMarkup</parameter>
</parameters>
<services>
<?php
// ...
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
use Acme\DemoBundle\Entity\Post;
public function indexAction()
{
$post = new Post;
$builder = $this->createFormBuilder($post);
$form = $builder
<?php
class PostListController extends Controller
{
private $viewModel;
public function __construct()
{
$this->viewModel = $this->get('view_model.twig');
$this->on('data.post_list_served', array($this, 'listServed'));
<?php
namespace Wj\ForumBundle\Document;
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCR;
use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
/**
* @PHPCR\Document(referenceable=true)
*/
<?php
$this->capsule = $this->prophet->prophesize('Illuminate\Database\Capsule\Manager');
new EloquentInitializer($this->capsule->reveal());