Skip to content

Commit

Permalink
Bump to PHP 8.0+
Browse files Browse the repository at this point in the history
PHP 7.4 was end of life November 2022. It's time to bump to PHP 8 standard 馃帀

- updated starting code to PHP 8 standard
- upgraded tooling (code quality, static analysis) to the latest versions
- tested with PHP 8.0, 8.1 and 8.2
   - all tests are passing, except for the skipped test
   - code quality is Ok
   - static analysis is Ok
  • Loading branch information
Pen-y-Fan committed Jan 8, 2023
1 parent fbd767a commit 26425b0
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 6,778 deletions.
7 changes: 5 additions & 2 deletions php/.gitignore
@@ -1,4 +1,7 @@
/.idea
/build
/vendor
/.vscode
/.editorconfig
/.phpunit.result.cache
/.idea
/build
/composer.lock
18 changes: 9 additions & 9 deletions php/README.md
Expand Up @@ -7,7 +7,7 @@ Lift Kata.

The project uses:

- [PHP 7.3 or 7.4 or 8.0+](https://www.php.net/downloads.php)
- [PHP 8.0+](https://www.php.net/downloads.php)
- [Composer](https://getcomposer.org)

Recommended:
Expand Down Expand Up @@ -36,7 +36,7 @@ composer install
Run the tests:

```shell script
composer test
composer tests
```

## Dependencies
Expand Down Expand Up @@ -73,14 +73,14 @@ PHPUnit is configured for testing, a composer script has been provided. To run t
project run:

```shell script
composer test
composer tests
```

On Windows a batch file has been created, like an alias on Linux/Mac (e.g. `alias pu="composer test"`), the same
PHPUnit `composer test` can be run:
On Windows a batch file has been created, like an alias on Linux/Mac (e.g. `alias pu="composer tests"`), the same
PHPUnit `composer tests` can be run:

```shell script
pu
pu.bat
```

### Tests with Coverage Report
Expand Down Expand Up @@ -113,7 +113,7 @@ On Windows a batch file has been created, like an alias on Linux/Mac (e.g. `alia
ECS `composer check-cs` can be run:

```shell script
cc
cc.bat
```

### Fix Code
Expand All @@ -128,7 +128,7 @@ On Windows a batch file has been created, like an alias on Linux/Mac (e.g. `alia
ECS `composer fix-cs` can be run:

```shell script
fc
fc.bat
```

## Static Analysis
Expand All @@ -145,7 +145,7 @@ On Windows a batch file has been created, like an alias on Linux/Mac (e.g. `alia
PHPStan `composer phpstan` can be run:

```shell script
ps
ps.bat
```

## Approval Tests
Expand Down
14 changes: 6 additions & 8 deletions php/composer.json
Expand Up @@ -13,24 +13,22 @@
}
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^8.0",
"myclabs/php-enum": "^1.7",
"php-ds/php-ds": "^1.2"
},
"require-dev": {
"approvals/approval-tests": "dev-Main",
"phpunit/phpunit": "^9.5",
"approvals/approval-tests": "^1.4",
"phpstan/phpstan": "^0.12.85",
"phpstan/phpstan-phpunit": "^0.12.18",
"symplify/easy-coding-standard": "^9.3",
"symplify/phpstan-extensions": "^9.3"
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-phpunit": "^1.3",
"symplify/easy-coding-standard": "^11.1",
"symplify/phpstan-extensions": "^11.1"
},
"suggest": {
"ext-ds": "*"
},
"scripts": {
"checkcode": "phpcs src tests --standard=PSR12",
"fixcode": "phpcbf src tests --standard=PSR12",
"test": "phpunit",
"tests": "phpunit",
"test-coverage": "phpunit --coverage-html build/coverage",
Expand Down

0 comments on commit 26425b0

Please sign in to comment.