Skip to content

Commit 42a30f2

Browse files
committed
First release: v4.7.14
1 parent 1c6f011 commit 42a30f2

10 files changed

+5990
-11752
lines changed

Diff for: .gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/.github/ export-ignore
21
/.gitattributes export-ignore
32
/.gitignore export-ignore
43
/.travis.yml export-ignore

Diff for: .github/CONTRIBUTING.md

-5
This file was deleted.

Diff for: .gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
/vendor/
2-
/wordpress/
32
composer.lock
4-
.DS_Store
5-
3+
/wordpress/

Diff for: .travis.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,28 @@ language: php
22

33
cache:
44
directories:
5-
- $HOME/.composer/cache
5+
- "$HOME/.composer/cache"
66

7-
php: 7.1
7+
php:
8+
# giacocorsiglia/stubs-generator does not support PHP 7.0
9+
- "7.1"
10+
- "7.2"
11+
- "7.3"
12+
- "7.4snapshot"
813

914
before_install:
1015
- phpenv config-rm xdebug.ini
16+
- composer validate --strict
1117

1218
install:
13-
- composer install
19+
- composer install --no-interaction --no-suggest
1420

1521
before_script:
1622
- mkdir -p .build/php-cs-fixer
1723
- cat ./wordpress/wp-includes/version.php
1824
- php -m
1925

2026
script:
21-
- ./generate.sh
22-
- php -l wordpress-stubs.php
27+
- bash -x ./generate.sh
28+
- php -l ./wordpress-stubs.php
2329
- git diff --exit-code
24-
25-
notifications:
26-
email: false

Diff for: LICENSE

+21-339
Large diffs are not rendered by default.

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
- php 7.1 sodium must be installed through PECL: `pecl install libsodium`
2+
- core's compat code is excluded
3+
- globals are not included in the stubs
4+
- for php <7.3 use symfony/polyfill-php73 in require-dev
5+
16
# WordPress Stubs
27

38
[![Build Status](https://travis-ci.com/GiacoCorsiglia/wordpress-stubs.svg?branch=master)](https://travis-ci.com/GiacoCorsiglia/wordpress-stubs)

Diff for: composer.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"name": "giacocorsiglia/wordpress-stubs",
3-
"description": "WordPress function, class, and global variable declaration stubs for easier static analysis.",
4-
"homepage": "https://github.com/GiacoCorsiglia/wordpress-stubs",
2+
"name": "szepeviktor/wordpress-stubs",
3+
"description": "WordPress function, class, and global variable declaration stubs for static analysis.",
54
"keywords": [
65
"wordpress",
7-
"static analysis"
6+
"static analysis",
7+
"phpstan"
88
],
9+
"homepage": "https://github.com/szepeviktor/wordpress-stubs",
10+
"license": "MIT",
911
"require-dev": {
10-
"php": "^7.1",
12+
"php": "~7.1",
1113
"ext-gettext": "*",
12-
"giacocorsiglia/stubs-generator": "^0.5.0",
13-
"johnpbloch/wordpress": "5.1.1"
14+
"ext-hash": "*",
15+
"ext-json": "*",
16+
"ext-mbstring": "*",
17+
"ext-openssl": "*",
18+
"ext-sodium": "*",
19+
"johnpbloch/wordpress": "4.7.14",
20+
"giacocorsiglia/stubs-generator": "^0.5.0"
1421
},
15-
"license": "GPL-2.0+",
16-
"authors": [
17-
{
18-
"name": "Giaco Corsiglia",
19-
"email": "[email protected]"
20-
}
21-
],
2222
"minimum-stability": "stable"
2323
}

Diff for: finder.php

+10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22

33
return \StubsGenerator\Finder::create()
44
->in('wordpress')
5+
// Shim for load-styles.php and load-scripts.php.
56
->notPath('wp-admin/includes/noop.php')
7+
// This file is not included by WordPress.
8+
->notPath('wp-admin/install-helper.php')
9+
// Plugins and themes.
610
->notPath('wp-content')
11+
// Missing theme files.
12+
->notPath('wp-includes/theme-compat')
13+
// Backward compatibility files.
14+
// $ find -iname "*compat*"
15+
->notPath('wp-includes/compat.php')
716
->notPath('wp-includes/spl-autoload-compat.php')
17+
->notPath('wp-includes/random_compat')
818
->sortByName()
919
;

Diff for: generate.sh

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
#!/usr/bin/env bash
22

3-
HEADER=$'/**\n * Generated stub declarations for WordPress.\n * https://wordpress.org\n * https://github.com/GiacoCorsiglia/wordpress-stubs\n */'
3+
HEADER=$'/**\n * Generated stub declarations for WordPress.\n * @see https://wordpress.org\n * @see https://github.com/szepeviktor/wordpress-stubs\n */'
44

55
FILE="wordpress-stubs.php"
66

7-
"$(dirname $0)/vendor/bin/generate-stubs" \
8-
--finder=finder.php \
9-
--out="$FILE" \
10-
--force \
11-
--header="$HEADER" \
12-
--nullify-globals
7+
# Exclude globals.
8+
"$(dirname "$0")/vendor/bin/generate-stubs" \
9+
--force \
10+
--finder=finder.php \
11+
--out="$FILE" \
12+
--header="$HEADER" \
13+
--functions \
14+
--classes \
15+
--interfaces \
16+
--traits
1317

1418
# Shim the global $wpdb declaration, since it's actually set up inside a
1519
# function call.
16-
echo $'\n/**\n * WordPress database abstraction object.\n * @var wpdb\n */\n$wpdb = null;' >> $FILE
20+
printf '\n/**\n * WordPress database abstraction object.\n * @var wpdb\n */\n$wpdb = \\null;\n' >>$FILE
1721

18-
# Trim tailing whitespace. Not using sed because it seemed to struggle with
22+
# Trim tailing whitespaces. Not using sed command because it seemed to struggle with
1923
# some characters in the file.
20-
perl -i -lpe "s/[[:space:]]+$//g" $FILE
24+
perl -i -lpe 's/[[:space:]]+$//g' "$FILE"

0 commit comments

Comments
 (0)