Skip to content

Commit

Permalink
Add support of php 8 and symfony 5.2 (#5)
Browse files Browse the repository at this point in the history
* Remove timecop and replace DateTimeImmutable by Chronos (same interface)

* fix tests errors

* Add delta to integration/acceptance test for token expiration

* fix chronos in require dependencies

* Change Chronos by Carbon

* add php 8 and symfony 5.2

* drop support of php 7.2 and add some fixes in Dockerfile

* add xdebug mode coverage

* bump php cs fixer version

* fix doctrine common doctrine/DoctrineBundle#1197

* fix php cs fixer, disable no_trailing_whitespace_in_string new rule

* fix doctrine mapping exception https://github.com/doctrine/orm/releases/tag/2.8.1

* fix oauth2-server enforcement with client without redirect_uri https://github.com/thephpleague/oauth2-server/releases/tag/8.2.4

* drop support of doctrine bundle 1.8

* revert drop of php 7.2
  • Loading branch information
Orkin authored Apr 12, 2021
1 parent d18142d commit 2997fcc
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.2', '7.3', '7.4' ]
symfony: [ '4.4', '5.0', '5.1' ]
php: [ '7.2', '7.3', '7.4', '8.0' ]
symfony: [ '4.4', '5.0', '5.1', '5.2' ]
composer-flags: [ '', '--prefer-lowest' ]
psr-http-provider: [ 'nyholm', 'zendframework' ]
exclude:
Expand Down
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ return PhpCsFixer\Config::create()
'list_syntax' => ['syntax' => 'short'],
'no_null_property_initialization' => true,
'no_superfluous_phpdoc_tags' => true,
'no_trailing_whitespace_in_string' => false,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => [
'imports_order' => [
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This package is currently in the active development.

## Requirements

* [PHP 7.2](http://php.net/releases/7_2_0.php) or greater
* [PHP 7.3](http://php.net/releases/7_2_0.php) or greater
* [Symfony 4.4](https://symfony.com/roadmap/4.4) or [Symfony 5.x](https://symfony.com/roadmap/5.0)

## Installation
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"require": {
"php": ">=7.2",
"ajgarlag/psr-http-message-bundle": "^1.1",
"doctrine/doctrine-bundle": "^1.8|^2.0",
"doctrine/orm": "^2.7",
"league/oauth2-server": "^8.0",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/orm": "^2.8.1",
"league/oauth2-server": "^8.2.4",
"nesbot/carbon": "^2.46",
"psr/http-factory": "^1.0",
"symfony/framework-bundle": "^4.4|^5.0",
Expand Down
1 change: 1 addition & 0 deletions dev/bin/php-test
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ set -e
readonly BASE_DIR=$(cd "$(dirname "$0")"; pwd)

"${BASE_DIR}"/docker-compose run --rm --no-deps \
-e XDEBUG_MODE=coverage \
php "$@"
20 changes: 10 additions & 10 deletions dev/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ARG PHP_VERSION=7.2

FROM php:${PHP_VERSION}-cli-alpine3.10
FROM php:${PHP_VERSION}-cli-alpine3.12
LABEL maintainer="Petar Obradović <[email protected]>"

ARG COMPOSER_VERSION=1.9.3
ARG FLEX_VERSION=1.6.2
ARG PHP_CS_FIXER_VERSION=2.16.2
ARG XDEBUG_VERSION=2.9.2
ARG COMPOSER_VERSION=2.0.2
ARG FLEX_VERSION=1.12.2
ARG PHP_CS_FIXER_VERSION=2.18.4
ARG XDEBUG_VERSION=3.0.3

ENV XDEBUG_REMOTE_AUTOSTART 0
ENV XDEBUG_START_WITH_REQUEST 0

# This is where we're going to store all of our non-project specific binaries
RUN mkdir -p /app/bin
Expand All @@ -32,10 +32,10 @@ RUN apk add --update --no-cache --virtual .build-deps \
RUN mv ${PHP_INI_DIR}/php.ini-development ${PHP_INI_DIR}/php.ini

RUN echo '[xdebug]' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.remote_autostart = ${XDEBUG_REMOTE_AUTOSTART}' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.remote_enable = 1' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.remote_connect_back = 0' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.remote_host = %XDEBUG_REMOTE_HOST%' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini
&& echo 'xdebug.mode = debug' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.start_with_request = ${XDEBUG_START_WITH_REQUEST}' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.discover_client_host = 0' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.client_host = %XDEBUG_CLIENT_HOST%' >> ${PHP_INI_DIR}/conf.d/docker-php-ext-xdebug.ini

# Utilities needed to run this image
RUN apk add --update --no-cache \
Expand Down
2 changes: 1 addition & 1 deletion dev/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ groupmod -og "${HOST_GROUP_ID}" app &> /dev/null

HOST_IP="${HOST_IP:-$(ip route | grep ^default | awk '{ print $3 }')}"

sed -i "s/%XDEBUG_REMOTE_HOST%/$HOST_IP/" \
sed -i "s/%XDEBUG_CLIENT_HOST%/$HOST_IP/" \
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

su-exec app docker-php-entrypoint "$@"

0 comments on commit 2997fcc

Please sign in to comment.