Skip to content

Commit

Permalink
Merge pull request #961 from cakephp/5.x-merge
Browse files Browse the repository at this point in the history
merge 4.x => 5.x
  • Loading branch information
LordSimal committed Jul 31, 2023
2 parents e4f5b56 + 69e7b41 commit 58d572e
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*.phar binary
*.woff binary
*.woff2 binary
*.ttc binary
*.ttf binary
*.otf binary
*.eot binary
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
uses: ramsey/composer-install@v2

- name: Run PHP CodeSniffer
run: vendor/bin/phpcs --report=checkstyle src/ tests/ | cs2pr
run: vendor/bin/phpcs --report=checkstyle | cs2pr

- name: Run phpstan
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v7
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
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'
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@test",
"@cs-check"
],
"cs-check": "phpcs --colors -p src/ tests/",
"cs-fix": "phpcbf --colors -p src/ tests/",
"cs-check": "phpcs --colors -p",
"cs-fix": "phpcbf --colors -p",
"stan": "phpstan analyse",
"test": "phpunit --colors=always"
},
Expand Down
11 changes: 8 additions & 3 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
use Cake\Routing\Route\DashedRoute;
use Cake\Routing\RouteBuilder;

return static function (RouteBuilder $routes) {
/*
* This file is loaded in the context of the `Application` class.
* So you can use `$this` to reference the application class instance
* if required.
*/
return function (RouteBuilder $routes): void {
/*
* The default class to use for all routes
*
Expand All @@ -44,7 +49,7 @@
*/
$routes->setRouteClass(DashedRoute::class);

$routes->scope('/', function (RouteBuilder $builder) {
$routes->scope('/', function (RouteBuilder $builder): void {
/*
* Here, we are connecting '/' (base path) to a controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
Expand Down Expand Up @@ -78,7 +83,7 @@
* open new scope and define routes there.
*
* ```
* $routes->scope('/api', function (RouteBuilder $builder) {
* $routes->scope('/api', function (RouteBuilder $builder): void {
* // No $builder->applyMiddleware() here.
*
* // Parse specified extensions from URLs
Expand Down
3 changes: 3 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
<exclude-pattern>*/src/Controller/*</exclude-pattern>
</rule>

<file>src/</file>
<file>tests/</file>
</ruleset>
9 changes: 5 additions & 4 deletions templates/Error/error400.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
</p>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?= $this->element('auto_table_warning') ?>

<?php
echo $this->element('auto_table_warning');

$this->end();
$this->end();
endif;
?>
<h2><?= h($message) ?></h2>
Expand Down
4 changes: 3 additions & 1 deletion templates/Error/error500.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?php if ($error instanceof Error) : ?>
<?php $file = $error->getFile() ?>
<?php $line = $error->getLine() ?>
<strong>Error in: </strong>
<?= sprintf('%s, line %s', str_replace(ROOT, 'ROOT', $error->getFile()), $error->getLine()) ?>
<?= $this->Html->link(sprintf('%s, line %s', Debugger::trimPath($file), $line), Debugger::editorUrl($file, $line)); ?>
<?php endif; ?>
<?php
echo $this->element('auto_table_warning');
Expand Down

0 comments on commit 58d572e

Please sign in to comment.