Skip to content

Commit 116a6c6

Browse files
authored
(U2C #3) update CI, release configuration, and dev dependencies for min PHP version of 8.0 (#104)
* update CI, release configuration, and dev dependencies for min PHP version of 8.0- * require more recent php-cs-fixer
1 parent 32ded83 commit 116a6c6

File tree

8 files changed

+40
-26
lines changed

8 files changed

+40
-26
lines changed

.circleci/config.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ workflows:
99
- test-on-linux:
1010
matrix:
1111
parameters:
12-
php-version: ["7.3", "7.4", "8.0", "8.1"]
12+
php-version: ["8.0", "8.1"]
1313
composer-dependencies: ["lowest", "highest"]
1414
- test-on-windows
1515

@@ -77,22 +77,12 @@ jobs:
7777
name: downgrade to lowest versions
7878
command: composer update --prefer-lowest --prefer-stable
7979

80-
- run:
81-
name: psalm linting
82-
command: ./vendor/bin/psalm --no-cache
83-
- when:
84-
condition:
85-
not:
86-
equal: [ "8.1", <<parameters.php-version>> ]
87-
steps:
88-
- run:
89-
name: php-cs-fixer check
90-
command: composer cs-check
9180
- run:
9281
name: run tests
93-
command: php -d xdebug.mode=coverage vendor/bin/phpunit
94-
environment:
95-
XDEBUG_MODE: coverage
82+
command: make test
83+
- run:
84+
name: lint
85+
command: make lint
9686

9787
- run:
9888
name: build contract test service

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.iml
55
composer.phar
66
.php_cs.cache
7+
.php-cs-fixer.cache
78
.vagrant
89
integration-tests/vendor
910
composer.lock

.ldrelease/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ publications:
99
description: Packagist
1010

1111
jobs:
12-
- template:
12+
- docker:
13+
image: ldcircleci/php-sdk-release:4 # Releaser's default for PHP is still php-sdk-release:3, which is PHP 7.x
14+
template:
1315
name: php
1416

1517
documentation:

CONTRIBUTING.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ composer install
2828

2929
To run all unit tests:
3030

31-
```
31+
```shell
3232
./vendor/bin/phpunit
33+
34+
# Or, as a shortcut in Linux:
35+
make test
3336
```
3437

3538
It is preferable to run tests against all supported minor versions of PHP (as described in `README.md` under Requirements), or at least the lowest and highest versions, prior to submitting a pull request. However, LaunchDarkly's CI tests will run automatically against all supported versions.
@@ -45,3 +48,13 @@ To run the SDK contract test suite in Linux (see [`test-service/README.md`](./te
4548
```bash
4649
make contract-tests
4750
```
51+
52+
To run the Psalm linter and cs-check:
53+
54+
```shell
55+
./vendor/bin/psalm --no-cache
56+
composer cs-check
57+
58+
# Or, as a shortcut in Linux:
59+
make lint
60+
```

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11

2+
test:
3+
php -d xdebug.mode=coverage vendor/bin/phpunit
4+
5+
lint:
6+
./vendor/bin/psalm --no-cache
7+
composer cs-check
8+
9+
210
TEMP_TEST_OUTPUT=/tmp/sse-contract-test-service.log
311

412
# TEST_HARNESS_PARAMS can be set to add -skip parameters for any contract tests that cannot yet pass

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
## Supported PHP versions
1414

15-
This version of the LaunchDarkly SDK is compatible with PHP 7.3 and higher.
15+
This version of the LaunchDarkly SDK is compatible with PHP 8.0 and higher.
1616

1717
## Getting started
1818

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
}
1515
],
1616
"require": {
17-
"php": ">=7.3",
18-
"monolog/monolog": "^1.6|^2.0|^3.0",
17+
"php": ">=8.0",
18+
"monolog/monolog": "^2.0|^3.0",
1919
"psr/log": "^1.0|^2.0|^3.0"
2020
},
2121
"require-dev": {
22-
"friendsofphp/php-cs-fixer": ">=2.18.0 <3.0",
23-
"guzzlehttp/guzzle": "^6.3 | ^7",
22+
"friendsofphp/php-cs-fixer": "^3.12.0",
23+
"guzzlehttp/guzzle": "^7",
2424
"kevinrob/guzzle-cache-middleware": "^4.0",
2525
"phpunit/php-code-coverage": "^9",
2626
"phpunit/phpunit": "^9",

test-service/composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
],
88
"require": {
99
"doctrine/cache": "^1.0",
10-
"guzzlehttp/guzzle": "^6.3 | ^7",
10+
"guzzlehttp/guzzle": "^7",
1111
"kevinrob/guzzle-cache-middleware": "^4.0",
1212
"launchdarkly/server-sdk": "*",
13-
"mikecao/flight": "1.* | 2.*",
14-
"monolog/monolog": "1.*",
15-
"php": ">=7.3",
13+
"mikecao/flight": "^2",
14+
"monolog/monolog": "^2",
15+
"php": ">=8.0",
1616
"psr/log": "1.*"
1717
},
1818
"minimum-stability": "dev",

0 commit comments

Comments
 (0)