Skip to content

Instantly share code, notes, and snippets.

@tommy-muehle
tommy-muehle / prepare-commit-msg
Created June 30, 2015 10:31
Git hook to add JIRA issue key from branch-name (if it exists) and add it before the commit message
#!/usr/bin/env php
<?php
/**
* Add this file as "prepare-commit-msg" under /my-project/.git/hooks directory
* and make it executable. (chmod +x)
*
* Example:
* If Branchname was: "release/MYPRO-1-awesome-feature"
* and the commit message you typed in are: "Take this"
<?php
namespace TM\Website\Controller\Abstracts;
use Silex\Application;
/**
* Class BaseController
*
* @package TM\Website\Controller
@tommy-muehle
tommy-muehle / composer hook-class.php
Last active August 29, 2015 14:07
How to add a coding-standard to phpcs via composer hook
<?php
namespace TM;
use Composer\Package\Package;
use Composer\Script\Event;
/**
* Class MyClass
*