Skip to content

Instantly share code, notes, and snippets.

View eleftrik's full-sized avatar
😀
Coding

Erik D'Ercole eleftrik

😀
Coding
View GitHub Profile
@barryvdh
barryvdh / pre-commit
Last active May 16, 2023 12:37
phpunit pre-commit git hook
#!/usr/bin/env php
<?php
echo "Running tests.. ";
exec('vendor/bin/phpunit', $output, $returnCode);
if ($returnCode !== 0) {
// Show full output
echo PHP_EOL . implode($output, PHP_EOL) . PHP_EOL;
echo "Aborting commit.." . PHP_EOL;