Skip to content

Instantly share code, notes, and snippets.

View Raphhh's full-sized avatar

Raphaël Lefebvre Raphhh

View GitHub Profile
@Raphhh
Raphhh / CallableReflection.php
Last active December 20, 2015 22:18
PHP Callable Reflection: You can reflect a callback and know its type.
<?php
use TRex\Reflection\CallableReflection;
//examples
$closure = function(){};
$reflect = new CallableReflection($closure);
var_dump($reflect->getType()===CallableReflection::CLOSURE_TYPE);
var_dump($reflect->getFunctionName()==='');
var_dump($reflect->getClosure()===$closure);
var_dump($reflect->getClassName()==='');
@Raphhh
Raphhh / .gitconfig
Last active March 10, 2016 11:29
.gitconfig
[user]
name = Raphaël Lefebvre
email = raphael@raphaellefebvre.be
[core]
excludesfile = c:/Users/Raphaël/.gitignore_global
autocrlf = input
[ui]
color = auto
[grep]
extendedRegexp = true

Serveurs: . Linux . Putty . Apache . Nginx . Php . Mysql . Varnish . Vagrant puppet chef . Wamp

@Raphhh
Raphhh / .scrutinizer.yml
Last active October 16, 2017 07:53
Scrutinizer PSR config
filter:
excluded_paths: [vendor/*, tests/*]
tools:
external_code_coverage: true
checks:
php:
verify_property_names: true
verify_argument_usable_as_reference: true
verify_access_scope_valid: true
variable_existence: true
@Raphhh
Raphhh / create_project.sh
Last active August 29, 2015 14:06
PHP Lib Bootstrap script
#!/bin/sh
working_directory='./'
bootstrap_name='raphhh/php-lib-bootstrap'
bootstrap_version='@stable'
echo 'PHP Lib Bootstrap Generator'
echo '';
echo 'Enter your project name (<vendor>/<name>):'
@Raphhh
Raphhh / chess- coding-challenge.md
Last active August 29, 2015 14:06
Chess coding challenge

#Chess coding challenge

Le challenge réside dans la conceptualisation des algorithmes au niveau de l'architecture d'un code. L'idée n'est donc pas d'atteindre une performence dans le code, mais une écriture lisible, réutilisable, et emprunte de bonnes pratiques type SOLID.

Règles

Le code doit être testé et pushé sur un repo git public.

Etape 1: déplacements basiques

@Raphhh
Raphhh / readme-php-app
Last active August 29, 2015 14:07
readme-php-app
# PHP web app
## Main resources
website
code base repository
documentation
bug tracking
ci servers
monitoring
analytics
@Raphhh
Raphhh / php-lib-check-list.md
Last active August 29, 2015 14:07
PHP lib check list

PHP lib check list

Git

  1. .gitignore is versionned.
  2. .gitignore does not contain any IDE or system exclusions.

Files format

  1. Files are encoded in UTF-8 without BOM (PSR-1).
  2. End of lines are LF (PSR-2).
@Raphhh
Raphhh / PHPStorm-code-template.md
Last active January 28, 2016 08:53
Templates for getter and setter in PHPStorm

#PHP getter method

/**
 * Getter of $${PARAM_NAME}
 *
 * @return ${TYPE_HINT}
 */
#if (${TYPE_HINT} == "bool" || ${TYPE_HINT} == "boolean")
public ${STATIC} function ${PARAM_NAME}()