Skip to content

Commit

Permalink
Support for PHP 8 (#2158)
Browse files Browse the repository at this point in the history
painful 66 commits later: required PHP version bumped to 7.3, plugin updates using migrations necessary!
  • Loading branch information
kevinpapst committed Jul 13, 2021
1 parent 3604834 commit 48e66da
Show file tree
Hide file tree
Showing 21 changed files with 1,150 additions and 1,276 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yaml
@@ -1,4 +1,4 @@
name: CI
name: Coverage
on:
pull_request: null
push:
Expand All @@ -19,9 +19,9 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: ['7.3']
php: ['7.4']

name: Coverage - PHP ${{ matrix.php }}
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/linting.yaml
@@ -1,4 +1,4 @@
name: CI
name: Linting
on:
pull_request: null
push:
Expand All @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4']
php: ['7.4', '8.0']

name: Linting - PHP ${{ matrix.php }}
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
Expand All @@ -22,7 +22,7 @@ jobs:
tools: cs2pr:1.1.0
- run: composer install --no-progress
- run: composer validate --strict
- run: vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php_cs.dist --using-cache=no --show-progress=none --format=checkstyle | cs2pr
- run: vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist.php --using-cache=no --show-progress=none --format=checkstyle | cs2pr
- run: vendor/bin/phpstan analyse src -c phpstan.neon --level=5 --no-progress --error-format=checkstyle | cs2pr
- run: vendor/bin/phpstan analyse tests -c tests/phpstan.neon --level=5 --no-progress --error-format=checkstyle | cs2pr
- run: composer kimai:code-lint
7 changes: 4 additions & 3 deletions .github/workflows/testing.yaml
@@ -1,4 +1,4 @@
name: CI
name: Tests
on:
pull_request: null
push:
Expand All @@ -19,9 +19,9 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: ['7.2', '7.3', '7.4']
php: ['7.3', '7.4', '8.0']

name: Tests - PHP ${{ matrix.php }}
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
Expand All @@ -48,6 +48,7 @@ jobs:
MAILER_URL: null://localhost
- name: Run migrations on MySQL
run: |
bin/console doctrine:database:drop --if-exists --force -n
bin/console doctrine:database:create --if-not-exists -n
bin/console doctrine:migrations:migrate -n
bin/console doctrine:migrations:migrate first -n
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -56,6 +56,7 @@ translations/branding.en.xlf
###> friendsofphp/php-cs-fixer ###
.php_cs
.php_cs.cache
.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> symfony/phpunit-bridge ###
Expand Down
13 changes: 8 additions & 5 deletions .php_cs.dist → .php-cs-fixer.dist.php
Expand Up @@ -7,7 +7,8 @@
file that was distributed with this source code.
COMMENT;

return PhpCsFixer\Config::create()
$fixer = new PhpCsFixer\Config();
$fixer
->setRiskyAllowed(true)
->setRules([
'encoding' => true,
Expand All @@ -19,7 +20,7 @@
'function_declaration' => true,
'indentation_type' => true,
'line_ending' => true,
'lowercase_constants' => true,
'constant_case' => ['case' => 'lower'],
'lowercase_keywords' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
Expand All @@ -46,7 +47,7 @@
'statements' => ['return'],
],
'cast_spaces' => true,
'class_attributes_separation' => ['elements' => ['method']],
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => true,
'function_typehint_space' => true,
Expand Down Expand Up @@ -100,7 +101,7 @@
],
'phpdoc_annotation_without_dot' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_alias_tag' => true,
'phpdoc_no_empty_return' => false,
Expand Down Expand Up @@ -130,7 +131,7 @@
'standardize_increment' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => false,
'trailing_comma_in_multiline' => false,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
Expand Down Expand Up @@ -163,3 +164,5 @@
)
->setFormat('checkstyle')
;

return $fixer;
12 changes: 12 additions & 0 deletions UPGRADING.md
Expand Up @@ -8,6 +8,18 @@ you can upgrade your Kimai installation to the latest stable release.
Check below if there are more version specific steps required, which need to be executed after the normal update process.
Perform EACH version specific task between your version and the new one, otherwise you risk data inconsistency or a broken installation.

## [1.15](https://github.com/kevinpapst/kimai2/releases/tag/1.15)

**ATTENTION**
- This release bumps the minimum required [PHP version to 7.3](https://www.kimai.org/blog/2021/php8-support-php72-dropped/)
- All plugins that use own databases need to be updated as well

PHP 8 compatibility forced to upgrade MANY libraries, including but not limited to:

- Doctrine Migrations, whose new major version forces the plugin updates
- Gedmo v3 (which include BC breaks in definitions)
- Doctrine DBAL and others, which required PHP 7.3 as well

## [1.14](https://github.com/kevinpapst/kimai2/releases/tag/1.14)

**CRITICAL BC break**: SQLite support was removed. If you are using SQLite, you have to [read this blog post](https://www.kimai.org/blog/2021/sqlite-and-ftp-support-removed/) and migrate to MySQL/MariaDB first!
Expand Down
28 changes: 14 additions & 14 deletions composer.json
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^7.2.9",
"php": ">=7.3",
"ext-gd": "*",
"ext-intl": "*",
"ext-json": "*",
Expand All @@ -21,29 +21,29 @@
"beberlei/doctrineextensions": "^1.2",
"composer/package-versions-deprecated": "^1.8",
"doctrine/doctrine-bundle": "^2.0",
"doctrine/doctrine-migrations-bundle": "^2.1",
"doctrine/orm": "^2.7",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.8",
"erusev/parsedown": "^1.6",
"friendsofsymfony/rest-bundle": "^3.0",
"gedmo/doctrine-extensions": "^2.4",
"gedmo/doctrine-extensions": "^3.0",
"handcraftedinthealps/rest-routing-bundle": "^1.0",
"hslavich/oneloginsaml-bundle": "^1.4",
"jms/metadata": "^2.0",
"jms/serializer-bundle": "^3.2",
"jms/serializer-bundle": "^3.9",
"kevinpapst/adminlte-bundle": "^3.3",
"kimai/user-bundle": "^1.1",
"laravolt/avatar": "^3.0",
"kimai/user-bundle": "^2.0",
"laravolt/avatar": "^4.0",
"league/csv": "^9.4",
"league/html-to-markdown": "^4.9",
"league/html-to-markdown": "^5.0",
"mpdf/mpdf": "^8.0",
"nelmio/api-doc-bundle": "^3.2",
"nelmio/cors-bundle": "^1.5",
"nelmio/cors-bundle": "^2.0",
"onelogin/php-saml": "^3.4",
"pagerfanta/pagerfanta": "^2.1",
"phpoffice/phpspreadsheet": "^1.16",
"phpoffice/phpword": "^0.17",
"phpoffice/phpword": "^0.18",
"psr/log": "^1.1",
"sensio/framework-extra-bundle": "^5.2",
"sensio/framework-extra-bundle": "^6.0",
"symfony/amazon-mailer": "^4.4",
"symfony/asset": "^4.4",
"symfony/console": "^4.4",
Expand Down Expand Up @@ -79,7 +79,7 @@
"require-dev": {
"dama/doctrine-test-bundle": "^6.0",
"doctrine/doctrine-fixtures-bundle": "^3.2",
"friendsofphp/php-cs-fixer": "^2.10",
"friendsofphp/php-cs-fixer": "^3.0",
"fzaninotto/faker": "^1.8",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-doctrine": "^0.12",
Expand All @@ -100,10 +100,10 @@
"type": "artifact",
"url": "var/packages/"
}
],
],
"config": {
"platform": {
"php": "7.2.9"
"php": "7.3"
},
"preferred-install": {
"*": "dist"
Expand Down

0 comments on commit 48e66da

Please sign in to comment.