Skip to content

Commit

Permalink
Merge pull request #14 from veewee/php80
Browse files Browse the repository at this point in the history
Add PHP80 compatibility
  • Loading branch information
veewee authored Nov 27, 2020
2 parents 1cf51a9 + d84bfdb commit bd53374
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 47 deletions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: 🐞 Bug Report
about: Something is broken? 🔨
---

### Bug Report

<!-- Fill in the relevant information below to help triage your issue. -->

| Q | A
|------------ | ------
| BC Break | yes/no
| Version | x.y.z

#### Summary

<!-- Provide a summary describing the problem you are experiencing. -->

#### Current behaviour

<!-- What is the current (buggy) behaviour? -->

#### How to reproduce

<!--
Provide steps to reproduce the bug.
If possible, also add a code snippet with relevant configuration, driver/platform information, SQL queries, etc.
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.
-->

#### Expected behaviour

<!-- What was the expected (correct) behaviour? -->

18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_Request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: 🎉 Feature Request
about: You have a neat idea that should be implemented? 🎩
---

### Feature Request

<!-- Fill in the relevant information below to help triage your issue. -->

| Q | A
|------------ | ------
| New Feature | yes
| RFC | yes/no
| BC Break | yes/no

#### Summary

<!-- Provide a summary of the feature you would like to see implemented. -->
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/Support_Question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: ❓ Support Question
about: Have a problem that you can't figure out? 🤔
---

<!-- Fill in the relevant information below to help triage your issue. -->

| Q | A
|------------ | -----
| Version | x.y.z


### Support Question

<!-- Describe the issue you are facing here. -->
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Fill in the relevant information below to help triage your pull request. -->

| Q | A
|------------- | -----------
| Type | bug/feature/improvement
| BC Break | yes/no
| Fixed issues | <!-- use #NUM format to reference an issue -->

#### Summary

<!-- Provide a summary of your change. -->
53 changes: 53 additions & 0 deletions .github/workflows/grumphp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: GrumPHP

on: [push, pull_request]
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3', '7.4', '8.0']
composer-options: ['', '--prefer-lowest']
fail-fast: false
name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} with ${{ matrix.composer-options }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
tools: 'composer:v2'
extensions: pcov, mbstring, posix
- name: Check Versions
run: |
php -v
php -m
composer --version
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies <PHP8
if: matrix.php-versions != '8.0'
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
#
# Currently php-cs-fixer is nog PHP 8 compatible yet!
#
- name: Install dependencies PHP8
if: matrix.php-versions == '8.0'
run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} --ignore-platform-reqs
- name: Set git variables
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
- name: Run the tests
run: php vendor/bin/grumphp run --no-interaction
env:
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.php-versions == '8.0'}}
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.3 || ^8.0",
"phpro/api-problem": "^1.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/event-dispatcher": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.12",
"matthiasnoback/symfony-dependency-injection-test": "^3.0|^4.0",
"phpro/grumphp": "^0.17.2",
"phpunit/phpunit": "^8.5",
"friendsofphp/php-cs-fixer": "^2.16.7",
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
"phpro/grumphp-shim": "^1.2.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.4",
"symfony/security-core": "^4.4|^5.0"
},
"config": {
Expand Down
12 changes: 3 additions & 9 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
parameters:
git_dir: .
bin_dir: vendor/bin
grumphp:
tasks:
phpcsfixer2:
config: ".php_cs.dist"
config_contains_finder: true
metadata:
priority: 10000
phpunit:
metadata:
priority: 9000
phpunit: ~
clover_coverage:
clover_file: var/coverage.xml
level: 100
metadata:
priority: 8000
priority: -1
composer:
no_check_lock: true
xmllint:
Expand Down
3 changes: 3 additions & 0 deletions test/EventListener/JsonApiProblemExceptionListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Phpro\ApiProblemBundle\Transformer\ExceptionTransformerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -20,6 +21,8 @@
/** @covers \Phpro\ApiProblemBundle\EventListener\JsonApiProblemExceptionListener */
class JsonApiProblemExceptionListenerTest extends TestCase
{
use ProphecyTrait;

/**
* @var ObjectProphecy|Request
*/
Expand Down
3 changes: 3 additions & 0 deletions test/Exception/ApiProblemHttpExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
use Phpro\ApiProblemBundle\Exception\ApiProblemHttpException;
use Phpro\ApiProblemBundle\Transformer\ApiProblemExceptionTransformer;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
use Symfony\Component\HttpKernel\Exception\HttpException;

class ApiProblemHttpExceptionTest extends TestCase
{
use ProphecyTrait;

/**
* @var HttpApiProblem|ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions test/Transformer/ApiProblemExceptionTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
use Phpro\ApiProblemBundle\Transformer\ApiProblemExceptionTransformer;
use Phpro\ApiProblemBundle\Transformer\ExceptionTransformerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;

/**
* @covers \Phpro\ApiProblemBundle\Transformer\ApiProblemExceptionTransformer
*/
class ApiProblemExceptionTransformerTest extends TestCase
{
use ProphecyTrait;

/**
* @var ApiProblemInterface|ObjectProphecy
*/
Expand Down
3 changes: 3 additions & 0 deletions test/Transformer/ChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
use Phpro\ApiProblemBundle\Transformer\ExceptionTransformerInterface;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;

/**
* @covers \Phpro\ApiProblemBundle\Transformer\Chain
*/
class ChainTest extends TestCase
{
use ProphecyTrait;

/** @test */
public function it_is_an_exception_transformer(): void
{
Expand Down

0 comments on commit bd53374

Please sign in to comment.