Skip to content

Commit 73e78dd

Browse files
committed
Merge branch '4.x' into 4.next
2 parents 118bad5 + 6e5a382 commit 73e78dd

14 files changed

Lines changed: 80 additions & 36 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- '4.x'
77
- '4.next'
8+
- '5.x'
89
pull_request:
910
branches:
1011
- '*'
@@ -79,7 +80,7 @@ jobs:
7980
coverage: none
8081

8182
- name: Composer install
82-
run: composer require --dev phpstan/phpstan:^0.12
83+
run: composer require --dev phpstan/phpstan:^1.0.0
8384

8485
- name: Run phpstan
85-
run: vendor/bin/phpstan.phar analyse
86+
run: vendor/bin/phpstan

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
._*
1414
.Spotlight-V100
1515
.Trashes
16-
Icon?
16+
# Icon must end with two \r
17+
Icon
1718
ehthumbs.db
1819
Thumbs.db
1920
.directory
@@ -22,6 +23,7 @@ Thumbs.db
2223
#######################
2324
# PHPUnit
2425
.phpunit.result.cache
26+
tests.sqlite
2527
# vim
2628
*~
2729
*.swp
@@ -39,5 +41,12 @@ Thumbs.db
3941
nbproject/*
4042
# Visual Studio Code
4143
.vscode
44+
# nova
45+
.nova
4246
# Sass preprocessor
4347
.sass-cache/
48+
# node
49+
/node_modules/*
50+
# yarn
51+
yarn-debug.log
52+
yarn-error.log

composer.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
"license": "MIT",
77
"require": {
88
"php": ">=7.2",
9-
"cakephp/cakephp": "dev-4.next as 4.3.0",
10-
"cakephp/migrations": "dev-3.next as 3.2.0",
9+
"cakephp/cakephp": "^4.3",
10+
"cakephp/migrations": "^3.2",
1111
"cakephp/plugin-installer": "^1.3",
1212
"mobiledetect/mobiledetectlib": "^2.8"
1313
},
1414
"require-dev": {
15-
"cakephp/bake": "^2.3",
16-
"cakephp/repl": "^0.1",
15+
"cakephp/bake": "^2.6",
1716
"cakephp/cakephp-codesniffer": "^4.5",
18-
"cakephp/debug_kit": "dev-4.next as 4.5.0",
17+
"cakephp/debug_kit": "^4.5",
1918
"josegonzalez/dotenv": "^3.2",
2019
"phpunit/phpunit": "~8.5.0 || ^9.3"
2120
},
2221
"suggest": {
2322
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
2423
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility.",
25-
"phpstan/phpstan": "PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code."
24+
"phpstan/phpstan": "PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.",
25+
"cakephp/repl": "Console tools for a REPL interface for CakePHP applications."
2626
},
2727
"autoload": {
2828
"psr-4": {
@@ -49,6 +49,10 @@
4949
},
5050
"prefer-stable": true,
5151
"config": {
52-
"sort-packages": true
52+
"sort-packages": true,
53+
"allow-plugins": {
54+
"cakephp/plugin-installer": true,
55+
"dealerdirect/phpcodesniffer-composer-installer": true
56+
}
5357
}
5458
}

config/.env.example

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export SECURITY_SALT="__SALT__"
2222

2323
# Uncomment these to define cache configuration via environment variables.
2424
#export CACHE_DURATION="+2 minutes"
25-
#export CACHE_DEFAULT_URL="file://tmp/cache/?prefix=${APP_NAME}_default&duration=${CACHE_DURATION}"
26-
#export CACHE_CAKECORE_URL="file://tmp/cache/persistent?prefix=${APP_NAME}_cake_core&serialize=true&duration=${CACHE_DURATION}"
27-
#export CACHE_CAKEMODEL_URL="file://tmp/cache/models?prefix=${APP_NAME}_cake_model&serialize=true&duration=${CACHE_DURATION}"
25+
#export CACHE_DEFAULT_URL="file:///path/to/tmp/cache/?prefix=${APP_NAME}_default_&duration=${CACHE_DURATION}"
26+
#export CACHE_CAKECORE_URL="file:///path/to/tmp/cache/persistent?prefix=${APP_NAME}_cake_core_&serialize=true&duration=${CACHE_DURATION}"
27+
#export CACHE_CAKEMODEL_URL="file:///path/to/tmp/cache/models?prefix=${APP_NAME}_cake_model_&serialize=true&duration=${CACHE_DURATION}"
2828

2929
# Uncomment these to define email transport configuration via environment variables.
3030
#export EMAIL_TRANSPORT_DEFAULT_URL=""
@@ -34,5 +34,5 @@ export SECURITY_SALT="__SALT__"
3434
#export DATABASE_TEST_URL="mysql://my_app:secret@localhost/test_${APP_NAME}?encoding=utf8&timezone=UTC&cacheMetadata=true&quoteIdentifiers=false&persistent=false"
3535

3636
# Uncomment these to define logging configuration via environment variables.
37-
#export LOG_DEBUG_URL="file://logs/?levels[]=notice&levels[]=info&levels[]=debug&file=debug"
38-
#export LOG_ERROR_URL="file://logs/?levels[]=warning&levels[]=error&levels[]=critical&levels[]=alert&levels[]=emergency&file=error"
37+
#export LOG_DEBUG_URL="file:///path/to/logs/?levels[]=notice&levels[]=info&levels[]=debug&file=debug"
38+
#export LOG_ERROR_URL="file:///path/to/logs/?levels[]=warning&levels[]=error&levels[]=critical&levels[]=alert&levels[]=emergency&file=error"

config/routes.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
* `Route` (`Cake\Routing\Route\Route`)
4040
*
4141
* Note that `Route` does not do any inflections on URLs which will result in
42-
* inconsistently cased URLs when used with `:plugin`, `:controller` and
43-
* `:action` markers.
42+
* inconsistently cased URLs when used with `{plugin}`, `{controller}` and
43+
* `{action}` markers.
4444
*/
4545
$routes->setRouteClass(DashedRoute::class);
4646

@@ -63,8 +63,8 @@
6363
* The `fallbacks` method is a shortcut for
6464
*
6565
* ```
66-
* $builder->connect('/:controller', ['action' => 'index']);
67-
* $builder->connect('/:controller/:action/*', []);
66+
* $builder->connect('/{controller}', ['action' => 'index']);
67+
* $builder->connect('/{controller}/{action}/*', []);
6868
* ```
6969
*
7070
* You can remove these routes once you've connected the

phpstan.neon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
parameters:
2-
level: 7
2+
level: 8
33
checkMissingIterableValueType: false
44
treatPhpDocTypesAsCertain: false
55
paths:
6-
- src
7-
excludes_analyse:
6+
- src/
7+
excludePaths:
88
- src/Console/Installer.php

src/Console/Installer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
define('STDIN', fopen('php://stdin', 'r'));
2121
}
2222

23+
use Cake\Codeception\Console\Installer as CodeceptionInstaller;
2324
use Cake\Utility\Security;
2425
use Composer\Script\Event;
2526
use Exception;
@@ -63,9 +64,8 @@ public static function postInstall(Event $event)
6364
static::setFolderPermissions($rootDir, $io);
6465
static::setSecuritySalt($rootDir, $io);
6566

66-
$class = 'Cake\Codeception\Console\Installer';
67-
if (class_exists($class)) {
68-
$class::customizeCodeceptionBinary($event);
67+
if (class_exists(CodeceptionInstaller::class)) {
68+
CodeceptionInstaller::customizeCodeceptionBinary($event);
6969
}
7070
}
7171

templates/element/flash/info.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
/**
3+
* @var \App\View\AppView $this
4+
* @var array $params
5+
* @var string $message
6+
*/
7+
if (!isset($params['escape']) || $params['escape'] !== false) {
8+
$message = h($message);
9+
}
10+
?>
11+
<div class="message" onclick="this.classList.add('hidden');"><?= $message ?></div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
/**
3+
* @var \App\View\AppView $this
4+
* @var array $params
5+
* @var string $message
6+
*/
7+
if (!isset($params['escape']) || $params['escape'] !== false) {
8+
$message = h($message);
9+
}
10+
?>
11+
<div class="message warning" onclick="this.classList.add('hidden');"><?= $message ?></div>

templates/email/html/default.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
* @since 0.10.0
1313
* @license https://opensource.org/licenses/mit-license.php MIT License
1414
* @var \App\View\AppView $this
15+
* @var string $content
1516
*/
1617

17-
$content = explode("\n", $content);
18+
$lines = explode("\n", $content);
1819

19-
foreach ($content as $line) :
20+
foreach ($lines as $line) :
2021
echo '<p> ' . $line . "</p>\n";
2122
endforeach;

0 commit comments

Comments
 (0)