Skip to content

Commit cd05c7b

Browse files
committed
Merge branch '4.x' into 4.next
2 parents fb0bc84 + 83a747a commit cd05c7b

26 files changed

+136
-72
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ indent_size = 4
1111
insert_final_newline = true
1212
trim_trailing_whitespace = true
1313

14+
[*.neon]
15+
indent_style = tab
16+
1417
[*.js]
1518
indent_size = 2

.github/dependabot.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ updates:
33
- package-ecosystem: composer
44
directory: "/"
55
schedule:
6-
interval: daily
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: weekly
712
open-pull-requests-limit: 10
8-
ignore:
9-
- dependency-name: phpunit/phpunit
10-
versions:
11-
- "> 6.0"

.github/workflows/ci.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: CI
22

3-
43
on:
54
push:
65
branches:
@@ -9,9 +8,12 @@ on:
98
branches:
109
- '*'
1110

11+
permissions:
12+
contents: read
13+
1214
jobs:
1315
testsuite-linux:
14-
runs-on: ubuntu-18.04
16+
runs-on: ubuntu-20.04
1517
strategy:
1618
fail-fast: false
1719
matrix:
@@ -34,7 +36,7 @@ jobs:
3436
POSTGRES_PASSWORD: postgres
3537

3638
steps:
37-
- uses: actions/checkout@v2
39+
- uses: actions/checkout@v3
3840

3941
- name: Setup Service
4042
if: matrix.db-type == 'mysql'
@@ -58,7 +60,7 @@ jobs:
5860
run: echo "::set-output name=date::$(date +'%Y-%m')"
5961

6062
- name: Cache composer dependencies
61-
uses: actions/cache@v1
63+
uses: actions/cache@v3
6264
with:
6365
path: ${{ steps.composer-cache.outputs.dir }}
6466
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}
@@ -92,28 +94,32 @@ jobs:
9294
9395
- name: Code Coverage Report
9496
if: success() && matrix.php-version == '7.4' && matrix.db-type == 'mysql'
95-
uses: codecov/codecov-action@v1
97+
uses: codecov/codecov-action@v3
9698

9799
cs-stan:
98100
name: Coding Standard & Static Analysis
99-
runs-on: ubuntu-18.04
101+
runs-on: ubuntu-20.04
100102

101103
steps:
102-
- uses: actions/checkout@v2
104+
- uses: actions/checkout@v3
103105

104106
- name: Setup PHP
105107
uses: shivammathur/setup-php@v2
106108
with:
107109
php-version: '7.4'
108110
extensions: mbstring, intl
109111
coverage: none
110-
tools: psalm:~4.10.0, cs2pr
112+
tools: cs2pr
111113

112114
- name: Composer Install
113-
run: composer install
115+
run: composer stan-setup
114116

115117
- name: Run phpcs
116118
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr
117119

118120
- name: Run psalm
119-
run: psalm --output-format=github
121+
run: vendor/bin/psalm.phar --output-format=github
122+
123+
- name: Run phpstan
124+
if: always()
125+
run: vendor/bin/phpstan.phar analyse --error-format=github

.github/workflows/deploy_docs_4x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Cloning repo
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515
with:
1616
fetch-depth: 0
1717

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"source": "https://github.com/cakephp/debug_kit"
2424
},
2525
"require": {
26-
"php": ">=7.2",
26+
"php": ">=7.4",
2727
"cakephp/cakephp": "^4.4.0",
2828
"cakephp/chronos": "^2.0",
2929
"composer/composer": "^1.3 | ^2.0",
@@ -54,9 +54,16 @@
5454
"scripts": {
5555
"cs-check": "phpcs --colors --parallel=16 -p src/ tests/",
5656
"cs-fix": "phpcbf --colors --parallel=16 -p src/ tests/",
57-
"test": "phpunit",
57+
"phpstan": "phpstan.phar analyse",
5858
"psalm": "psalm.phar --show-info=false",
59-
"psalm-setup": "cp composer.json composer.backup && composer require --dev psalm/phar:^4.10 && mv composer.backup composer.json"
59+
"stan": [
60+
"@phpstan",
61+
"@psalm"
62+
],
63+
"stan-baseline": "phpstan.phar --generate-baseline",
64+
"psalm-baseline": "psalm.phar --set-baseline=psalm-baseline.xml",
65+
"stan-setup": "cp composer.json composer.backup && composer require --dev symfony/polyfill-php81 phpstan/phpstan:~1.7.0 psalm/phar:~4.23.0 && mv composer.backup composer.json",
66+
"test": "phpunit"
6067
},
6168
"prefer-stable": true,
6269
"config": {

docs.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ FROM markstory/cakephp-docs-builder:runtime as runtime
1919

2020
# Configure search index script
2121
ENV LANGS="en fr ja pt"
22-
ENV SEARCH_SOURCE="/data/docs"
22+
ENV SEARCH_SOURCE="/usr/share/nginx/html"
2323
ENV SEARCH_URL_PREFIX="/debugkit/4"
2424

2525
COPY --from=builder /data/docs /data/docs

phpstan-baseline.neon

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^PHPDoc type array\\<string, mixed\\>\\|Cake\\\\Cache\\\\CacheEngine of property DebugKit\\\\Cache\\\\Engine\\\\DebugEngine\\:\\:\\$_config is not covariant with PHPDoc type array\\<string, mixed\\> of overridden property Cake\\\\Cache\\\\CacheEngine\\:\\:\\$_config\\.$#"
5+
count: 1
6+
path: src/Cache/Engine/DebugEngine.php
7+
8+
-
9+
message: "#^Property DebugKit\\\\Cache\\\\Engine\\\\DebugEngine\\:\\:\\$_engine \\(Cake\\\\Cache\\\\CacheEngine\\) in isset\\(\\) is not nullable\\.$#"
10+
count: 1
11+
path: src/Cache/Engine/DebugEngine.php
12+
13+
-
14+
message: "#^Unreachable statement \\- code above always terminates\\.$#"
15+
count: 1
16+
path: src/Cache/Engine/DebugEngine.php
17+
18+
-
19+
message: "#^Call to function file_get_contents\\(\\) on a separate line has no effect\\.$#"
20+
count: 1
21+
path: src/Command/BenchmarkCommand.php
22+
23+
-
24+
message: "#^Method DebugKit\\\\Mailer\\\\Transport\\\\DebugKitTransport\\:\\:send\\(\\) should return array\\{headers\\: string, message\\: string\\} but returns array\\{headers\\: non\\-empty\\-array\\<string\\>, message\\: array\\{text\\: string, html\\: string\\}\\}\\.$#"
25+
count: 1
26+
path: src/Mailer/Transport/DebugKitTransport.php
27+
28+
-
29+
message: "#^Parameter \\#1 \\$request of method DebugKit\\\\ToolbarService\\:\\:saveData\\(\\) expects Cake\\\\Http\\\\ServerRequest, Psr\\\\Http\\\\Message\\\\ServerRequestInterface given\\.$#"
30+
count: 1
31+
path: src/Middleware/DebugKitMiddleware.php
32+
33+
-
34+
message: "#^Call to an undefined method Cake\\\\ORM\\\\Locator\\\\LocatorInterface\\:\\:genericInstances\\(\\)\\.$#"
35+
count: 1
36+
path: src/Panel/SqlLogPanel.php

phpstan.neon

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: 6
6+
checkMissingIterableValueType: false
7+
checkGenericClassInNonGenericObjectType: false
8+
treatPhpDocTypesAsCertain: false
9+
bootstrapFiles:
10+
- tests/bootstrap.php
11+
- vendor/cakephp/cakephp/src/Core/Exception/CakeException.php
12+
paths:
13+
- src/

psalm-baseline.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545
<code>new $className($config)</code>
4646
</PropertyTypeCoercion>
4747
</file>
48-
<file src="src/Middleware/DebugKitMiddleware.php">
49-
<ArgumentTypeCoercion occurrences="1">
50-
<code>$request</code>
51-
</ArgumentTypeCoercion>
52-
</file>
5348
<file src="src/Panel/DeprecationsPanel.php">
5449
<InvalidScalarArgument occurrences="4">
5550
<code>$pluginName</code>
@@ -66,11 +61,6 @@
6661
<code>$vendorName</code>
6762
</InvalidScalarArgument>
6863
</file>
69-
<file src="src/Panel/LogPanel.php">
70-
<UndefinedInterfaceMethod occurrences="1">
71-
<code>count</code>
72-
</UndefinedInterfaceMethod>
73-
</file>
7464
<file src="src/Panel/PanelRegistry.php">
7565
<LessSpecificImplementedReturnType occurrences="1">
7666
<code>string|null</code>
@@ -83,16 +73,10 @@
8373
</UnsafeInstantiation>
8474
</file>
8575
<file src="src/Panel/SqlLogPanel.php">
86-
<TypeDoesNotContainType occurrences="1">
87-
<code>!$connection instanceof ConnectionInterface</code>
88-
</TypeDoesNotContainType>
8976
<UndefinedInterfaceMethod occurrences="1">
9077
<code>genericInstances</code>
9178
</UndefinedInterfaceMethod>
9279
</file>
93-
<file src="src/Plugin.php">
94-
<InvalidArgument occurrences="1"/>
95-
</file>
9680
<file src="src/View/Helper/ToolbarHelper.php">
9781
<DeprecatedMethod occurrences="1">
9882
<code>makeNeatArray</code>

psalm.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0"?>
22
<psalm
3-
totallyTyped="false"
4-
resolveFromConfigFile="true"
3+
reportMixedIssues="false"
54
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
65
xmlns="https://getpsalm.org/schema/config"
76
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

0 commit comments

Comments
 (0)