Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian zebba

View GitHub Profile
View Configuration.php
<?php
/**
* @inheritDoc
*/
public function getConfigTreeBuilder()
{
$treebuilder = new TreeBuilder();
$rootNode = $treebuilder->root('');
$rootNode
View IssueSelectorType.php
<?php
namespace Acme\TaskBundle\Form\Type;
use Acme\TaskBundle\Form\DataTransformer\IssueToNumberTransformerFactory;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class IssueSelectorType extends AbstractType
@zebba
zebba / behat.yml
Created Apr 21, 2015
Behat and Symfony2
View behat.yml
default:
extensions:
Behat\Symfony2Extension: ~
View config.yml
doctrine:
dbal:
#driver: "%database.driver%"
driver: "%database.driver%" # this does not work
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
View Bundle.php
<?php
namespace Acme\FooBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class FooDavBundle extends Bundle
{
/**
@zebba
zebba / Entity\Foo.php
Last active Aug 29, 2015
Flexible and secure fromArray implementation
View Entity\Foo.php
<?php
// ...
class Foo
{
// ...
static public function fromArray(array $data)
{
You can’t perform that action at this time.