Skip to content

Instantly share code, notes, and snippets.

View mmoreram's full-sized avatar
🤑
Working on Apisearch

Marc Morera mmoreram

🤑
Working on Apisearch
View GitHub Profile
<?php
/**
* Custom ArrayCollection for Doctrine2 entities
*/
namespace XXX\XXX\Collections;
/**
* Custom array collection
@mmoreram
mmoreram / doctrineTreeBuilder
Last active December 21, 2015 10:29
Doctrine2 Entity tree builder O(n)
<?php
/**
* Cost O(n)
*
* This method allow build a tree given following data
*
* $entities is an Array ( or any ArrayIterator implementation ) of $entity
* $entity is an Object ( can be Whatever )
*
@mmoreram
mmoreram / create-platform.md
Last active December 23, 2015 16:29
Create new PayFony payment platform.
@mmoreram
mmoreram / install-platform.md
Last active December 24, 2015 08:39
Install any PayFony payment platform into your Symfony2 projects.

Installing PayFony

You have to add require line into you composer.json file

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    ...

"username/platform-bundle": "version"

@mmoreram
mmoreram / configure-payfony-environment.md
Last active December 24, 2015 08:39
How to configure your Symfony2 project to work with Payfony platforms
@mmoreram
mmoreram / contribute-payfony.md
Last active December 24, 2015 14:29
Contributing in Payfony project

Contribute

All code is Symfony2 Code formatted, so every pull request must be validated with phpcs standards which you can install following these steps.

There is also a policy for contributing to this project. All pull request must be all explained step by step, to make for contributors more understandable and easier to merge the pull request. All new features must be tested with PHPUnit.

When contributing with Payfony, you can contact [email protected] to let us know about your contribution in this amazing project.

Contributors

@mmoreram
mmoreram / available-platforms.md
Last active December 24, 2015 14:29
Available Payfony platforms
@mmoreram
mmoreram / parameters.yml
Created December 13, 2013 19:48
parameters.yml
parameters:
#
# Services
#
mmoreram.services.myservice.class: \Mmoreram\MyBundle\Services\MyService
@mmoreram
mmoreram / fsi.sh
Last active January 4, 2016 09:19
FSI ( Fast Symfony2 Installation )
#!/bin/bash
# git clone https://gist.github.com/8601752.git fsi && sh fsi/fsi.sh
folder=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
clear
cd /tmp/
echo "Installing project in i/tmp/$folder. This process can take depending on your connection, up to 2 minutes"
git clone https://github.com/symfony/symfony-standard.git $folder
cd $folder
@mmoreram
mmoreram / post.md
Last active August 29, 2015 14:08
Dependency Injection and TDD

La mayoría de los proyectos ya existen. ¿Que quiero decir con esto? Bueno, creo que la mayoría de desarrolladores en la era de las grandes documentaciones simplemente abusan de la superficialidad que estas nos permiten. Y creo que esto puede estar bien en cierto modo, pero también creo que son las grandes implementaciones las que, en última instancia, nos hacen crecer como profesionales.

Es por esto que en la documentación del proyecto que quiero pseudodocumentar hoy empieza con una de las frases más conocidas por el homo-developer. "Oh, no way... another Dependency Injection container written in PHP?". Pues me temo