Skip to content

Instantly share code, notes, and snippets.

View andreia's full-sized avatar
❤️
coding

Andréia Bohner andreia

❤️
coding
View GitHub Profile
# config/services.yaml
services:
# ...
App\HandlerCollection:
arguments: [!tagged_iterator app.handler, default_priority_method: 'calculateServicePriority']
# config/services.yaml
services:
_instanceof:
App\Handler:
tags:
- { name: 'app.handler', priority: 20 }
App\HandlerCollection:
arguments: [!tagged_iterator app.handler]
# config/services.yaml
services:
App\NewMailer:
decorates: App\Mailer
decoration_on_invalid: ignore
# config/services.yaml
services:
_instanceof:
App\Foo\Rule\RuleInterface:
tags: ['app.foo.rule']
_defaults:
bind:
iterable $rules: !tagged_iterator app.foo.rule
imports:
# irá exibir uma erro se 'parameters.yaml' existe mas contém erros de sintaxe
- { resource: 'parameters.yaml', ignore_errors: 'not_found' }
class Kernel extends BaseKernel
{
// ...
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
// ...
$container->setParameter('container.dumper.inline_factories', true);
# config/services.yaml
services:
# ...
_defaults:
bind:
$projectDir: '%kernel.project_dir%'
@andreia
andreia / SomeCommand.php
Created November 26, 2019 01:27
A Symfony Command
<?php
// src/Command/SomeCommand.php
namespace App\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class SomeCommand extends Command
@andreia
andreia / gist:3876449
Created October 11, 2012 23:46
Symfony2: Easiest way to add an * to required field labels
/* By default, required field labels are rendered with the "required" class */
.required:after {
content: "*";
}
old_sound_rabbit_mq:
connections:
default:
host: 'localhost'
port: 5672
user: 'guest'
password: 'guest'
vhost: '/'
lazy: false
producers: