Skip to content

Commit bd53374

Browse files
authored
Merge pull request #14 from veewee/php80
Add PHP80 compatibility
2 parents 1cf51a9 + d84bfdb commit bd53374

12 files changed

Lines changed: 152 additions & 47 deletions

.github/ISSUE_TEMPLATE/Bug.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: 🐞 Bug Report
3+
about: Something is broken? 🔨
4+
---
5+
6+
### Bug Report
7+
8+
<!-- Fill in the relevant information below to help triage your issue. -->
9+
10+
| Q | A
11+
|------------ | ------
12+
| BC Break | yes/no
13+
| Version | x.y.z
14+
15+
#### Summary
16+
17+
<!-- Provide a summary describing the problem you are experiencing. -->
18+
19+
#### Current behaviour
20+
21+
<!-- What is the current (buggy) behaviour? -->
22+
23+
#### How to reproduce
24+
25+
<!--
26+
Provide steps to reproduce the bug.
27+
If possible, also add a code snippet with relevant configuration, driver/platform information, SQL queries, etc.
28+
Adding a failing Unit or Functional Test would help us a lot - you can submit one in a Pull Request separately, referencing this bug report.
29+
-->
30+
31+
#### Expected behaviour
32+
33+
<!-- What was the expected (correct) behaviour? -->
34+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: 🎉 Feature Request
3+
about: You have a neat idea that should be implemented? 🎩
4+
---
5+
6+
### Feature Request
7+
8+
<!-- Fill in the relevant information below to help triage your issue. -->
9+
10+
| Q | A
11+
|------------ | ------
12+
| New Feature | yes
13+
| RFC | yes/no
14+
| BC Break | yes/no
15+
16+
#### Summary
17+
18+
<!-- Provide a summary of the feature you would like to see implemented. -->
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: ❓ Support Question
3+
about: Have a problem that you can't figure out? 🤔
4+
---
5+
6+
<!-- Fill in the relevant information below to help triage your issue. -->
7+
8+
| Q | A
9+
|------------ | -----
10+
| Version | x.y.z
11+
12+
13+
### Support Question
14+
15+
<!-- Describe the issue you are facing here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Fill in the relevant information below to help triage your pull request. -->
2+
3+
| Q | A
4+
|------------- | -----------
5+
| Type | bug/feature/improvement
6+
| BC Break | yes/no
7+
| Fixed issues | <!-- use #NUM format to reference an issue -->
8+
9+
#### Summary
10+
11+
<!-- Provide a summary of your change. -->

.github/workflows/grumphp.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: GrumPHP
2+
3+
on: [push, pull_request]
4+
jobs:
5+
run:
6+
runs-on: ${{ matrix.operating-system }}
7+
strategy:
8+
matrix:
9+
operating-system: [ubuntu-latest]
10+
php-versions: ['7.3', '7.4', '8.0']
11+
composer-options: ['', '--prefer-lowest']
12+
fail-fast: false
13+
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-options }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@master
17+
- name: Install PHP
18+
uses: shivammathur/setup-php@master
19+
with:
20+
php-version: ${{ matrix.php-versions }}
21+
tools: 'composer:v2'
22+
extensions: pcov, mbstring, posix
23+
- name: Check Versions
24+
run: |
25+
php -v
26+
php -m
27+
composer --version
28+
- name: Get composer cache directory
29+
id: composercache
30+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
31+
- name: Cache dependencies
32+
uses: actions/cache@v2
33+
with:
34+
path: ${{ steps.composercache.outputs.dir }}
35+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
36+
restore-keys: ${{ runner.os }}-composer-
37+
- name: Install dependencies <PHP8
38+
if: matrix.php-versions != '8.0'
39+
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
40+
#
41+
# Currently php-cs-fixer is nog PHP 8 compatible yet!
42+
#
43+
- name: Install dependencies PHP8
44+
if: matrix.php-versions == '8.0'
45+
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} --ignore-platform-reqs
46+
- name: Set git variables
47+
run: |
48+
git config --global user.email "you@example.com"
49+
git config --global user.name "Your Name"
50+
- name: Run the tests
51+
run: php vendor/bin/grumphp run --no-interaction
52+
env:
53+
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php-versions == '8.0'}}

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.2",
13+
"php": "^7.3 || ^8.0",
1414
"phpro/api-problem": "^1.0",
1515
"symfony/dependency-injection": "^4.4|^5.0",
1616
"symfony/event-dispatcher": "^4.4|^5.0",
1717
"symfony/http-kernel": "^4.4|^5.0"
1818
},
1919
"require-dev": {
20-
"friendsofphp/php-cs-fixer": "^2.12",
21-
"matthiasnoback/symfony-dependency-injection-test": "^3.0|^4.0",
22-
"phpro/grumphp": "^0.17.2",
23-
"phpunit/phpunit": "^8.5",
20+
"friendsofphp/php-cs-fixer": "^2.16.7",
21+
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
22+
"phpro/grumphp-shim": "^1.2.0",
23+
"phpspec/prophecy-phpunit": "^2.0",
24+
"phpunit/phpunit": "^9.4",
2425
"symfony/security-core": "^4.4|^5.0"
2526
},
2627
"config": {

grumphp.yml.dist

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
parameters:
2-
git_dir: .
3-
bin_dir: vendor/bin
1+
grumphp:
42
tasks:
53
phpcsfixer2:
64
config: ".php_cs.dist"
75
config_contains_finder: true
8-
metadata:
9-
priority: 10000
10-
phpunit:
11-
metadata:
12-
priority: 9000
6+
phpunit: ~
137
clover_coverage:
148
clover_file: var/coverage.xml
159
level: 100
1610
metadata:
17-
priority: 8000
11+
priority: -1
1812
composer:
1913
no_check_lock: true
2014
xmllint:

test/EventListener/JsonApiProblemExceptionListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Phpro\ApiProblemBundle\Transformer\ExceptionTransformerInterface;
1212
use PHPUnit\Framework\TestCase;
1313
use Prophecy\Argument;
14+
use Prophecy\PhpUnit\ProphecyTrait;
1415
use Prophecy\Prophecy\ObjectProphecy;
1516
use Symfony\Component\HttpFoundation\JsonResponse;
1617
use Symfony\Component\HttpFoundation\Request;
@@ -20,6 +21,8 @@
2021
/** @covers \Phpro\ApiProblemBundle\EventListener\JsonApiProblemExceptionListener */
2122
class JsonApiProblemExceptionListenerTest extends TestCase
2223
{
24+
use ProphecyTrait;
25+
2326
/**
2427
* @var ObjectProphecy|Request
2528
*/

test/Exception/ApiProblemHttpExceptionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
use Phpro\ApiProblemBundle\Exception\ApiProblemHttpException;
99
use Phpro\ApiProblemBundle\Transformer\ApiProblemExceptionTransformer;
1010
use PHPUnit\Framework\TestCase;
11+
use Prophecy\PhpUnit\ProphecyTrait;
1112
use Prophecy\Prophecy\ObjectProphecy;
1213
use Symfony\Component\HttpKernel\Exception\HttpException;
1314

1415
class ApiProblemHttpExceptionTest extends TestCase
1516
{
17+
use ProphecyTrait;
18+
1619
/**
1720
* @var HttpApiProblem|ObjectProphecy
1821
*/

0 commit comments

Comments
 (0)