Skip to content

Commit

Permalink
upgrade to PHP 8.1 (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimmi20 committed Jun 29, 2022
1 parent d65416b commit 364e776
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
.editorconfig export-ignore text eol=lf
.gitattributes export-ignore text eol=lf
.gitignore export-ignore text eol=lf
.mega-linter.yml export-ignore text eol=lf
.php-cs-fixer.php export-ignore text eol=lf
.phplint.yml export-ignore text eol=lf
codecov.yml export-ignore text eol=lf
infection.json export-ignore text eol=lf
phpcs.xml export-ignore text eol=lf
Expand Down
101 changes: 49 additions & 52 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.1"

steps:
- name: "Checkout"
Expand All @@ -50,14 +50,14 @@ jobs:
- name: "Validate composer.json"
run: "composer validate --strict"

lint:
name: "Linting"
install:
name: "Install dependencies"

needs: "validate"

runs-on: "${{ matrix.operating-system }}"

continue-on-error: false
continue-on-error: ${{ matrix.experimental }}

strategy:
fail-fast: false
Expand All @@ -68,10 +68,32 @@ jobs:
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
- "highest"
- "lowest"

experimental: [false]

include:
- operating-system: "ubuntu-20.04"
php-version: "8.2"
dependencies: "highest"
experimental: true
- operating-system: "ubuntu-20.04"
php-version: "8.2"
dependencies: "lowest"
experimental: true
- operating-system: "ubuntu-22.04"
php-version: "8.2"
dependencies: "highest"
experimental: true
- operating-system: "ubuntu-22.04"
php-version: "8.2"
dependencies: "lowest"
experimental: true

steps:
- name: "Checkout"
uses: "actions/checkout@v3"
Expand All @@ -88,60 +110,37 @@ jobs:
coverage: "none"
tools: "${{ env.TOOLS }}"

- name: "Lint PHP"
if: "${{ matrix.php-version == '7.4' }}"
uses: "overtrue/[email protected]"
- name: "Update dependencies with composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ env.COMPOSER_OPTIONS }}"

- name: "Lint PHP"
if: "${{ matrix.php-version != '7.4' }}"
uses: "overtrue/[email protected]"
- name: "Check dependencies with composer"
run: "composer outdated --direct"

install:
name: "Install dependencies"
lint:
name: "Linting"

needs: "validate"
needs: "install"

runs-on: "${{ matrix.operating-system }}"

continue-on-error: ${{ matrix.experimental }}
continue-on-error: false

strategy:
fail-fast: false

matrix:
operating-system:
- "ubuntu-18.04"
- "ubuntu-20.04"
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
- "highest"
- "lowest"

experimental: [false]

include:
- operating-system: "ubuntu-20.04"
php-version: "8.2"
dependencies: "highest"
experimental: true
- operating-system: "ubuntu-20.04"
php-version: "8.2"
dependencies: "lowest"
experimental: true
- operating-system: "ubuntu-22.04"
php-version: "8.2"
dependencies: "highest"
experimental: true
- operating-system: "ubuntu-22.04"
php-version: "8.2"
dependencies: "lowest"
experimental: true

steps:
- name: "Checkout"
Expand All @@ -165,8 +164,12 @@ jobs:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ env.COMPOSER_OPTIONS }}"

- name: "Check dependencies with composer"
run: "composer outdated --direct"
- name: "Linter"
# You can override Mega-Linter flavor used to have faster performances
# More info at https://nvuillam.github.io/mega-linter/flavors/
uses: "nvuillam/mega-linter/flavors/php@v5"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

php-cs-fixer:
name: "Check Coding Standards with PHP-CS-Fixer"
Expand All @@ -186,7 +189,7 @@ jobs:
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.1"

dependencies:
- "highest"
Expand Down Expand Up @@ -234,7 +237,7 @@ jobs:
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.1"

dependencies:
- "highest"
Expand Down Expand Up @@ -280,7 +283,7 @@ jobs:
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.1"

dependencies:
- "highest"
Expand Down Expand Up @@ -324,13 +327,10 @@ jobs:

matrix:
operating-system:
- "ubuntu-18.04"
- "ubuntu-20.04"
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
Expand Down Expand Up @@ -376,13 +376,10 @@ jobs:

matrix:
operating-system:
- "ubuntu-18.04"
- "ubuntu-20.04"
- "ubuntu-22.04"

php-version:
- "7.4"
- "8.0"
- "8.1"

dependencies:
Expand All @@ -406,7 +403,7 @@ jobs:
extensions: "${{ env.PHP_EXTENSIONS }}"
ini-values: "${{ env.PHP_INI_VALUES }}"
coverage: "${{ matrix.coverage-drivers }}"
tools: "${{ env.TOOLS }}, infection:0.26.6"
tools: "${{ env.TOOLS }}, infection"

- name: "Update dependencies with composer"
uses: "ramsey/composer-install@v1"
Expand Down
29 changes: 29 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
VALIDATE_ALL_CODEBASE: true
LOG_LEVEL: INFO
PRINT_ALPACA: false
SHOW_ELAPSED_TIME: true
FILTER_REGEX_EXCLUDE: (vendor/)
ENABLE:
- EDITORCONFIG
- MARKDOWN
- PHP
- YAML
DISABLE:
- SPELL
#- COPYPASTE
DISABLE_LINTERS:
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
- PHP_PSALM
- PHP_PHPCS
- PHP_PHPSTAN
- YAML_V8R
EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: "(\\.idea|\\.editorconfig|\\.github|\\.phpunit\\.result\\.cache|LICENSE)"
JSON_PRETTIER_FILTER_REGEX_EXCLUDE: "(composer\\.json)"
MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE: "(\\.github)"
MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: "(\\.github)"
PHP_PHPCS_CONFIG_FILE: "phpcs.xml"
PHP_PHPCS_ARGUMENTS: "-n"
PHP_PHPSTAN_CONFIG_FILE: "phpstan.neon"
PHP_PHPSTAN_FILTER_REGEX_INCLUDE: "(src)"
YAML_YAMLLINT_FILTER_REGEX_EXCLUDE: "(\\.github)"
YAML_PRETTIER_FILTER_REGEX_EXCLUDE: "(\\.github)"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ This library requires PHP 7.4+.

Run

```
$ composer require mimmi20/contact
```shell
composer require mimmi20/contact
```

## License
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"source": "https://github.com/mimmi20/contact"
},
"require": {
"php": "^7.4.3 || ^8.0.0"
"php": "^8.1.0"
},
"require-dev": {
"mimmi20/coding-standard": "^2.8.0",
"mimmi20/coding-standard": "^2.9.0",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "^1.6.8",
"phpstan/phpstan": "^1.8.0",
"phpstan/phpstan-deprecation-rules": "^1.0.0",
"phpstan/phpstan-phpunit": "^1.1.1",
"phpunit/phpunit": "^9.5.20"
"phpunit/phpunit": "^9.5.21"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
5 changes: 1 addition & 4 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?xml version="1.0"?>
<ruleset name="contact"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
<ruleset name="contact" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>contact</description>

<arg name="report" value="full"/>
Expand Down

0 comments on commit 364e776

Please sign in to comment.