Skip to content

Commit 2dccf8f

Browse files
committed
Merge branch '5.x' into 5.next
2 parents b8cd2ae + d3d710e commit 2dccf8f

File tree

143 files changed

+627
-389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+627
-389
lines changed

config/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
epub_tocdepth = 2
113113

114114
rst_epilog = """
115-
.. |phpversion| replace:: **8.2**
115+
.. |phpversion| replace:: **8.3**
116116
.. |minphpversion| replace:: 8.1
117117
"""
118118

en/console-commands/commands.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ command line::
6262
$parser->addArgument('name', [
6363
'help' => 'What is your name',
6464
]);
65+
6566
return $parser;
6667
}
6768

en/contributing/cakephp-coding-conventions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ Try to avoid unnecessary nesting by bailing early::
265265
{
266266
...
267267
if (!$success) {
268-
throw new RuntimeException(...);
268+
throw new RuntimeException(/* ... */);
269269
}
270270

271271
...

en/controllers.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ You can redirect using :term:`routing array` values::
417417
Or using a relative or absolute URL::
418418

419419
return $this->redirect('/orders/confirm');
420+
420421
return $this->redirect('http://www.example.com');
421422

422423
Or to the referer page::

en/controllers/components.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ in your controller, you could access it like so::
136136
{
137137
if ($this->Post->delete($this->request->getData('Post.id')) {
138138
$this->Flash->success('Post deleted.');
139+
139140
return $this->redirect(['action' => 'index']);
140141
}
141142
}
@@ -317,6 +318,7 @@ To redirect from within a component callback method you can use the following::
317318
public function beforeFilter(EventInterface $event)
318319
{
319320
$event->stopPropagation();
321+
320322
return $this->getController()->redirect('/');
321323
}
322324

en/core-libraries/events.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ has been created. To keep your Orders model clean you could use events::
6565
'order' => $order
6666
]);
6767
$this->getEventManager()->dispatch($event);
68+
6869
return true;
6970
}
71+
7072
return false;
7173
}
7274
}
@@ -456,6 +458,7 @@ directly or returning the value in the callback itself::
456458
{
457459
// ...
458460
$alteredData = $event->getData('order') + $moreData;
461+
459462
return $alteredData;
460463
}
461464

en/core-libraries/httpclient.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ Doing POST and PUT requests is equally simple::
4545
]);
4646

4747
// Other methods as well.
48-
$http->delete(...);
49-
$http->head(...);
50-
$http->patch(...);
48+
$http->delete(/* ... */);
49+
$http->head(/* ... */);
50+
$http->patch(/* ... */);
5151

5252
If you have created a PSR-7 request object you can send it using
5353
``sendRequest()``::
@@ -570,11 +570,11 @@ is making::
570570

571571
There are methods to mock the most commonly used HTTP methods::
572572

573-
$this->mockClientGet(...);
574-
$this->mockClientPatch(...);
575-
$this->mockClientPost(...);
576-
$this->mockClientPut(...);
577-
$this->mockClientDelete(...);
573+
$this->mockClientGet(/* ... */);
574+
$this->mockClientPatch(/* ... */);
575+
$this->mockClientPost(/* ... */);
576+
$this->mockClientPut(/* ... */);
577+
$this->mockClientDelete(/* ... */);
578578

579579
.. php:method:: newClientResponse(int $code = 200, array $headers = [], string $body = '')
580580

en/core-libraries/logging.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ After installing Monolog using composer, configure the logger using the
514514
Log::setConfig('default', function () {
515515
$log = new Logger('app');
516516
$log->pushHandler(new StreamHandler('path/to/your/combined.log'));
517+
517518
return $log;
518519
});
519520

@@ -531,6 +532,7 @@ Use similar methods if you want to configure a different logger for your console
531532
Log::setConfig('default', function () {
532533
$log = new Logger('cli');
533534
$log->pushHandler(new StreamHandler('path/to/your/combined-cli.log'));
535+
534536
return $log;
535537
});
536538

en/core-libraries/validation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ conditions only::
289289
if (isset($context['data']['action'])) {
290290
return $context['data']['action'] === 'subscribe';
291291
}
292+
292293
return false;
293294
});
294295
$validator->requirePresence('email');

en/development/application.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ global event listeners::
6363
// Call the parent to `require_once` config/bootstrap.php
6464
parent::bootstrap();
6565

66+
// CakePHP has the ability to fallback to using the `Cake\ORM\Table`
67+
// class to represent your database tables when a related class is
68+
// not created for that table. But using this "auto-tables" feature
69+
// can make debugging more difficult in some scenarios. So we disable
70+
// this feature except for the CLI environment (since the classes
71+
// would not be present when using the `bake` code generation tool).
72+
if (PHP_SAPI !== 'cli') {
73+
FactoryLocator::add(
74+
'Table',
75+
(new TableLocator())->allowFallbackClass(false)
76+
);
77+
}
78+
6679
// Load MyPlugin
6780
$this->addPlugin('MyPlugin');
6881
}
@@ -74,4 +87,4 @@ each test method.
7487

7588
.. meta::
7689
:title lang=en: CakePHP Application
77-
:keywords lang=en: http, middleware, psr-7, events, plugins, application, baseapplication
90+
:keywords lang=en: http, middleware, psr-7, events, plugins, application, baseapplication,auto tables,auto-tables,generic table,class

0 commit comments

Comments
 (0)