Skip to content

Commit 1fcb2e3

Browse files
authored
Modernize (#2)
1 parent bf8fcc6 commit 1fcb2e3

File tree

16 files changed

+2778
-346
lines changed

16 files changed

+2778
-346
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
tests:
11+
name: PHP ${{ matrix.php }} Tests
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php: ['8.3']
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
extensions: curl, json, mbstring
26+
coverage: xdebug
27+
tools: composer:v2
28+
29+
- name: Validate composer.json
30+
run: composer validate --strict
31+
32+
- name: Install dependencies
33+
run: composer install --prefer-dist --no-progress
34+
35+
- name: Run PHPStan
36+
run: vendor/bin/phpstan analyse
37+
38+
- name: Run PHPUnit
39+
run: vendor/bin/phpunit --coverage-text

.gitignore

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,22 @@ vendor/
44
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
55
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
66
# composer.lock
7-
nbproject/
7+
nbproject/
8+
9+
# Testing
10+
var/
11+
.phpunit.result.cache
12+
13+
# IDE
14+
.idea/
15+
.vscode/
16+
*.swp
17+
*.swo
18+
19+
# OS
20+
.DS_Store
21+
Thumbs.db
22+
23+
# Docker
24+
.env
25+
docker-compose.override.yml

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM php:8.3-cli-alpine
2+
3+
RUN apk add --no-cache \
4+
bash \
5+
git \
6+
unzip \
7+
$PHPIZE_DEPS
8+
9+
RUN pecl install pcov \
10+
&& docker-php-ext-enable pcov
11+
12+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
13+
14+
WORKDIR /app

composer.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,27 @@
1414
}
1515
],
1616
"require": {
17-
"php": ">=5.4.0",
17+
"php": ">=8.3.0",
1818
"datingvip/curl": "^2.0"
1919
},
20+
"require-dev": {
21+
"phpstan/extension-installer": "^1.3",
22+
"phpstan/phpstan": "^2.0",
23+
"phpunit/phpunit": "^11.0"
24+
},
2025
"autoload": {
21-
"psr-0": {
22-
"DatingVIP": "src"
26+
"psr-4": {
27+
"DatingVIP\\API\\": "src/DatingVIP/API/"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"DatingVIP\\API\\Tests\\": "tests/"
33+
}
34+
},
35+
"config": {
36+
"allow-plugins": {
37+
"phpstan/extension-installer": true
2338
}
2439
}
2540
}

0 commit comments

Comments
 (0)