Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Gutjahr mattsches

View GitHub Profile
@mattsches
mattsches / Roman.php
Created Jan 30, 2013
PHP Roman Numerals Code Kata solution. A collaborative effort of the people @ PHP User Group Rheinhessen, Jan '13.
View Roman.php
<?php
/**
* Converts Roman numbers to integers
*/
class Roman
{
/**
* @var array
*/
@mattsches
mattsches / sf2tt_001.php
Created Jun 16, 2012
EventListener mit PRE_SET_DATA-Event in Symfony2
View sf2tt_001.php
/* ... */
public function buildForm(FormBuilder $builder, array $options)
{
$builder->addEventListener(FormEvents::PRE_SET_DATA,
function (DataEvent $event) use ($builder)
{
$form = $event->getForm();
/* @var \Sperrobjekt\Sf2ttBundle\Entity\Category $data */
$data = $event->getData();
@mattsches
mattsches / test.php
Created Feb 22, 2012 — forked from rodneyrehm/test.php
PHPGangsta: Doppelte Array-Einträge entfernen
View test.php
<?php
if (extension_loaded('xdebug')) {
echo "WARNING: xdebug is enabled\n";
}
function _count()
{
$array = array(1, 5, 8, 'Michael', 5, 4, 9, 'Martin', 18, 12, 'Michael', 4, 12);