Skip to content

Instantly share code, notes, and snippets.

View gnutix's full-sized avatar

Dorian Villet gnutix

View GitHub Profile
services:
Rector\CodingStyle\Rector\Namespace_\ImportFullyQualifiedNamesRector:
# Prevent importing classes like \DateTime
$shouldImportRootNamespaceClasses: false
parameters:
kernel_class: \App\Kernel
sets:
# Code quality
- 'celebrity'
INFO global: Vagrant version: 2.2.4
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_LOG="DEBUG"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/bin/vagrant"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
WARN global: resolv replacement has not been enabled!
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/plugins/kernel_v2/plugin.rb
@gnutix
gnutix / Fixture.yml
Last active March 14, 2024 04:53
Custom Faker Provider for generating Symfony encoded password using UserPasswordEncoderInterface.
Symfony\Component\Security\Core\User\User:
member:
__construct: ['member', '<symfonyPassword("Symfony\Component\Security\Core\User\User", "member", "salt")>', ['ROLE_USER']]
admin:
__construct: ['admin', '<symfonyPassword("Symfony\Component\Security\Core\User\User", "admin", "salt")>', ['ROLE_ADMIN']]
<?php
namespace SymfonyExtension\Component\HttpFoundation;
use Symfony\Component\HttpFoundation\Request as BaseRequest;
use Symfony\Component\HttpFoundation\RequestMatcher as BaseRequestMatcher;
/**
* This class improves Symfony2's RequestMatcher by adding a method to specify the scheme(s) to match.
*/
@gnutix
gnutix / DoctrineDbalStatementInterface.php
Created December 2, 2013 09:07
Mock Builder for Doctrine EntityManager / Connection mock objects.
<?php
namespace Mocks;
use Doctrine\DBAL\Driver\Statement;
/**
* Doctrine DBAL Statement implementing \Iterator.
*
* This class has been created because of a bug in PHPUnit Mock Objects.
@gnutix
gnutix / AcmeAssetsVersionDependentCommand.php
Last active December 24, 2015 09:18
Example of command that depends on the "framework.templating.assets_version" configuration value.
<?php
namespace Acme\DemoBundle\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
@gnutix
gnutix / composer.json
Last active December 23, 2015 02:49
Example how to manage verot's upload PHP class dependency with composer.
{
"require": {
"php": ">=5.3.0",
"verot/upload-class": "0.32"
},
"repositories": {
"verot-upload-unofficial": {
"type": "package",
"package": {
"name": "verot/upload-class",