Skip to content

Commit 44cdcc1

Browse files
authored
Merge pull request #601 from FriendsOfCake/cake-5
Cake 5
2 parents e1980ba + a5e8f99 commit 44cdcc1

28 files changed

+313
-354
lines changed

.editorconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ root = true
66
[*]
77
indent_style = space
88
indent_size = 4
9-
charset = "utf-8"
9+
charset = utf-8
1010
end_of_line = lf
1111
insert_final_newline = true
1212
trim_trailing_whitespace = true
1313

1414
[*.yml]
15-
indent_style = space
1615
indent_size = 2
1716

1817
[*.neon]

.gitattributes

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ CONTRIBUTING.md export-ignore
44
.gitattributes export-ignore
55
.gitignore export-ignore
66
phpunit.xml.dist export-ignore
7-
.scrutinizer.yml export-ignore
8-
.stickler.yml export-ignore
97
tests export-ignore
108
docs export-ignore
119
.github export-ignore
10+
.phive export-ignore
11+
phpcs.xml export-ignore
12+
psalm.xml export-ignore
13+
phpstan.neon export-ignore

.github/workflows/ci.yml

Lines changed: 15 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,22 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- cake-5
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
permissions:
13+
contents: read
414

515
jobs:
616
testsuite:
7-
runs-on: ubuntu-18.04
8-
strategy:
9-
fail-fast: false
10-
matrix:
11-
php-version: ['7.4', '8.0', '8.1']
12-
db-type: [mysql, pgsql]
13-
prefer-lowest: ['']
14-
include:
15-
- php-version: '7.2'
16-
db-type: 'sqlite'
17-
prefer-lowest: 'prefer-lowest'
18-
19-
services:
20-
postgres:
21-
image: postgres
22-
ports:
23-
- 5432:5432
24-
env:
25-
POSTGRES_PASSWORD: postgres
26-
27-
steps:
28-
- uses: actions/checkout@v2
29-
30-
- name: Setup Service
31-
if: matrix.db-type == 'mysql'
32-
run: |
33-
sudo service mysql start
34-
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'
35-
36-
- name: Setup PHP
37-
uses: shivammathur/setup-php@v2
38-
with:
39-
php-version: ${{ matrix.php-version }}
40-
extensions: mbstring, intl, pdo_${{ matrix.db-type }}
41-
coverage: pcov
42-
43-
- name: Composer install
44-
run: |
45-
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
46-
composer update --prefer-lowest --prefer-stable
47-
else
48-
composer install
49-
fi
50-
51-
- name: Run PHPUnit
52-
run: |
53-
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi
54-
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:[email protected]/cakephp'; fi
55-
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:[email protected]/postgres'; fi
56-
57-
if [[ ${{ matrix.php-version }} == '7.4' && ${{ matrix.db-type }} == 'mysql' ]]; then
58-
vendor/bin/phpunit --coverage-clover=coverage.xml
59-
else
60-
vendor/bin/phpunit
61-
fi
62-
63-
- name: Code Coverage Report
64-
if: success() && matrix.php-version == '7.4' && matrix.db-type == 'mysql'
65-
uses: codecov/codecov-action@v2
17+
uses: cakephp/.github/.github/workflows/[email protected]
18+
secrets: inherit
6619

6720
cs-stan:
68-
name: Coding Standard & Static Analysis
69-
runs-on: ubuntu-18.04
70-
71-
steps:
72-
- uses: actions/checkout@v2
73-
74-
- name: Setup PHP
75-
uses: shivammathur/setup-php@v2
76-
with:
77-
php-version: '7.4'
78-
extensions: mbstring, intl
79-
coverage: none
80-
tools: cs2pr, phpstan:1.2
81-
82-
- name: Composer Install
83-
run: composer install
84-
85-
- name: Run phpcs
86-
run: vendor/bin/phpcs --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ | cs2pr
87-
88-
- name: Run phpstan
89-
if: success() || failure()
90-
run: phpstan analyse
21+
uses: cakephp/.github/.github/workflows/[email protected]
22+
secrets: inherit

.phive/phars.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="phpstan" version="1.10.38" installed="1.10.38" location="./tools/phpstan" copy="false"/>
4+
<phar name="psalm" version="5.15.0" installed="5.15.0" location="./tools/psalm" copy="false"/>
5+
</phive>

.scrutinizer.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://img.shields.io/github/workflow/status/FriendsOfCake/cakephp-upload/CI/master?style=flat-square)](https://github.com/FriendsOfCake/cakephp-upload/actions?query=workflow%3ACI+branch%3Amaster)
1+
[![Build Status](https://img.shields.io/github/actions/workflow/status/FriendsOfCake/cakephp-upload/ci.yml?style=flat-square)](https://github.com/FriendsOfCake/cakephp-upload/actions?query=workflow%3ACI+branch%3Amaster)
22
[![Coverage Status](https://img.shields.io/codecov/c/github/FriendsOfCake/cakephp-upload/master?style=flat-square)](https://codecov.io/gh/FriendsOfCake/cakephp-upload)
33
[![Total Downloads](https://img.shields.io/packagist/dt/josegonzalez/cakephp-upload.svg?style=flat-square)](https://packagist.org/packages/josegonzalez/cakephp-upload)
44
[![Latest Stable Version](https://img.shields.io/packagist/v/josegonzalez/cakephp-upload.svg?style=flat-square)](https://packagist.org/packages/josegonzalez/cakephp-upload)
@@ -8,6 +8,8 @@
88

99
The Upload Plugin is an attempt to easily handle file uploads with CakePHP.
1010

11+
See [7.x branch](https://github.com/FriendsOfCake/cakephp-upload/tree/7.x) for CakePHP 4.x documentation.
12+
1113
See [4.x branch](https://github.com/FriendsOfCake/cakephp-upload/tree/4.x) for CakePHP 3.x documentation.
1214

1315
See [2.x branch](https://github.com/FriendsOfCake/cakephp-upload/tree/2.x) for CakePHP 2.x documentation.

composer.json

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,30 @@
1212
}
1313
],
1414
"require": {
15-
"cakephp/orm": "^4.0.2",
16-
"league/flysystem": "^2.2|^3.0"
15+
"cakephp/orm": "^5.0",
16+
"league/flysystem": "^3.15.1.0"
1717
},
1818
"require-dev": {
19-
"cakephp/cakephp": "^4.0.2",
20-
"phpunit/phpunit": "^8.5 || ^9.3",
21-
"cakephp/cakephp-codesniffer": "^4.0",
22-
"league/flysystem-memory": "^2.0|^3.0",
23-
"mikey179/vfsstream": "^1.6.10"
19+
"cakephp/cakephp": "^5.0",
20+
"phpunit/phpunit": "^10.1.0",
21+
"cakephp/cakephp-codesniffer": "^5.0",
22+
"league/flysystem-memory": "^3.15",
23+
"mikey179/vfsstream": "^1.6.10",
24+
"cakephp/migrations": "^4.1"
25+
},
26+
"scripts": {
27+
"cs-check": "phpcs --colors --parallel=16 -p src/ tests/",
28+
"cs-fix": "phpcbf --colors --parallel=16 -p src/ tests/",
29+
"phpstan": "tools/phpstan analyse",
30+
"psalm": "tools/psalm --show-info=false",
31+
"stan": [
32+
"@phpstan",
33+
"@psalm"
34+
],
35+
"stan-baseline": "tools/phpstan --generate-baseline",
36+
"psalm-baseline": "tools/psalm --set-baseline=psalm-baseline.xml",
37+
"stan-setup": "phive install",
38+
"test": "phpunit"
2439
},
2540
"autoload": {
2641
"psr-4": {

phpcs.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="CakePHP Core">
3+
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" />
4+
5+
<rule ref="CakePHP" />
6+
7+
<arg value="s"/>
8+
</ruleset>

phpstan.neon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
level: 7
2+
level: 8
33
checkMissingIterableValueType: false
44
checkGenericClassInNonGenericObjectType: false
55
paths:
@@ -21,11 +21,11 @@ parameters:
2121
path: src/Model/Behavior/UploadBehavior.php
2222

2323
-
24-
message: "#^Cannot use array destructuring on array\\|false\\.$#"
24+
message: "#^Cannot use array destructuring on array\\<int\\|string, int\\|string\\>\\|false\\.$#"
2525
count: 4
2626
path: src/Validation/DefaultValidation.php
2727

2828
-
29-
message: "#^Cannot use array destructuring on array\\|false\\.$#"
29+
message: "#^Cannot use array destructuring on array\\<int\\|string, int\\|string\\>\\|false\\.$#"
3030
count: 4
3131
path: src/Validation/ImageValidation.php

phpunit.xml.dist

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,23 @@
1-
<?xml version="1.0" encoding="UTF-8"?><phpunit
2-
colors="true"
3-
processIsolation="false"
4-
stopOnFailure="false"
5-
bootstrap="./tests/bootstrap.php"
6-
convertDeprecationsToExceptions="true"
7-
>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd">
3+
<coverage/>
84
<php>
95
<ini name="memory_limit" value="-1"/>
10-
<!-- E_ALL & ~E_USER_DEPRECATED (16383)-->
11-
<!-- E_ALL (32767) -->
12-
<ini name="error_reporting" value="32767"/>
136
<ini name="apc.enable_cli" value="1"/>
7+
<env name="FIXTURE_SCHEMA_METADATA" value="./tests/schema.php"/>
148
</php>
15-
169
<!-- Add any additional test suites you want to run here -->
1710
<testsuites>
18-
<testsuite name="Version Test Suite">
19-
<directory>./tests/TestCase</directory>
11+
<testsuite name="cakephp-upload">
12+
<directory>tests/TestCase/</directory>
2013
</testsuite>
2114
</testsuites>
22-
23-
<filter>
24-
<whitelist>
25-
<directory suffix=".php">./src</directory>
26-
</whitelist>
27-
</filter>
28-
29-
<!-- Setup a listener for fixtures -->
30-
<listeners>
31-
<listener
32-
class="\Cake\TestSuite\Fixture\FixtureInjector"
33-
file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
34-
<arguments>
35-
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
36-
</arguments>
37-
</listener>
38-
</listeners>
39-
15+
<extensions>
16+
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
17+
</extensions>
18+
<source>
19+
<include>
20+
<directory suffix=".php">src/</directory>
21+
</include>
22+
</source>
4023
</phpunit>

0 commit comments

Comments
 (0)