File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed
Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- cd " $( cd " $( dirname " $0 " ) " && pwd ) "
3+ cd " $( cd " $( dirname " $0 " ) " && pwd ) " || exit 1
4+ DIR=" ` pwd` "
45
5- ./vendor/bin/phpcs --report-width=100 --tab-width=4 --standard=phpcodesniffer.xml src/ -as
6+ function exit_error
7+ {
8+ echo >&2 " ERROR: $@ "
9+ exit 1
10+ }
11+
12+ # Run PHP linter
13+
14+ find . -type f -iname " *.php" -not -path " ./vendor/*" -print0 | while IFS= read -r -d $' \0' file; do
15+ php -lf $file > /dev/null
16+ [ $? -eq 0 ] || exit_error " $file needs to be fixed to continue"
17+ done
18+
19+ # Install/update https://github.com/wimg/PHPCompatibility
20+
21+ cd vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/ || exit_error " PHP_CodeSniffer not installed"
22+ if [ -d PHPCompatibility ]; then
23+ cd PHPCompatibility
24+ git pull
25+ else
26+ git clone http://github.com/wimg/PHPCompatibility.git
27+ fi
28+
29+ # Run PHP_CodeSniffer
30+
31+ cd " $DIR "
32+ ./vendor/bin/phpcs --report-width=100 --tab-width=4 --standard=phpcodesniffer.xml,PHPCompatibility src/ -as --runtime-set testVersion 5.4
33+
34+ exit 0
Original file line number Diff line number Diff line change 22
33class ServiceProvider extends \Illuminate \Support \ServiceProvider
44{
5-
65 /**
76 * Indicates if loading of the provider is deferred.
87 *
You can’t perform that action at this time.
0 commit comments