Skip to content

Commit

Permalink
Add support for CakePHP 5 (#5)
Browse files Browse the repository at this point in the history
* Migrate phpunit configuration

* Change CI version

* Update phpstan

* Use new fixture system

* Change plugin class name in line with CakePHP 4.4 migration

* Update PHP/CakePHP version map

* Update test configuration

* Update dependencies

* Upgrades for CakePHP 5 and PHP 8.1

* Codesniff

* Use actual collection class instead of function to prevent need of global functions

* Various minor adjustments

* Fix missing quote

* Update phpstan job
  • Loading branch information
mentisy committed Oct 15, 2023
1 parent 99ca30e commit 91d0365
Show file tree
Hide file tree
Showing 27 changed files with 1,043 additions and 1,243 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:

jobs:
testsuite:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['7.4', '8.0']
php-version: ['8.1']
name: PHP ${{ matrix.php-version }}

steps:
Expand All @@ -29,27 +29,23 @@ jobs:

- name: Composer install
run: |
if [[ ${{ matrix.php-version }} == '8.0' ]]; then
composer install --ignore-platform-reqs
else
composer install
fi
- name: Run PHPUnit
run: |
vendor/bin/phpunit
coding-standard:
name: Coding Standard
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: mbstring
coverage: none

Expand All @@ -61,20 +57,20 @@ jobs:

static-analysis:
name: Static Analysis
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: mbstring
coverage: none

- name: Composer install
run: composer require --dev phpstan/phpstan:^0.12
run: composer require --dev phpstan/phpstan:^1.9

- name: Run phpstan
run: vendor/bin/phpstan.phar analyse
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/composer.phar
/phpunit.xml
/.phpunit.result.cache
/.phpunit.cache
/phpunit.phar
/config/Migrations/schema-dump-default.lock
/vendor/
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Output methods:
* Log file
* Mail

Works with:
Type | Version
---- | ----
CakePHP | 4.2
PHP | 7.4
## Version map:
| Plugin | Branch | Cake | PHP |
|--------|--------|------|--------------|
| 2.x | main | 5.x | ^8.1 |
| 1.x | 1.x | 4.x | ^7.4 \| ^8.0 |

## Installation
`composer require avolle/cakephp-deadlinks`
Expand Down
17 changes: 12 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
}
],
"require": {
"php": ">=7.4",
"cakephp/cakephp": "^4.0",
"php": "^8.1",
"cakephp/cakephp": "^5.0.0",
"ext-curl": "*"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"cakephp/cakephp-codesniffer": "~4.1.0",
"phpstan/phpstan": "^0.12"
"phpunit/phpunit": "^10.0.0",
"cakephp/cakephp-codesniffer": "^5.0",
"phpstan/phpstan": "^1.9"
},
"autoload": {
"psr-4": {
Expand All @@ -40,5 +40,12 @@
"cs-fix": "phpcbf ./src ./tests",
"stan": "phpstan analyze",
"test": "phpunit --colors=always"
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit 91d0365

Please sign in to comment.