Skip to content

Commit 41cc2d2

Browse files
committed
Upgraded php version & deployment setup
2 parents ed43209 + 850edd8 commit 41cc2d2

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ on: [push, pull_request]
33

44
jobs:
55
full-build:
6+
name: "Coding standards & coverage tests"
67
runs-on: ${{ matrix.operating-system }}
78
strategy:
89
matrix:
9-
operating-system: [ubuntu-latest]
10-
php-versions: ["7.4"]
10+
operating-system: ['ubuntu-latest']
11+
php-versions: ['7.4']
1112
env:
1213
extensions: pcov, dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
1314
key: cache-v2
@@ -36,23 +37,20 @@ jobs:
3637
ini-values: assert.exception=1, zend.assertions=1
3738
- name: "Validate composer.json"
3839
run: composer validate
39-
- name: "Set composer cache directory"
40-
id: composer-cache-full-build
41-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
4240
- name: "Setup composer cache"
4341
uses: actions/cache@v2
4442
with:
45-
path: ${{ steps.composer-cache-full-build.outputs.dir }}
46-
key: ${{ runner.os }}-composer-full-${{ hashFiles('**/composer.json') }}
47-
restore-keys: ${{ runner.os }}-composer-full-
43+
path: ~/.composer/cache
44+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
45+
restore-keys: ${{ runner.os }}-composer-
4846
- name: "Install highest dependencies"
4947
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable
5048
- name: "Coding standard Php-CS-Fixer checks"
5149
run: vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests
5250
- name: "Coding standard CodeSniffer checks"
5351
run: |
5452
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml src
55-
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml tests
53+
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml --ignore=*/CodeSamples/* tests
5654
- name: "Run PhpUnit tests with coverage"
5755
run: |
5856
mkdir -p build/logs
@@ -63,16 +61,19 @@ jobs:
6361
COVERALLS_RUN_LOCALLY: 1
6462
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
6563

66-
lowest-build:
64+
php-os-builds:
65+
name: "PHP 8 tests"
6766
runs-on: ${{ matrix.operating-system }}
6867
strategy:
6968
matrix:
70-
operating-system: [ubuntu-latest]
71-
php-versions: ["7.4"]
69+
operating-system: ['ubuntu-latest', 'windows-latest', 'macos-latest']
70+
php-versions: ['8.0', '8.1']
7271
env:
7372
extensions: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
7473
key: cache-v2
7574
steps:
75+
- name: "Turn off git EOL conversion"
76+
run: git config --global core.autocrlf false
7677
- name: "Checkout"
7778
uses: actions/checkout@v2
7879
- name: "Setup PHP extensions cache environment"
@@ -95,16 +96,13 @@ jobs:
9596
coverage: none
9697
extensions: ${{ env.extensions }}
9798
ini-values: assert.exception=1, zend.assertions=1
98-
- name: "Set composer cache directory"
99-
id: composer-cache-lowest-build
100-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
10199
- name: "Setup composer cache"
102100
uses: actions/cache@v2
103101
with:
104-
path: ${{ steps.composer-cache-lowest-build.outputs.dir }}
105-
key: ${{ runner.os }}-composer-low-${{ hashFiles('**/composer.json') }}
106-
restore-keys: ${{ runner.os }}-composer-low-
107-
- name: "Install lowest dependencies"
108-
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable --prefer-lowest
102+
path: ~/.composer/cache
103+
key: ${{ runner.os }}-php${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.json') }}
104+
restore-keys: ${{ runner.os }}-php${{ matrix.php-versions }}-composer-
105+
- name: "Install highest dependencies"
106+
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable
109107
- name: "Run PhpUnit tests (no coverage)"
110108
run: vendor/bin/phpunit --no-coverage

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "library",
55
"minimum-stability": "stable",
66
"require": {
7-
"php": "^7.4",
7+
"php": "^7.4 || ^8.0",
88
"psr/http-message": "^1.0",
99
"psr/http-server-handler": "^1.0",
1010
"psr/http-server-middleware": "^1.0"
@@ -28,5 +28,12 @@
2828
"psr-4": {
2929
"Polymorphine\\Headers\\Tests\\": "tests/"
3030
}
31+
},
32+
"scripts": {
33+
"test-cs": [
34+
"vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests",
35+
"vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml src",
36+
"vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml --ignore=*/CodeSamples/* tests"
37+
]
3138
}
3239
}

src/Cookie.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
interface Cookie
1919
{
20-
const NAME_EXTRA_CHARS = '!\#$%&\'*+\-.^_`|~';
21-
const VALUE_EXTRA_CHARS = self::NAME_EXTRA_CHARS . '\/:=?\@()[\]{}<>';
20+
public const NAME_EXTRA_CHARS = '!\#$%&\'*+\-.^_`|~';
21+
public const VALUE_EXTRA_CHARS = self::NAME_EXTRA_CHARS . '\/:=?\@()[\]{}<>';
2222

2323
/**
2424
* @return string

src/Cookie/HeadersContextCookie.php

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

2020
class HeadersContextCookie implements Cookie
2121
{
22-
const DIRECTIVE_NAMES = ['Domain', 'Path', 'Expires', 'MaxAge', 'Secure', 'HttpOnly', 'SameSite'];
22+
public const DIRECTIVE_NAMES = ['Domain', 'Path', 'Expires', 'MaxAge', 'Secure', 'HttpOnly', 'SameSite'];
2323

2424
private string $name;
2525
private array $directives;

0 commit comments

Comments
 (0)