-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.sh
executable file
·36 lines (30 loc) · 1010 Bytes
/
generate.sh
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
#!/usr/bin/env bash
#
# Generate Freemius (WordPress SDK) stubs from the source directory.
#
HEADER=$'/**\n * Generated stub declarations for freemius.\n * @see https://freemius.com\n * @see https://github.com/mralaminahamed/phpstan-freemius-stubs\n */'
FILE="freemius-stubs.php"
FILE_CONSTANTS="freemius-constants-stubs.php"
set -e
test -f "$FILE" || touch "$FILE"
test -f "$FILE_CONSTANTS" || touch "$FILE_CONSTANTS"
test -d "source/vendor/freemius/wordpress-sdk"
# Exclude globals, constants.
"$(dirname "$0")/vendor/bin/generate-stubs" \
--include-inaccessible-class-nodes \
--force \
--finder=finder.php \
--header="$HEADER" \
--functions \
--classes \
--interfaces \
--traits \
--out="$FILE"
# Exclude functions, classes, interfaces, traits and globals.
"$(dirname "$0")/vendor/bin/generate-stubs" \
--include-inaccessible-class-nodes \
--force \
--finder=finder-constants.php \
--header="$HEADER" \
--constants \
--out="$FILE_CONSTANTS"