Skip to content

Commit

Permalink
Merge pull request #22 from ebln/php74-liberal
Browse files Browse the repository at this point in the history
Switch to PHP 7.4
  • Loading branch information
ebln committed Jul 10, 2021
2 parents 7a07c72 + 4d04652 commit 73cff70
Show file tree
Hide file tree
Showing 17 changed files with 677 additions and 411 deletions.
21 changes: 12 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
/*.tar export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml* export-ignore
/tests export-ignore
/vendor export-ignore
/.idea export-ignore
/*.tar export-ignore
/mock export-ignore
/coverage export-ignore
/.github export-ignore
/.php-cs-fixer.dist export-ignore
/.php_cs.dist export-ignore
/.provision export-ignore
/.travis.yml export-ignore
/coverage export-ignore
/docs export-ignore
/mock export-ignore
/phpstan.neon export-ignore
/phpunit.xml* export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/phpstan.neon export-ignore
/tests export-ignore
/vendor export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/buildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
operating-system: [ ubuntu-20.04 ]
php: [ '7.2', '7.3', '7.4' ]
php: [ '7.4', '8.0' ]
name: Build and test on ${{ matrix.php }}
steps:
- name: Checkout repository
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
/build/
/phpunit.xml
.php_cs*
.php-cs-fixer*
!.php_cs.dist
!.php-cs-fixer.dist
/var/*
!/var/cache
/var/cache/*
Expand Down
36 changes: 17 additions & 19 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,25 @@
$config->setRiskyAllowed(true)
->setRules(
[
'@PSR2' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHPUnit75Migration:risky' => true,
//'@PHP73Migration' => true,
'@PHP71Migration:risky' => true,
'php_unit_dedicate_assert' => ['target' => '5.6'],
'array_syntax' => ['syntax' => 'short'],
'no_superfluous_phpdoc_tags' => true,
'native_function_invocation' => false,
'concat_space' => ['spacing' => 'one'],
'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => [
'@PSR2' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHPUnit75Migration:risky' => true,
'@PHP73Migration' => true,
'@PHP71Migration:risky' => true,
'php_unit_dedicate_assert' => ['target' => '5.6'],
'array_syntax' => ['syntax' => 'short'],
'no_superfluous_phpdoc_tags' => true,
'native_function_invocation' => false,
'concat_space' => ['spacing' => 'one'],
'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'binary_operator_spaces' => false,
'phpdoc_summary' => false,
'multiline_whitespace_before_semicolons' => false,
'cast_spaces' => ['space' => 'none'],
'comment_to_phpdoc' => false,
'phpdoc_summary' => false,
'cast_spaces' => ['space' => 'none'],
'binary_operator_spaces' => ['default' => null, 'operators' => ['=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal']],
]
)
->setFinder($finder);
Expand Down
24 changes: 24 additions & 0 deletions .provision/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM php:7.4-cli

COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

RUN apt-get update \
&& apt-get install -y git nano zip unzip zlib1g-dev libzip-dev \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& groupadd --gid 1000 app \
&& useradd --uid 1000 --gid app --shell /bin/bash --create-home app \
&& touch /var/log/xdebug.log && chgrp 1000 /var/log/xdebug.log && chmod g+w /var/log/xdebug.log \
&& sed -i -e '/alias l\|export\|eval/s/#//' /root/.bashrc \
&& mkdir --parents /var/www/src /var/www/tests \
&& chown 1000:1000 /var/www/src /var/www/tests \
&& sed -i -e '/xdebug.remote_autostart/s/1/0/' /usr/local/etc/php/conf.d/30-xdebug.ini \
&& true

USER app

ENV PATH "$PATH:/home/app/.composer/vendor/bin"

RUN composer global require friendsofphp/php-cs-fixer \
&& sed -i -e '/alias l\|export\|eval/s/#//' /home/app/.bashrc
11 changes: 11 additions & 0 deletions .provision/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.6'
services:
php:
build:
context: .
volumes:
- ./..:/var/www
extra_hosts:
- "host.docker.internal:${XDEBUG_REMOTE_HOST:-127.0.0.1}"
environment:
PHP_IDE_CONFIG: "serverName=php-cli-74.local"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 ebln
Copyright (c) 2018-2021 ebln

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"require": {
"guzzlehttp/psr7": "~1.6.1",
"php": "^7.2",
"php": "^7.4 || ^8.0",
"webmozart/assert": "^1.6"
},
"archive": {
Expand All @@ -28,10 +28,9 @@
"phpmd/phpmd": "^2.10.1",
"phpstan/phpstan": "^0.12.90",
"phpstan/phpstan-webmozart-assert": "^0.12.12",
"phpunit/phpunit": "^8",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master",
"vimeo/psalm": "^3.18.2",
"symfony/polyfill-mbstring": "v1.20.0"
"vimeo/psalm": "^4.8"
},
"autoload-dev": {
"psr-4": {
Expand All @@ -43,7 +42,7 @@
"phpunit": "phpunit --coverage-html coverage --coverage-text --colors=auto",
"php-cs-fixer": "php-cs-fixer fix -v --config=.php-cs-fixer.dist.php --using-cache=no --dry-run",
"test": [
"psalm --find-unused-psalm-suppress",
"psalm --find-unused-psalm-suppress --no-cache",
"phpstan analyse",
"phpmd src,tests ansi naming #,codesize,design",
"@php-cs-fixer",
Expand Down
Loading

0 comments on commit 73cff70

Please sign in to comment.