Skip to content

Instantly share code, notes, and snippets.

View trq's full-sized avatar

Tony R Quilkey trq

  • thorpesystems
  • Sydney, Australia
View GitHub Profile
@trq
trq / gist:d5a8a03ad707142ec98a
Created October 5, 2015 10:15
xdebug config
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=10.211.55.2
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM-XDEBUG"
;xdebug.scream=1
;xdebug.show_exception_trace=1
xdebug.var_display_max_children=128
xdebug.var_display_max_data=512
xdebug.var_display_max_depth=1024
<?php
namespace spec\Opus\Service;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Opus\Service\Container;
use Interop\Container\ContainerInterface;
class ContainerSpec extends ObjectBehavior
<?php
namespace Foo\SomeBundle\Service;
use Aws\Sns\SnsClient;
class Notifications
{
/**
* @var SnsClient
function foo()
{
if ($something == $something) {
// do something
return $something_else;
}
return null;
}
public function getRelationById($relation, $id)
{
return array_filter($this->{$relation}, function($entity) use ($id) {
return $entity->getId() === $id;
});
}
<?php
namespace Trq;
class Foo
{
protected function __construct()
{
}
@trq
trq / Foo.php
Last active August 29, 2015 14:13
<?php
namespace Trq;
class Foo
{
protected function __construct()
{
}
@trq
trq / scomposer
Last active August 29, 2015 14:08
#!/usr/bin/env bash
d=$(date +%s)
remote='some-aws-box'
dir="composer-$d.tmp"
if [ -f composer.json ]; then
ssh $remote mkdir "$dir"
scp composer.json $remote:"$dir"/composer.json
<?php
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
$app = new Cors($app, array(
// you can use array('*') to allow any headers
'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'),
// you can use array('*') to allow any methods
Im getting this error:
Notice: Undefined index: userId in /var/www/html/symfony2/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 688
class UsersType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options