Skip to content

Commit 903fedf

Browse files
committed
Add composer.json with PHP 7.4+ support
I made some assumptions in this PR that may be inaccurate. 1. I'm assuming we'll be using PHPStan. I'll PR a suggested `phpstan.neon.dist` in a follow-up PR. 2. Is `WordPress\AI` the correct namespace? The main bits: - Configures package as wordpress/php-ai-client library - Requires PHP 7.4 or higher - Adds PHPUnit and PHPStan as dev dependencies - Sets up PSR-4 autoloading with WordPress\AI namespace - Includes convenient scripts for testing and analysis - Adds keywords for package discovery
1 parent e430a82 commit 903fedf

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

composer.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "wordpress/php-ai-client",
3+
"description": "A provider-agnostic PHP SDK for communicating with generative AI models",
4+
"license": "GPL-2.0-or-later",
5+
"type": "library",
6+
"keywords": [
7+
"ai",
8+
"api",
9+
"llm"
10+
],
11+
"authors": [
12+
{
13+
"name": "WordPress AI Team",
14+
"homepage": "https://make.wordpress.org/ai/"
15+
}
16+
],
17+
"homepage": "https://github.com/WordPress/php-ai-client",
18+
"support": {
19+
"issues": "https://github.com/WordPress/php-ai-client/issues",
20+
"source": "https://github.com/WordPress/php-ai-client"
21+
},
22+
"require": {
23+
"php": ">=7.4 || ^8.0",
24+
"ext-json": "*"
25+
},
26+
"require-dev": {
27+
"phpstan/phpstan": "^1.10",
28+
"phpunit/phpunit": "^9.5 || ^10.0"
29+
},
30+
"minimum-stability": "dev",
31+
"prefer-stable": true,
32+
"autoload": {
33+
"psr-4": {
34+
"WordPress\\AI\\": "src/"
35+
}
36+
},
37+
"autoload-dev": {
38+
"psr-4": {
39+
"WordPress\\AI\\Tests\\": "tests/"
40+
}
41+
},
42+
"config": {
43+
"allow-plugins": {
44+
"dealerdirect/phpcodesniffer-composer-installer": true
45+
},
46+
"optimize-autoloader": true,
47+
"platform": {
48+
"php": "7.4"
49+
},
50+
"sort-packages": true
51+
},
52+
"scripts": {
53+
"analyze": "phpstan analyze",
54+
"check": [
55+
"@test",
56+
"@analyze"
57+
],
58+
"test": "phpunit"
59+
}
60+
}

0 commit comments

Comments
 (0)