Skip to content

Commit 7769720

Browse files
committed
First try
0 parents  commit 7769720

8 files changed

+14898
-0
lines changed

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/.travis.yml export-ignore
4+
/source export-ignore

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor/
2+
/composer.lock

composer.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "php-stubs/wordpress-seo-stubs",
3+
"description": "Yoas SEO function and class declaration stubs for static analysis.",
4+
"keywords": [
5+
"yoast",
6+
"seo",
7+
"wordpress",
8+
"static analysis",
9+
"phpstan"
10+
],
11+
"homepage": "https://github.com/php-stubs/wordpress-seo-stubs",
12+
"license": "MIT",
13+
"require": {
14+
"php-stubs/wordpress-stubs": "^5.3.0",
15+
"psr/log": "^1.0",
16+
"league/oauth2-client": "^2.4",
17+
"symfony/dependency-injection": "^3.4"
18+
},
19+
"require-dev": {
20+
"php": "~7.1",
21+
"giacocorsiglia/stubs-generator": "^0.5.0"
22+
},
23+
"suggest": {
24+
"szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan",
25+
"symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions"
26+
},
27+
"minimum-stability": "stable",
28+
"scripts": {
29+
"post-install-cmd": "@composer --working-dir=source/ install --no-interaction --no-suggest --no-dev",
30+
"post-update-cmd" : "@composer --working-dir=source/ install --no-interaction --no-suggest --no-dev",
31+
"cleanup": "git status --short --ignored | sed -n -e 's#^!! ##p' | xargs -r rm -vrf"
32+
},
33+
"scripts-descriptions": {
34+
"cleanup": "Remove all ignored files."
35+
}
36+
}

finder.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
return \StubsGenerator\Finder::create()
4+
->in('source/wordpress-seo')
5+
->notPath('admin')
6+
->notPath('cli')
7+
->notPath('config')
8+
->notPath('deprecated')
9+
->notPath('migrations')
10+
// Assets.
11+
->notPath('css')
12+
->notPath('images')
13+
->notPath('js')
14+
->notPath('languages')
15+
->sortByName()
16+
;

generate.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
HEADER=$'/**\n * Generated stub declarations for WooCommerce.\n * @see https://woocommerce.com\n * @see https://github.com/php-stubs/woocommerce-stubs\n */'
4+
5+
FILE="wordpress-seo-stubs.php"
6+
7+
set -e
8+
9+
test -f "$FILE"
10+
test -d "source/wordpress-seo"
11+
12+
# Exclude globals.
13+
"$(dirname "$0")/vendor/bin/generate-stubs" \
14+
--force \
15+
--finder=finder.php \
16+
--header="$HEADER" \
17+
--functions \
18+
--classes \
19+
--interfaces \
20+
--traits \
21+
--out="$FILE"
22+
23+
# There are no WC functions to read these constants.
24+
# See define_constants() in includes/class-woocommerce.php
25+
printf '\nnamespace {\n %s\n}\n' "define('WPSEO_VERSION', '0.0.0');" >>"$FILE"

source/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!/.gitignore
3+
!/composer.json

source/composer.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"require": {
3+
"php": "~7.0",
4+
"yoast/wordpress-seo": "12.9.1"
5+
},
6+
"minimum-stability": "stable",
7+
"extra": {
8+
"installer-paths": {
9+
"{$name}/": [
10+
"type:wordpress-plugin"
11+
]
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)