Skip to content

Commit d5783e3

Browse files
authored
feat: Add support for PHP 8.1, 8.2 (#489)
BREAKING CHANGE: This release requires a PHP version of >= 8.1.0.
1 parent 7699895 commit d5783e3

27 files changed

+18133
-3001
lines changed

.github/workflows/ci.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: ci
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- "**"
10+
env:
11+
NODE_VERSION: 16.17.1
12+
jobs:
13+
check-lock-file-version:
14+
name: NPM Lock File Version
15+
timeout-minutes: 5
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Check NPM lock file version
20+
uses: mansona/npm-lockfile-version@v1
21+
with:
22+
version: 2
23+
build:
24+
runs-on: ubuntu-20.04
25+
timeout-minutes: 30
26+
strategy:
27+
matrix:
28+
include:
29+
- name: PHP 8.1
30+
PHP_VERSION: 8.1
31+
- name: PHP 8.2
32+
PHP_VERSION: 8.2
33+
fail-fast: false
34+
steps:
35+
- uses: actions/checkout@v3
36+
- name: Use Node.js
37+
uses: actions/setup-node@v3
38+
with:
39+
node-version: ${{ env.NODE_VERSION }}
40+
- name: Setup PHP with PECL extension
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.PHP_VERSION }}
44+
- name: Cache Node.js modules
45+
uses: actions/cache@v3
46+
with:
47+
path: ~/.npm
48+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
49+
restore-keys: |
50+
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
51+
- run: composer install
52+
- run: npm ci
53+
- run: npm start
54+
- run: npm run lint
55+
- run: npm run test:coverage
56+
- run: npm run document-check
57+
- run: npm run document
58+
env:
59+
CI: true
60+
- run: bash <(curl -s https://codecov.io/bash)
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: release-manual-docs
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
default: ''
7+
description: 'Version tag:'
8+
jobs:
9+
docs-publish:
10+
if: github.event.inputs.tag != ''
11+
runs-on: ubuntu-20.04
12+
timeout-minutes: 15
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.event.inputs.tag }}
17+
- name: Use Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 16
21+
- name: Cache Node.js modules
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-node-
28+
- name: Generate Docs
29+
run: |
30+
npm ci
31+
npm run document-check
32+
npm run documentation
33+
env:
34+
SOURCE_TAG: ${{ github.event.inputs.tag }}
35+
- name: Deploy
36+
uses: peaceiris/[email protected]
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./.phpdoc/build

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.idea
2-
composer.lock
2+
.DS_Store
33
vendor
44

55
# npm based parse-server-test
@@ -10,12 +10,13 @@ test_logs
1010
# ignore test results
1111
phpunit-test-results
1212
.phpunit.result.cache
13-
13+
.phpunit.cache
1414
*.log
1515

1616
coverage.xml
1717

1818
# ignore phpdoc
1919
output/
20+
.phpdoc/
2021

2122
composer.phar

.travis.yml

-36
This file was deleted.

autoload.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* You only need this file if you are not using composer.
55
*/
66

7-
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
8-
throw new Exception('The Parse SDK requires PHP version 5.4 or higher.');
7+
if (version_compare(PHP_VERSION, '8.1.0', '<')) {
8+
throw new Exception('The Parse SDK requires PHP version 8.1 or higher.');
99
}
1010

1111
/*

composer.json

+12-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">= 7.1",
15+
"php": ">=8.1 <8.3",
1616
"ext-curl": "*",
1717
"ext-json": "*"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "7",
21-
"squizlabs/php_codesniffer": "3.6.0",
22-
"phpdocumentor/phpdocumentor": "2.9",
23-
"jms/serializer": "1.7.1"
20+
"phpunit/phpunit": "10.1.1",
21+
"squizlabs/php_codesniffer": "3.7.2",
22+
"phpdocumentor/phpdocumentor": "3.0.0",
23+
"jms/serializer": "1.7.1",
24+
"nikic/php-parser": "4.15"
2425
},
26+
"minimum-stability": "dev",
2527
"autoload": {
2628
"psr-4": {
2729
"Parse\\": "src/Parse/"
@@ -31,5 +33,10 @@
3133
"psr-4": {
3234
"Parse\\Test\\": "tests/Parse/"
3335
}
36+
},
37+
"config": {
38+
"allow-plugins": {
39+
"symfony/flex": true
40+
}
3441
}
3542
}

0 commit comments

Comments
 (0)