FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
restforcephp/bin/pre-commit at master · vpg/restforcephp · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
vpg
/
restforcephp
Public
forked from
BookingBug/restforcephp
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
restforcephp
/
bin
/
pre-commit
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (35 loc) · 781 Bytes
Breadcrumbs
restforcephp
/
bin
/
pre-commit
Copy path
File metadata and controls
40 lines (35 loc) · 781 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
36
37
38
39
40
#!
/bin/sh
PROJECT=
`
php -r
"
echo dirname(dirname(dirname(realpath('
$0
'))));
"
`
STAGED_FILES_CMD=
`
git diff --cached --name-only --diff-filter=ACMR HEAD
|
grep
\\\\
.php
`
#
Determine if a file list is passed
if
[
"
$#
"
-eq
1 ]
then
oIFS=
$IFS
IFS=
'
'
SFILES=
"
$1
"
IFS=
$oIFS
fi
SFILES=
${SFILES
:-
$STAGED_FILES_CMD
}
echo
"
Checking PHP Lint...
"
for
FILE
in
$SFILES
do
php -l -d display_errors=0
$PROJECT
/
$FILE
if
[
$?
!=
0 ]
then
echo
"
Fix the error before commit.
"
exit
1
fi
FILES=
"
$FILES
$PROJECT
/
$FILE
"
done
if
[
"
$FILES
"
!=
"
"
]
then
echo
"
Running Code Sniffer...
"
./vendor/bin/phpcs --standard=PSR2 --encoding=utf-8 -n -p
$FILES
if
[
$?
!=
0 ]
then
echo
"
Fix the error before commit.
"
exit
1
fi
fi
exit
$?
Back
|
FazBrowse Home
|
New Git URL