Skip to content

Instantly share code, notes, and snippets.

View cordoval's full-sized avatar

Luis Cordova cordoval

View GitHub Profile

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
use Symfony\CS\FixerInterface;
use Symfony\CS\Tokens;
class ShortArraySyntaxFixer implements FixerInterface
{
public function fix(\SplFileInfo $file, $content)
{
$tokens = Tokens::fromCode($content);
for ($index = 0, $c = $tokens->count(); $index < $c; $index++) {
class FormFieldManager
{
/**
* Recria fields com rebra de bloqueio.
*
* @param FormInterface $sourceForm
* @param FormInterface $child
*/
public function rebuildChild(FormInterface $sourceForm, FormInterface $child)
{
<?php
/**
* sfValidatorZip validates a zip code.
*
* @author Brent Shaffer <bshafs@gmail.com>
*/
class sfValidatorZip extends sfValidatorRegex
{
rep:
pattern: /rep
defaults: { _controller: AwareSales:Rep:index }
sale_main:
pattern: /sale/
defaults: { _controller: AwareSales:Sale:index }
sale_new:
pattern: /sale/new
in my controller:
--------------------
$form = SalesForm::create($this->get('form.context'), 'sale', array('em' => $em));
in my SalesForm:
--------------------
class SalesForm extends Form
{
<?php
/*
* based on FOS\UserBundle\Entity
*/
namespace HBK\ScavengerHuntBundle\Entity;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Events;
@cordoval
cordoval / FeatureContext.php
Created August 13, 2011 19:17 — forked from everzet/FeatureContext.php
How to use MinkContext inside BehatBundle as subcontext
<?php
namespace Acme\DemoBundle\Features\Context;
use Behat\BehatBundle\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
/**
@cordoval
cordoval / FeatureContext.php
Created August 13, 2011 22:21 — forked from everzet/FeatureContext.php
How to use MinkContext inside BehatBundle as subcontext
<?php
namespace Acme\DemoBundle\Features\Context;
use Behat\BehatBundle\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
/**
@cordoval
cordoval / Usage.php
Created September 9, 2011 02:34 — forked from jjbohn/Usage.php
<?php
class DescribeIndex extends View
{
function itRendersTheSelectedVideo()
{
$video = \Mockery::mock(
'Application_Model_Video', array('getName' => 'Revolution OS'));
$output = $this->render('MyBundle:Video:detail.html.twig', array(