Skip to content

Commit d33aed2

Browse files
authored
Merge pull request #986 from cakephp/4.x
merge 4.x -> 4.next
2 parents ae21186 + ab8dc92 commit d33aed2

8 files changed

Lines changed: 29 additions & 17 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*.phar binary
2424
*.woff binary
2525
*.woff2 binary
26+
*.ttc binary
2627
*.ttf binary
2728
*.otf binary
2829
*.eot binary

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
pull_request:
1010
branches:
1111
- '*'
12+
workflow_dispatch:
1213

1314
permissions:
1415
contents: read
@@ -23,7 +24,7 @@ jobs:
2324
name: PHP ${{ matrix.php-version }}
2425

2526
steps:
26-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2728

2829
- name: Setup PHP
2930
uses: shivammathur/setup-php@v2
@@ -49,7 +50,7 @@ jobs:
4950
runs-on: ubuntu-22.04
5051

5152
steps:
52-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
5354

5455
- name: Setup PHP
5556
uses: shivammathur/setup-php@v2
@@ -63,7 +64,7 @@ jobs:
6364
run: composer install
6465

6566
- name: Run PHP CodeSniffer
66-
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr
67+
run: vendor/bin/phpcs --report=checkstyle | cs2pr
6768

6869
- name: Run phpstan
6970
if: always()

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/stale@v7
19+
- uses: actions/stale@v8
2020
with:
2121
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222
stale-issue-message: 'This issue is stale because it has been open for 120 days with no activity. Remove the `stale` label or comment or this will be closed in 15 days'

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"require": {
88
"php": ">=7.4",
9-
"cakephp/cakephp": "^4.5.0-RC1",
9+
"cakephp/cakephp": "^4.5.0",
1010
"cakephp/migrations": "^3.7",
1111
"cakephp/plugin-installer": "^1.3",
1212
"mobiledetect/mobiledetectlib": "^3.74"
@@ -15,7 +15,7 @@
1515
"cakephp/bake": "^2.8",
1616
"cakephp/cakephp-codesniffer": "^4.5",
1717
"cakephp/debug_kit": "^4.9",
18-
"josegonzalez/dotenv": "^3.2",
18+
"josegonzalez/dotenv": "^4.0",
1919
"phpunit/phpunit": "^9.6"
2020
},
2121
"suggest": {
@@ -42,9 +42,8 @@
4242
"@test",
4343
"@cs-check"
4444
],
45-
"cs-check": "phpcs --colors -p src/ tests/",
46-
"cs-fix": "phpcbf --colors -p src/ tests/",
47-
"stan": "phpstan analyse",
45+
"cs-check": "phpcs --colors -p",
46+
"cs-fix": "phpcbf --colors -p",
4847
"test": "phpunit --colors=always"
4948
},
5049
"minimum-stability": "dev",

config/routes.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
use Cake\Routing\Route\DashedRoute;
2525
use Cake\Routing\RouteBuilder;
2626

27-
return static function (RouteBuilder $routes) {
27+
/*
28+
* This file is loaded in the context of the `Application` class.
29+
* So you can use `$this` to reference the application class instance
30+
* if required.
31+
*/
32+
return function (RouteBuilder $routes): void {
2833
/*
2934
* The default class to use for all routes
3035
*
@@ -44,7 +49,7 @@
4449
*/
4550
$routes->setRouteClass(DashedRoute::class);
4651

47-
$routes->scope('/', function (RouteBuilder $builder) {
52+
$routes->scope('/', function (RouteBuilder $builder): void {
4853
/*
4954
* Here, we are connecting '/' (base path) to a controller called 'Pages',
5055
* its action called 'display', and we pass a param to select the view file
@@ -78,7 +83,7 @@
7883
* open new scope and define routes there.
7984
*
8085
* ```
81-
* $routes->scope('/api', function (RouteBuilder $builder) {
86+
* $routes->scope('/api', function (RouteBuilder $builder): void {
8287
* // No $builder->applyMiddleware() here.
8388
*
8489
* // Parse specified extensions from URLs

phpcs.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer"/>
44

55
<rule ref="CakePHP"/>
6+
7+
<file>src/</file>
8+
<file>tests/</file>
69
</ruleset>

templates/Error/error400.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@
2525
</p>
2626
<?php endif; ?>
2727
<?php if (!empty($error->params)) : ?>
28-
<strong>SQL Query Params: </strong>
29-
<?php Debugger::dump($error->params) ?>
28+
<strong>SQL Query Params: </strong>
29+
<?php Debugger::dump($error->params) ?>
3030
<?php endif; ?>
31-
<?= $this->element('auto_table_warning') ?>
31+
3232
<?php
33+
echo $this->element('auto_table_warning');
3334

34-
$this->end();
35+
$this->end();
3536
endif;
3637
?>
3738
<h2><?= h($message) ?></h2>

templates/Error/error500.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
<?php Debugger::dump($error->params) ?>
3030
<?php endif; ?>
3131
<?php if ($error instanceof Error) : ?>
32+
<?php $file = $error->getFile() ?>
33+
<?php $line = $error->getLine() ?>
3234
<strong>Error in: </strong>
33-
<?= sprintf('%s, line %s', str_replace(ROOT, 'ROOT', $error->getFile()), $error->getLine()) ?>
35+
<?= $this->Html->link(sprintf('%s, line %s', Debugger::trimPath($file), $line), Debugger::editorUrl($file, $line)); ?>
3436
<?php endif; ?>
3537
<?php
3638
echo $this->element('auto_table_warning');

0 commit comments

Comments
 (0)