Skip to content

Commit 7f05250

Browse files
authored
Added github workflow, Fixed PHPStan Level 7 (#4)
1 parent 6d52af5 commit 7f05250

File tree

6 files changed

+531
-375
lines changed

6 files changed

+531
-375
lines changed

.github/workflows/phpstan.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan
2+
3+
on: [push]
4+
5+
jobs:
6+
analyze:
7+
name: Analyze
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: '8.0'
18+
19+
- name: Install dependencies
20+
run: composer install --prefer-dist --no-progress --no-suggest
21+
22+
- name: Run PHPStan
23+
run: vendor/bin/phpstan

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Copyright (c) 2023 Christoph Schläpfer
12
Copyright (c) 2012 Nathan Sullivan
23

34
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1+
# PVE2 API wrapper for Symfony
2+
13
This class provides the building blocks for someone wanting to use PHP to talk to Proxmox's API, and is using symfony anyway.
24

3-
This is a fork and rewrite of [this](https://github.com/CpuID/pve2-api-php-client)
5+
This is a fork and rewrite of [this](https://github.com/CpuID/pve2-api-php-client).
6+
This library probably isn't a drop-in replacement for it, but it should be relatively simple to fix your code.
7+
8+
Due to the nature of how the Proxmox VE API works, errors 500 / 501 will return null, otherwise requesting an invalid resource to see if it already exists doesn't work. Ideally, I'd like to work towards
9+
410

511
Relatively simple piece of code, just provides a get/put/post/delete abstraction layer as methods
612
on top of Proxmox's REST API, while also handling the Login Ticket headers required for authentication.
713

14+
15+
## More information:
16+
817
See http://pve.proxmox.com/wiki/Proxmox_VE_API for information about how this API works.
918
API spec available at https://pve.proxmox.com/pve-docs/api-viewer/index.html
1019

1120
## Requirements: ##
1221

13-
PHP 8.1+ with symfony.
14-
15-
Run ```php composer.phar require symfony/validator```
22+
PHP 8.1+ with symfony
1623

1724
## Usage: ##
1825

composer.json

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
{
2-
"name": "anuril/pve2-api-client",
3-
"description": "A Proxmox VE API v2 client for Symfony",
4-
"type": "library",
5-
"require": {
6-
"php": "^8.0|^8.2",
7-
"symfony/http-client": "^5.3",
8-
"symfony/http-foundation": "^5.3",
9-
"symfony/validator": "^5.3"
10-
},
11-
"autoload": {
12-
"psr-4": {
13-
"Symfony\\Component\\PVE2API\\": "src/"
14-
}
15-
},
16-
"license": "MIT",
17-
"authors": [
18-
{
19-
"name": "Christoph Schläpfer",
20-
"email": "[email protected]"
21-
}
22-
]
2+
"name": "pve2-api-client/pve2-api-client",
3+
"description": "A Proxmox VE API v2 client with symfony",
4+
"type": "library",
5+
"require": {
6+
"php": "^8.0|^8.2",
7+
"symfony/http-client": "^5.3",
8+
"symfony/http-foundation": "^5.3",
9+
"symfony/validator": "^5.3"
10+
},
11+
"require-dev": {
12+
"phpstan/extension-installer": "^1.2",
13+
"phpstan/phpstan-deprecation-rules": "^1.1",
14+
"phpunit/phpunit": "^9.6"
15+
},
16+
"autoload": {
17+
"psr-4": {
18+
"Symfony\\Component\\PVE2API\\": "src/"
19+
}
20+
},
21+
"license": "MIT",
22+
"authors": [
23+
{
24+
"name": "Christoph Schläpfer",
25+
"email": "[email protected]"
26+
}
27+
],
28+
"minimum-stability": "stable",
29+
"config": {
30+
"allow-plugins": {
31+
"phpstan/extension-installer": true
32+
}
2333
}
24-
34+
}

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 7
3+
paths:
4+
- src
5+
treatPhpDocTypesAsCertain: false

0 commit comments

Comments
 (0)