- https://joind.in/talk/view/13174
- http://ddd.io/2015/01/26/review-of-the-unofficial-ddd-track-for-phpbenelux-2015/
- http://www.freeklijten.nl/home/2015/01/24/PHP-Benelux-conference
- https://twitter.com/sgrame/status/558954481359282176/photo/1
- http://www.future500.nl/articles/2015/01/phpbenelux-2015-revisited/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dispatcher = new EventDispatcher; | |
class SendWelcomeEmail implements QueuedEventHandler { | |
public function when(Event $event) { | |
// delegate to whenUserHasRegistered, whenFoo.. | |
} | |
private function whenUserHasRegistered(UserHasRegistered $event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// test data | |
class Foo { | |
private $a; | |
private $b; | |
function __construct($a, $b) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass | |
{ | |
/** | |
* Lots of comments | |
*/ | |
public function importantMethodAtTheTop() | |
{ // braces on new lines | |
// lots of newlines to create structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$request = \Zend\Http\Request::fromString( | |
<<<REQ | |
GET /?foo=bar HTTP/1.1\r\n\r\n | |
REQ | |
); | |
var_dump($request->getQuery()->get('foo')); | |
// Expected "bar", got null |
GitHub provides a special pulls remote "namespace" on the upstream repo, so you can add it as a fetch pattern to your .git/config like so:
[remote "upstream"]
url = https://github.com/neovim/neovim.git
fetch = +refs/heads/*:refs/remotes/upstream/*
fetch = +refs/pull/*/head:refs/pull/upstream/*
Then when you git fetch --all
, you will have ALL pull requests available in your local repo in the local pull/ namespace. To check out PR #42:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Collatz where | |
import Control.Monad.Writer | |
collatzSeq :: Integer -> Writer [Integer] Integer | |
collatzSeq n = do | |
n <- collatz n | |
if n==1 then return 1 else collatzSeq n | |
collatz :: Integer -> Writer [Integer] Integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- in reaction to http://codemanship.co.uk/parlezuml/blog/?postid=1325 | |
-- oneHundredIntegersSeparatedByCommas | |
-- integersDivisibleByThreeReplacedWithFizz | |
-- integersDivisibleByFiveReplacedWithBuzz | |
-- integersDivisibleByThreeAndFiveReplaedWithFizzBuzz | |
-- remainingNumbersAreUnchanged | |
-- Imho No amount of tests can explain fizzbuzz better than a declarative implementation: | |
fizz :: Int -> String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BankAccount | |
{ | |
private $twitter; | |
public function __construct(Twitter $twitter) | |
{ | |
$this->twitter = $twitter; | |
} | |
public function deposit($amount){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @Entity */ | |
class Bug | |
{ | |
/** @Column(type="integer") */ | |
private $id; | |
/** @Column(length=50) */ | |
private $status; | |
//... | |
} |