-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit
More file actions
35 lines (30 loc) · 707 Bytes
/
pre-commit
File metadata and controls
35 lines (30 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/php
<?php
echo PHP_EOL;
echo '+ Starting tests'.PHP_EOL;
echo PHP_EOL;
exec('vendor/bin/phpcs', $output, $returnCode);
if ($returnCode !== 0) {
printf("PHPCS tests failed!");
echo PHP_EOL;
echo PHP_EOL;
printf("ABORTING COMMIT!\n");
exit(1);
}
exec('vendor/bin/phpmd src/ ansi ruleset.xml', $output, $returnCode);
if ($returnCode !== 0) {
printf("PHPMD tests failed!");
echo PHP_EOL;
echo PHP_EOL;
printf("ABORTING COMMIT!\n");
exit(1);
}
exec('vendor/bin/phpstan analyse -c phpstan.neon -l max src/', $output, $returnCode);
if ($returnCode !== 0) {
printf("PHPSTAN tests failed!");
echo PHP_EOL;
echo PHP_EOL;
printf("ABORTING COMMIT!\n");
exit(1);
}
exit(0);