Skip to content

Commit

Permalink
Merge pull request #1 from spaze/spaze/php8
Browse files Browse the repository at this point in the history
Explicitly support PHP 8.0
  • Loading branch information
spaze authored Dec 11, 2020
2 parents 5c59081 + 5f8ed30 commit a7e153e
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
phpcs.xml export-ignore
phpstan.neon export-ignore
42 changes: 42 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: PHP Tests

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 7.2
- 7.3
- 7.4
- 8.0

steps:
- uses: actions/checkout@v2

- name: OS info
run: cat /etc/os-release

- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: PHP info
run: |
php -v
php -m
- name: Validate composer.json
run: composer validate --strict --no-interaction

- name: Install dependencies
run: composer update --no-progress --no-interaction

- name: Run tests
run: composer test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
composer.lock
vendor
20 changes: 18 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,27 @@
}
],
"require": {
"php": ">=7.2",
"php": "^7.2 || ^8.0",
"paragonie/halite": "^4.5",
"paragonie/hidden-string": "^1"
"paragonie/hidden-string": "^1 || ^2"
},
"autoload": {
"psr-4": {"Spaze\\Encryption\\": "src"}
},
"require-dev": {
"spaze/coding-standard": "^0.0.4",
"php-parallel-lint/php-parallel-lint": "^1.2",
"php-parallel-lint/php-console-highlighter": "^0.5.0",
"phpstan/phpstan": "^0.12.59"
},
"scripts": {
"lint": "vendor/bin/parallel-lint --colors src",
"phpcs": "vendor/bin/phpcs src",
"phpstan": "vendor/phpstan/phpstan/phpstan --ansi analyse --configuration phpstan.neon",
"test": [
"@lint",
"@phpcs",
"@phpstan"
]
}
}
9 changes: 9 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<ruleset name="VatCalculator">
<arg name="extensions" value="php"/>
<arg name="cache"/>
<arg name="colors"/>
<arg value="s"/>
<arg value="p"/>
<rule ref="vendor/spaze/coding-standard/src/ruleset.xml"/>
</ruleset>
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
parameters:
level: max
paths:
- src

includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon

0 comments on commit a7e153e

Please sign in to comment.