From fb23c8da39e996a171591664b0e60b5120031477 Mon Sep 17 00:00:00 2001 From: mscherer Date: Fri, 30 Jan 2026 10:42:32 +0100 Subject: [PATCH] Fix grammar, trailing whitespace, and add commas after 'By default'. Add missing comma after introductory 'By default' phrase across 60 instances in 35 files. Fix miscellaneous grammar issues and trailing whitespace in several docs files. --- docs/en/appendices/5-0-migration-guide.md | 6 ++--- docs/en/console-commands.md | 2 +- docs/en/console-commands/commands.md | 2 +- docs/en/console-commands/input-output.md | 2 +- docs/en/controllers.md | 4 ++-- .../controllers/components/form-protection.md | 2 +- docs/en/controllers/pagination.md | 6 ++--- docs/en/controllers/request-response.md | 6 ++--- docs/en/core-libraries/email.md | 4 ++-- .../global-constants-and-functions.md | 2 +- docs/en/core-libraries/httpclient.md | 6 ++--- .../internationalization-and-localization.md | 2 +- docs/en/core-libraries/logging.md | 2 +- docs/en/core-libraries/validation.md | 2 +- docs/en/core-libraries/xml.md | 4 ++-- docs/en/development/application.md | 6 ++--- docs/en/development/configuration.md | 4 ++-- docs/en/development/debugging.md | 2 +- docs/en/development/dependency-injection.md | 4 ++-- docs/en/development/errors.md | 6 ++--- docs/en/development/rest.md | 2 +- docs/en/development/routing.md | 8 +++---- docs/en/development/sessions.md | 2 +- docs/en/development/testing.md | 8 +++---- docs/en/orm/associations.md | 16 +++++++------- docs/en/orm/behaviors/counter-cache.md | 2 +- docs/en/orm/behaviors/translate.md | 4 ++-- docs/en/orm/database-basics.md | 4 ++-- docs/en/orm/deleting-data.md | 4 ++-- docs/en/orm/entities.md | 2 +- docs/en/orm/query-builder.md | 2 +- docs/en/orm/retrieving-data-and-resultsets.md | 8 +++---- docs/en/orm/saving-data.md | 22 +++++++++---------- docs/en/orm/table-objects.md | 4 ++-- docs/en/orm/validation.md | 4 ++-- docs/en/plugins.md | 2 +- docs/en/security/content-security-policy.md | 2 +- docs/en/tutorials-and-examples.md | 2 +- .../cms/authentication.md | 2 +- docs/en/views.md | 2 +- docs/en/views/helpers.md | 2 +- docs/en/views/helpers/form.md | 12 +++++----- docs/en/views/helpers/html.md | 4 ++-- docs/en/views/helpers/paginator.md | 6 ++--- docs/en/views/json-and-xml-views.md | 4 ++-- 45 files changed, 102 insertions(+), 102 deletions(-) diff --git a/docs/en/appendices/5-0-migration-guide.md b/docs/en/appendices/5-0-migration-guide.md index 4b72df01ba..7242f2e959 100644 --- a/docs/en/appendices/5-0-migration-guide.md +++ b/docs/en/appendices/5-0-migration-guide.md @@ -27,7 +27,7 @@ changes made: - The `SECOND`, `MINUTE`, `HOUR`, `DAY`, `WEEK`, `MONTH`, `YEAR` constants were removed. -- Use of `#[\AllowDynamicProperties]` removed everywhere. It was used for the following classes: +- Use of `#[\AllowDynamicProperties]` removed everywhere. It was used for the following classes: - `Command/Command` - `Console/Shell` - `Controller/Component` @@ -37,7 +37,7 @@ changes made: - `View/Helper` - `View/View` -- The supported database engine versions were updated: +- The supported database engine versions were updated: - MySQL (5.7 or higher) - MariaDB (10.1 or higher) - PostgreSQL (9.6 or higher) @@ -114,7 +114,7 @@ changes made: - The `DateTimeType` and `DateType` now always return immutable objects. Additionally the interface for `Date` objects reflects the `ChronosDate` - interface which lacks all of the time related methods that were present in + interface which lacks all the time related methods that were present in CakePHP 4.x. - `DateType::setLocaleFormat()` no longer accepts an array. - `Query` now accepts only `\Closure` parameters instead of `callable`. Callables can be converted diff --git a/docs/en/console-commands.md b/docs/en/console-commands.md index efff2013b0..89a14bb41e 100644 --- a/docs/en/console-commands.md +++ b/docs/en/console-commands.md @@ -48,7 +48,7 @@ unambiguously reference a command. ## Console Applications -By default CakePHP will automatically discover all the commands in your +By default, CakePHP will automatically discover all the commands in your application and its plugins. You may want to reduce the number of exposed commands, when building standalone console applications. You can use your `Application`'s `console()` hook to limit which commands are exposed and diff --git a/docs/en/console-commands/commands.md b/docs/en/console-commands/commands.md index b96704d8a1..4fc1d03fe5 100644 --- a/docs/en/console-commands/commands.md +++ b/docs/en/console-commands/commands.md @@ -295,7 +295,7 @@ cake user [-h] [-q] [-v] ## Grouping Commands -By default in the help output CakePHP will group commands into core, app, and +By default, in the help output CakePHP will group commands into core, app, and plugin groups. You can customize the grouping of commands by implementing `getGroup()`: diff --git a/docs/en/console-commands/input-output.md b/docs/en/console-commands/input-output.md index 3cc9d2c7b3..582b23a0e6 100644 --- a/docs/en/console-commands/input-output.md +++ b/docs/en/console-commands/input-output.md @@ -407,6 +407,6 @@ no styling is done at all. There are three modes you can use. This is a good mode to use if you are outputting XML or, want to debug why your styling isn't working. -By default on \*nix systems ConsoleOutput objects default to color output. +By default, on \*nix systems ConsoleOutput objects default to color output. On Windows systems, plain output is the default unless the `ANSICON` environment variable is present. diff --git a/docs/en/controllers.md b/docs/en/controllers.md index 0669521893..f3ef6aaef6 100644 --- a/docs/en/controllers.md +++ b/docs/en/controllers.md @@ -79,7 +79,7 @@ When a request is made to a CakePHP application, CakePHP's `Cake\Routing\Router` and `Cake\Routing\Dispatcher` classes use [Routes Configuration](development/routing#routes-configuration) to find and create the correct controller instance. The request data is encapsulated in a request object. -CakePHP puts all of the important request information into the `$this->request` +CakePHP puts all the important request information into the `$this->request` property. See the section on [Cake Request](controllers/request-response#cake-request) for more information on the CakePHP request object. @@ -580,7 +580,7 @@ logic around the request life-cycle: ### Controller Callback Methods -By default the following callback methods are connected to related events if the +By default, the following callback methods are connected to related events if the methods are implemented by your controllers #### beforeFilter() diff --git a/docs/en/controllers/components/form-protection.md b/docs/en/controllers/components/form-protection.md index b81bab9d14..ad54ff8ba8 100644 --- a/docs/en/controllers/components/form-protection.md +++ b/docs/en/controllers/components/form-protection.md @@ -25,7 +25,7 @@ in your `initialize()` method. ## Form tampering prevention -By default the `FormProtectionComponent` prevents users from tampering with +By default, the `FormProtectionComponent` prevents users from tampering with forms in specific ways. It will prevent the following things: - Form's action (URL) cannot be modified. diff --git a/docs/en/controllers/pagination.md b/docs/en/controllers/pagination.md index e202cae025..a8f4b93dfe 100644 --- a/docs/en/controllers/pagination.md +++ b/docs/en/controllers/pagination.md @@ -123,7 +123,7 @@ This object contains the paginated records and the paging params. ## Simple Pagination -By default `Controller::paginate()` uses the `Cake\Datasource\Paging\NumericPaginator` +By default, `Controller::paginate()` uses the `Cake\Datasource\Paging\NumericPaginator` class which does a `COUNT()` query to calculate the size of the result set so that page number links can be rendered. On very large datasets this count query can be very expensive. In situations where you only want to show 'Next' and 'Previous' @@ -217,7 +217,7 @@ $unpublishedArticles = $this->paginate( ## Control which Fields Used for Ordering -By default sorting can be done on any non-virtual column a table has. This is +By default, sorting can be done on any non-virtual column a table has. This is sometimes undesirable as it allows users to sort on un-indexed columns that can be expensive to order by. You can set the allowed list of fields that can be sorted using the `sortableFields` option. This option is required when you want to @@ -347,7 +347,7 @@ protected array $paginate = [ The number of results that are fetched per page is exposed to the user as the `limit` parameter. It is generally undesirable to allow users to fetch all rows in a paginated set. The `maxLimit` option asserts that no one can set -this limit too high from the outside. By default CakePHP limits the maximum +this limit too high from the outside. By default, CakePHP limits the maximum number of rows that can be fetched to 100. If this default is not appropriate for your application, you can adjust it as part of the pagination options, for example reducing it to `10`: diff --git a/docs/en/controllers/request-response.md b/docs/en/controllers/request-response.md index 89d09b8609..e3c5c0c68b 100644 --- a/docs/en/controllers/request-response.md +++ b/docs/en/controllers/request-response.md @@ -14,7 +14,7 @@ responses from your controllers. `ServerRequest` is the default request object used in CakePHP. It centralizes a number of features for interrogating and interacting with request data. On each request one Request is created and then passed by reference to the -various layers of an application that use request data. By default the request +various layers of an application that use request data. By default, the request is assigned to `$this->request`, and is available in Controllers, Cells, Views and Helpers. You can also access it in Components using the controller reference. @@ -182,7 +182,7 @@ be accessed like this: $attachment = $this->request->getData('attachment'); ``` -By default file uploads are represented in the request data as objects that implement +By default, file uploads are represented in the request data as objects that implement [\Psr\Http\Message\UploadedFileInterface](https://www.php-fig.org/psr/psr-7/#16-uploaded-files). In the current implementation, the `$attachment` variable in the above example would by default hold an instance of `\Laminas\Diactoros\UploadedFile`. @@ -814,7 +814,7 @@ public function sendIcs() `method` Cake\\Http\\Response::**withHeader**(string $header, string $value): static Setting headers is done with the `Cake\Http\Response::withHeader()` -method. Like all of the PSR-7 interface methods, this method returns a *new* +method. Like all the PSR-7 interface methods, this method returns a *new* instance with the new header: ``` php diff --git a/docs/en/core-libraries/email.md b/docs/en/core-libraries/email.md index aa50d23533..f4d473fdc3 100644 --- a/docs/en/core-libraries/email.md +++ b/docs/en/core-libraries/email.md @@ -215,7 +215,7 @@ In your email templates you can use these with: ``` You can use helpers in emails as well, much like you can in normal template files. -By default only the `HtmlHelper` is loaded. You can load additional +By default, only the `HtmlHelper` is loaded. You can load additional helpers using the `ViewBuilder::addHelpers()` method: ``` php @@ -364,7 +364,7 @@ class UserMailer extends Mailer ->setTo($user->email) ->setSubject(sprintf('Welcome %s', $user->name)) ->viewBuilder() - ->setTemplate('welcome_mail'); // By default template with same name as method name is used. + ->setTemplate('welcome_mail'); // By default, template with same name as method name is used. } public function resetPassword($user) diff --git a/docs/en/core-libraries/global-constants-and-functions.md b/docs/en/core-libraries/global-constants-and-functions.md index 864e799a98..038166b208 100644 --- a/docs/en/core-libraries/global-constants-and-functions.md +++ b/docs/en/core-libraries/global-constants-and-functions.md @@ -14,7 +14,7 @@ ways to point to certain files or directories in your CakePHP application. Here are CakePHP's globally available functions. Most of them are just convenience wrappers for other CakePHP functionality, such as debugging and -translating content. By default only namespaced functions are autoloaded, +translating content. By default, only namespaced functions are autoloaded, however you can optionally load global aliases by adding: ``` php diff --git a/docs/en/core-libraries/httpclient.md b/docs/en/core-libraries/httpclient.md index 61f2641caa..37ddb8a4ea 100644 --- a/docs/en/core-libraries/httpclient.md +++ b/docs/en/core-libraries/httpclient.md @@ -149,7 +149,7 @@ addition request information. The following keys can be used in `$options`: - `cookie` - Array of cookies to use. - `proxy` - Array of proxy information. - `auth` - Array of authentication data, the `type` key is used to delegate to - an authentication strategy. By default Basic auth is used. + an authentication strategy. By default, Basic auth is used. - `ssl_verify_peer` - defaults to `true`. Set to `false` to disable SSL certification verification (not recommended). - `ssl_verify_peer_name` - defaults to `true`. Set to `false` to disable @@ -187,7 +187,7 @@ $response = $http->get('https://example.com/profile/1', [], [ ]); ``` -By default `Cake\Http\Client` will use basic authentication if there is no +By default, `Cake\Http\Client` will use basic authentication if there is no `'type'` key in the auth option. ### Using Digest Authentication @@ -491,7 +491,7 @@ $response->getStatusCode(); ## Changing Transport Adapters -By default `Http\Client` will prefer using a `curl` based transport adapter. +By default, `Http\Client` will prefer using a `curl` based transport adapter. If the curl extension is not available a stream based adapter will be used instead. You can force select a transport adapter using a constructor option: diff --git a/docs/en/core-libraries/internationalization-and-localization.md b/docs/en/core-libraries/internationalization-and-localization.md index 039b1dd193..3ceb8a99e3 100644 --- a/docs/en/core-libraries/internationalization-and-localization.md +++ b/docs/en/core-libraries/internationalization-and-localization.md @@ -643,7 +643,7 @@ echo Number::format(524.23); // Displays 524,23 Make sure you read the [Date & Time](../core-libraries/time) and [Number](../core-libraries/number) sections to learn more about formatting options. -By default dates returned for the ORM results use the `Cake\I18n\DateTime` class, +By default, dates returned for the ORM results use the `Cake\I18n\DateTime` class, so displaying them directly in you application will be affected by changing the current locale. diff --git a/docs/en/core-libraries/logging.md b/docs/en/core-libraries/logging.md index f98dfcf81c..14b609afea 100644 --- a/docs/en/core-libraries/logging.md +++ b/docs/en/core-libraries/logging.md @@ -305,7 +305,7 @@ following keys: - `flag`: An integer flag to be used for opening the connection to the logger, by default `LOG_ODELAY` will be used. See `openlog` documentation for more options -- `facility`: The logging slot to use in syslog. By default `LOG_USER` is +- `facility`: The logging slot to use in syslog. By default, `LOG_USER` is used. See `syslog` documentation for more options ## Creating Log Engines diff --git a/docs/en/core-libraries/validation.md b/docs/en/core-libraries/validation.md index d0dddbe275..686ba4985c 100644 --- a/docs/en/core-libraries/validation.md +++ b/docs/en/core-libraries/validation.md @@ -579,7 +579,7 @@ $errors = [ ``` If you have multiple errors on a single field, an array of error messages will -be returned per field. By default the `getErrors()` method applies rules for +be returned per field. By default, the `getErrors()` method applies rules for the 'create' mode. If you'd like to apply 'update' rules you can do the following: diff --git a/docs/en/core-libraries/xml.md b/docs/en/core-libraries/xml.md index c97f68bbd2..2e716b3e95 100644 --- a/docs/en/core-libraries/xml.md +++ b/docs/en/core-libraries/xml.md @@ -72,7 +72,7 @@ objects with `loadHtml()`: $html = Xml::loadHtml($htmlString, ['return' => 'domdocument']); ``` -By default entity loading and huge document parsing are disabled. These modes +By default, entity loading and huge document parsing are disabled. These modes can be enabled with the `loadEntities` and `parseHuge` options respectively. ## Transforming a XML String in Array @@ -117,7 +117,7 @@ Examples of invalid arrays: ]; ``` -By default array values will be output as XML tags. If you want to define +By default, array values will be output as XML tags. If you want to define attributes or text values you can prefix the keys that are supposed to be attributes with `@`. For value text, use `@` as the key: diff --git a/docs/en/development/application.md b/docs/en/development/application.md index 8afaffc99c..5a331adc87 100644 --- a/docs/en/development/application.md +++ b/docs/en/development/application.md @@ -10,13 +10,13 @@ it will be pretty slim and only define a few default methods: - `bootstrap` Used to load [configuration files](../development/configuration), define constants and other global functions. - By default this will include **config/bootstrap.php**. This is the ideal place + By default, this will include **config/bootstrap.php**. This is the ideal place to load [Plugins](../plugins) and global [event listeners](../core-libraries/events). -- `routes` Used to load [routes](../development/routing). By default this +- `routes` Used to load [routes](../development/routing). By default, this will include **config/routes.php**. - `middleware` Used to add [middleware](../controllers/middleware) to your application. - `console` Used to add [console commands](../console-commands) to your - application. By default this will automatically discover console commands in + application. By default, this will automatically discover console commands in your application and all plugins. ## Bootstrapping your Application diff --git a/docs/en/development/configuration.md b/docs/en/development/configuration.md index 0f6c611ae6..866b93cac7 100644 --- a/docs/en/development/configuration.md +++ b/docs/en/development/configuration.md @@ -124,7 +124,7 @@ The file path to webroot. App.fullBaseUrl The fully qualified domain name (including protocol) to your application's -root. This is used when generating absolute URLs. By default this value +root. This is used when generating absolute URLs. By default, this value is generated using the `$_SERVER` environment. However, you should define it manually to optimize performance or if you are concerned about people manipulating the `Host` header. @@ -579,4 +579,4 @@ The built in configuration engines are: - [IniConfig](https://api.cakephp.org/5.x/class-Cake.Core.Configure.Engine.IniConfig.html) - [PhpConfig](https://api.cakephp.org/5.x/class-Cake.Core.Configure.Engine.PhpConfig.html) -By default your application will use `PhpConfig`. +By default, your application will use `PhpConfig`. diff --git a/docs/en/development/debugging.md b/docs/en/development/debugging.md index 49d8f603d6..a4987e8e21 100644 --- a/docs/en/development/debugging.md +++ b/docs/en/development/debugging.md @@ -55,7 +55,7 @@ The following configuration options can be set in **config/app.php** to change h `Debugger` behaves: - `Debugger.editor` Choose the which editor URL format you want to use. - By default atom, emacs, macvim, phpstorm, sublime, textmate, and vscode are + By default, atom, emacs, macvim, phpstorm, sublime, textmate, and vscode are available. You can add additional editor link formats using `Debugger::addEditor()` during your application bootstrap. - `Debugger.editorBasePath` The path that replaces `ROOT` when generating diff --git a/docs/en/development/dependency-injection.md b/docs/en/development/dependency-injection.md index c7783a5329..f3bea6f193 100644 --- a/docs/en/development/dependency-injection.md +++ b/docs/en/development/dependency-injection.md @@ -537,7 +537,7 @@ $container->add(AuditLogServiceInterface::class, function (...$args) { }); ``` -Factory functions will receive all of the resolved dependencies for the class +Factory functions will receive all the resolved dependencies for the class as arguments. Once you've defined a class, you also need to define the dependencies it @@ -559,7 +559,7 @@ be added automatically. > [!IMPORTANT] > Services are **not shared by default** - each request creates a new instance. Use `addShared()` to create singleton services that persist across requests. -By default services are not shared. Every object (and dependencies) is created +By default, services are not shared. Every object (and dependencies) is created each time it is fetched from the container. If you want to re-use a single instance, often referred to as a singleton, you can mark a service as 'shared': diff --git a/docs/en/development/errors.md b/docs/en/development/errors.md index 51140f0534..2880459ec5 100644 --- a/docs/en/development/errors.md +++ b/docs/en/development/errors.md @@ -160,7 +160,7 @@ data returned by `getAttributes()` will be exposed as view variables as well. ### Custom Error Page Layout -By default error templates use **templates/layout/error.php** for a layout. +By default, error templates use **templates/layout/error.php** for a layout. You can use the `layout` property to pick a different layout: ``` php @@ -480,7 +480,7 @@ public function view($id = null) ``` The above would cause the configured exception handler to catch and -process the `NotFoundException`. By default this will create an error +process the `NotFoundException`. By default, this will create an error page, and log the exception. ### Other Built In Exceptions @@ -570,7 +570,7 @@ MethodNotAllowedException the rfc2616 says: ## Customizing PHP Error Handling -By default PHP errors are rendered to console or HTML output, and also logged. +By default, PHP errors are rendered to console or HTML output, and also logged. If necessary, you can swap out CakePHP's error handling logic with your own. ### Custom Error Logging diff --git a/docs/en/development/rest.md b/docs/en/development/rest.md index 0ea7dfccf3..855a07e56f 100644 --- a/docs/en/development/rest.md +++ b/docs/en/development/rest.md @@ -139,7 +139,7 @@ $middlewareQueue->add(new BodyParserMiddleware()); ``` This middleware will use the `content-type` header to detect the format of -request data and parse enabled formats. By default only `JSON` parsing is +request data and parse enabled formats. By default, only `JSON` parsing is enabled by default. You can enable XML support by enabling the `xml` constructor option. When a request is made with a `Content-Type` of `application/json`, CakePHP will decode the request data and update the diff --git a/docs/en/development/routing.md b/docs/en/development/routing.md index 6d6abd1612..d111780986 100644 --- a/docs/en/development/routing.md +++ b/docs/en/development/routing.md @@ -1193,7 +1193,7 @@ You can get the `article_id` in `CommentsController` by: $this->request->getParam('article_id'); ``` -By default resource routes map to the same prefix as the containing scope. If +By default, resource routes map to the same prefix as the containing scope. If you have both nested and non-nested resource controllers you can use a different controller in each context by using prefixes: @@ -1216,7 +1216,7 @@ compatible with [Prefix Routing](#prefix-routing). ### Limiting the Routes Created -By default CakePHP will connect 6 routes for each resource. If you'd like to +By default, CakePHP will connect 6 routes for each resource. If you'd like to only connect specific resource routes you can use the `only` option: ``` php @@ -1270,7 +1270,7 @@ $routes->resources('Articles', [ ``` In addition to the default routes, this would also connect a route for -`/articles/delete-all`. By default the path segment will match the key name. You +`/articles/delete-all`. By default, the path segment will match the key name. You can use the 'path' key inside the resource definition to customize the path name: @@ -1338,7 +1338,7 @@ The above will generate URLs styled like: **/blog_posts**. ### Changing the Path Element -By default resource routes use an inflected form of the resource name for the +By default, resource routes use an inflected form of the resource name for the URL segment. You can set a custom URL segment with the `path` option: ``` php diff --git a/docs/en/development/sessions.md b/docs/en/development/sessions.md index 196ab8b3be..67d76ec4e4 100644 --- a/docs/en/development/sessions.md +++ b/docs/en/development/sessions.md @@ -73,7 +73,7 @@ Configure::write('Session', [ ]); ``` -By default PHP sets the session cookie to expire as soon as the browser is +By default, PHP sets the session cookie to expire as soon as the browser is closed, regardless of the configured `Session.timeout` value. The cookie timeout is controlled by the `session.cookie_lifetime` ini value and can be configured using: diff --git a/docs/en/development/testing.md b/docs/en/development/testing.md index bf4ec9fbf7..14f738d616 100644 --- a/docs/en/development/testing.md +++ b/docs/en/development/testing.md @@ -384,7 +384,7 @@ or a SQL dump file. ### Test Connections -By default CakePHP will alias each connection in your application. Each +By default, CakePHP will alias each connection in your application. Each connection defined in your application's bootstrap that does not start with `test_` will have a `test_` prefixed alias created. Aliasing connections ensures, you don't accidentally use the wrong connection in test cases. @@ -738,7 +738,7 @@ public function getFixtures(): array ### Fixture State Managers -By default CakePHP resets fixture state at the end of each test by truncating +By default, CakePHP resets fixture state at the end of each test by truncating all the tables in the database. This operation can become expensive as your application grows. By using `TransactionStrategy` each test method will be run inside a transaction that is rolled back at the end of the test. This can yield @@ -1232,7 +1232,7 @@ $this->setUnlockedFields(['dynamic_field']); ### Integration Testing PSR-7 Middleware Integration testing can also be used to test your entire PSR-7 application and -[Middleware](../controllers/middleware). By default `IntegrationTestTrait` will +[Middleware](../controllers/middleware). By default, `IntegrationTestTrait` will auto-detect the presence of an `App\Application` class and automatically enable integration testing of your Application. @@ -1650,7 +1650,7 @@ $this->assertCookieNotSet('remember_me'); $this->assertContentType('application/json'); ``` -In addition to the above assertion methods, you can also use all of the +In addition to the above assertion methods, you can also use all the assertions in [TestSuite](https://api.cakephp.org/5.x/class-Cake.TestSuite.TestCase.html) and those found in [PHPUnit](https://phpunit.de/manual/current/en/appendixes.assertions.html). diff --git a/docs/en/orm/associations.md b/docs/en/orm/associations.md index 4c369fd66a..aa7870e7dc 100644 --- a/docs/en/orm/associations.md +++ b/docs/en/orm/associations.md @@ -32,7 +32,7 @@ class ArticlesTable extends Table ``` The simplest form of any association setup takes the table alias you want to -associate with. By default all of the details of an association will use the +associate with. By default, all the details of an association will use the CakePHP conventions. If you want to customize how your associations are handled you can modify them with setters: @@ -239,7 +239,7 @@ Possible keys for hasOne association arrays include: triggered. When `false`, `deleteAll()` is used to remove associated data and no callbacks are triggered. - **propertyName**: The property name that should be filled with data from the - associated table into the source table results. By default this is the + associated table into the source table results. By default, this is the underscored & singular name of the association so `address` in our example. - **strategy**: The query strategy used to load matching record from the other table. Accepted values are `'join'` and `'select'`. Using `'select'` will generate a separate query @@ -329,7 +329,7 @@ Possible keys for belongsTo association arrays include: 'LEFT' and 'INNER'. You can use 'INNER' to get results only where the association is set. The default value is 'LEFT'. - **propertyName**: The property name that should be filled with data from the - associated table into the source table results. By default this is the + associated table into the source table results. By default, this is the underscored & singular name of the association so `user` in our example. - **strategy**: The query strategy used to load matching record from the other table. Accepted values are `'join'` and `'select'`. Using `'select'` will generate a separate query @@ -410,7 +410,7 @@ $this->hasMany('Comments') ``` Relying on the example above, we have passed an array containing the desired -composite keys to `setForeignKey()`. By default the `bindingKey` would be +composite keys to `setForeignKey()`. By default, the `bindingKey` would be automatically defined as `id` and `hash` respectively, but let's assume that you need to specify different binding fields than the defaults. You can setup it manually with `setBindingKey()`: @@ -455,7 +455,7 @@ Possible keys for hasMany association arrays include: triggered. When `false`, `deleteAll()` is used to remove associated data and no callbacks are triggered. - **propertyName**: The property name that should be filled with data from the - associated table into the source table results. By default this is the + associated table into the source table results. By default, this is the underscored & plural name of the association so `comments` in our example. - **strategy**: Defines the query strategy to use. Defaults to 'select'. The other valid value is 'subquery', which replaces the `IN` list with an @@ -579,7 +579,7 @@ Possible keys for belongsToMany association arrays include: example, it should be 'Tags'. The default value is the name of the association. - **joinTable**: The name of the join table used in this association (if the current table doesn't adhere to the naming - convention for belongsToMany join tables). By default this table + convention for belongsToMany join tables). By default, this table name will be used to load the Table instance for the join table. - **foreignKey**: The name of the foreign key that references the current model found on the join table, or list in case of composite foreign keys. @@ -609,7 +609,7 @@ Possible keys for belongsToMany association arrays include: no callbacks are triggered. This defaults to `false` to help reduce overhead. - **propertyName**: The property name that should be filled with data from the - associated table into the source table results. By default this is the + associated table into the source table results. By default, this is the underscored & plural name of the association, so `tags` in our example. - **strategy**: Defines the query strategy to use. Defaults to 'select'. The other valid value is 'subquery', which replaces the `IN` list with an @@ -742,7 +742,7 @@ $query = $this->Students->find( ### Using Association Finders -By default associations will load records based on the foreign key columns. If +By default, associations will load records based on the foreign key columns. If you want to define additional conditions for associations, you can use a `finder`. When an association is loaded the ORM will use your [custom finder](../orm/retrieving-data-and-resultsets#custom-find-methods) to load, update, or delete associated records. diff --git a/docs/en/orm/behaviors/counter-cache.md b/docs/en/orm/behaviors/counter-cache.md index b41ac55361..fa9969d7e3 100644 --- a/docs/en/orm/behaviors/counter-cache.md +++ b/docs/en/orm/behaviors/counter-cache.md @@ -50,7 +50,7 @@ The counter **will not** be updated when you ## Advanced Usage -If you need to keep a cached counter for less than all of the related records, +If you need to keep a cached counter for less than all the related records, you can supply additional conditions or finder methods to generate a counter value: diff --git a/docs/en/orm/behaviors/translate.md b/docs/en/orm/behaviors/translate.md index 03b4992eff..7250de6d8c 100644 --- a/docs/en/orm/behaviors/translate.md +++ b/docs/en/orm/behaviors/translate.md @@ -86,7 +86,7 @@ class ArticlesTable extends Table { public function initialize(array $config): void { - // By default ShadowTable will be used. + // By default, ShadowTable will be used. $this->addBehavior('Translate', ['fields' => ['title', 'body']]); } } @@ -115,7 +115,7 @@ For `EavStrategy` you are required to pass the `fields` key in the configuration array. This list of fields is needed to tell the behavior what columns will be able to store translations. -By default the locale specified in `App.defaultLocale` config is used as default +By default, the locale specified in `App.defaultLocale` config is used as default locale for the `TranslateBehavior`. You can override that by setting `defaultLocale` config of the behavior: diff --git a/docs/en/orm/database-basics.md b/docs/en/orm/database-basics.md index 4f5c31ae45..428997dc45 100644 --- a/docs/en/orm/database-basics.md +++ b/docs/en/orm/database-basics.md @@ -744,7 +744,7 @@ class PointMutationType extends BaseType } ``` -By default the `toStatement()` method will treat values as strings which will +By default, the `toStatement()` method will treat values as strings which will work for our new type. ### Connecting Custom Datatypes to Schema Reflection and Generation @@ -1194,7 +1194,7 @@ Log::setConfig('queries', [ ## Identifier Quoting -By default CakePHP does **not** quote identifiers in generated SQL queries. The +By default, CakePHP does **not** quote identifiers in generated SQL queries. The reason for this is identifier quoting has a few drawbacks: - Performance overhead - Quoting identifiers is much slower and complex than not doing it. diff --git a/docs/en/orm/deleting-data.md b/docs/en/orm/deleting-data.md index 5d0fb73a5f..1057a23d10 100644 --- a/docs/en/orm/deleting-data.md +++ b/docs/en/orm/deleting-data.md @@ -27,7 +27,7 @@ When deleting entities a few things happen: 5. Any junction table records for BelongsToMany associations will be removed. 6. The `Model.afterDelete` event will be triggered. -By default all deletes happen within a transaction. You can disable the +By default, all deletes happen within a transaction. You can disable the transaction with the atomic option: ``` php @@ -45,7 +45,7 @@ The `$options` parameter supports the following options: When deleting entities, associated data can also be deleted. If your HasOne and HasMany associations are configured as `dependent`, delete operations will -'cascade' to those entities as well. By default entities in associated tables +'cascade' to those entities as well. By default, entities in associated tables are removed using `Cake\ORM\Table::deleteAll()`. You can elect to have the ORM load related entities, and delete them individually by setting the `cascadeCallbacks` option to `true`. A sample HasMany association with both diff --git a/docs/en/orm/entities.md b/docs/en/orm/entities.md index 05b408edac..469a92fdb5 100644 --- a/docs/en/orm/entities.md +++ b/docs/en/orm/entities.md @@ -603,7 +603,7 @@ converting the associated data into the correct format. ### Exposing Virtual Fields -By default virtual fields are not exported when converting entities to +By default, virtual fields are not exported when converting entities to arrays or JSON. In order to expose virtual fields you need to make them visible. When defining your entity class you can provide a list of virtual field that should be exposed: diff --git a/docs/en/orm/query-builder.md b/docs/en/orm/query-builder.md index 2a132ba650..ee7c5a86d6 100644 --- a/docs/en/orm/query-builder.md +++ b/docs/en/orm/query-builder.md @@ -270,7 +270,7 @@ more complex `WHERE` conditions. ### Selecting Specific Fields -By default a query will select all fields from a table, the exception is when you +By default, a query will select all fields from a table, the exception is when you call the `select()` function yourself and pass certain fields: ``` php diff --git a/docs/en/orm/retrieving-data-and-resultsets.md b/docs/en/orm/retrieving-data-and-resultsets.md index 5a429c00df..de262af5d2 100644 --- a/docs/en/orm/retrieving-data-and-resultsets.md +++ b/docs/en/orm/retrieving-data-and-resultsets.md @@ -174,7 +174,7 @@ you can pass query objects to your controllers, we recommend that you package your queries up as [Custom Find Methods](#custom-find-methods) instead. Using custom finder methods will let you re-use your queries and make testing easier. -By default queries and result sets will return [Entities](../orm/entities) objects. You +By default, queries and result sets will return [Entities](../orm/entities) objects. You can retrieve basic arrays by disabling hydration: ``` php @@ -341,7 +341,7 @@ $query = $authors->find('list'); // Will utilize AuthorsTable::getDisplayField() ## Finding Threaded Data The `find('threaded')` finder returns nested entities that are threaded -together through a key field. By default this field is `parent_id`. This +together through a key field. By default, this field is `parent_id`. This finder allows you to access data stored in an 'adjacency list' style table. All entities matching a given `parent_id` are placed under the `children` attribute: @@ -490,7 +490,7 @@ If you prefer to use join functions, you can look at ## Eager Loading Associations Via Contain -By default CakePHP does not load **any** associated data when using `find()`. +By default, CakePHP does not load **any** associated data when using `find()`. You need to 'contain' or eager-load each association you want loaded in your results. @@ -996,7 +996,7 @@ the resulting data from your queries. ResultSets are a [Collection](../core-libr and you can use any collection method on ResultSet objects. Result set objects will lazily load rows from the underlying prepared statement. -By default results will be buffered in memory allowing you to iterate a result +By default, results will be buffered in memory allowing you to iterate a result set multiple times, or cache and iterate the results. Result sets allow you to cache/serialize or JSON encode results for API diff --git a/docs/en/orm/saving-data.md b/docs/en/orm/saving-data.md index cc2488a1ff..df88edc7bc 100644 --- a/docs/en/orm/saving-data.md +++ b/docs/en/orm/saving-data.md @@ -51,7 +51,7 @@ value of the `isNew()` method. Entities that were retrieved with `get()` or ### Saving With Associations -By default the `save()` method will also save one level of associations: +By default, the `save()` method will also save one level of associations: ``` php $articlesTable = $this->fetchTable('Articles'); @@ -140,7 +140,7 @@ $entity = $articles->newEntity($this->request->getData()); > [!NOTE] > If you are using newEntity() and the resulting entities are missing some or -> all of the data they were passed, double check that the columns you want to +> all the data they were passed, double check that the columns you want to > set are listed in the `$_accessible` property of your entity. See [Entities Mass Assignment](../orm/entities#entities-mass-assignment). The request data should follow the structure of your entities. For example if @@ -421,7 +421,7 @@ concerned entity. > [!NOTE] > If you are using newEntity() and the resulting entities are missing some or -> all of the data they were passed, double check that the columns you want to +> all the data they were passed, double check that the columns you want to > set are listed in the `$_accessible` property of your entity. See > [Entities Mass Assignment](../orm/entities#entities-mass-assignment). @@ -889,8 +889,8 @@ $articles->save($article, ['checkRules' => false, 'atomic' => false]); ### Saving Associations -When you are saving an entity, you can also choose to save some or all of the -associated entities. By default all first level entities will be saved. For +When you are saving an entity, you can also choose to save some or all the +associated entities. By default, all first level entities will be saved. For example saving an Article, will also automatically update any dirty entities that are directly related to articles table. @@ -1006,15 +1006,15 @@ When saving hasMany associations, associated records will either be updated, or inserted. For the case that the record already has associated records in the database, you have the choice between two saving strategies: -append +append Associated records are updated in the database or, if not matching any existing record, inserted. -replace +replace Any existing records that do not match the records provided will be deleted from the database. Only provided records will remain (or be inserted). -By default the `append` saving strategy is used. +By default, the `append` saving strategy is used. See [Has Many Associations](../orm/associations#has-many-associations) for details on defining the `saveStrategy`. Whenever you add new records to an existing association you should always mark @@ -1069,12 +1069,12 @@ the [Converting Request Data](#converting-request-data) section for more informa When saving belongsToMany associations, you have the choice between two saving strategies: -append +append Only new links will be created between each side of this association. This strategy will not destroy existing links even though they may not be present in the array of entities to be saved. -replace +replace When saving, existing links will be removed and new links will be created in the junction table. If there are existing link in the database to some of the entities intended to be saved, those links will be updated, not deleted @@ -1082,7 +1082,7 @@ and then re-saved. See [Belongs To Many Associations](../orm/associations#belongs-to-many-associations) for details on defining the `saveStrategy`. -By default the `replace` strategy is used. Whenever you add new records into +By default, the `replace` strategy is used. Whenever you add new records into an existing association you should always mark the association property as 'dirty'. This lets the ORM know that the association property has to be persisted: diff --git a/docs/en/orm/table-objects.md b/docs/en/orm/table-objects.md index 59ccafdbe6..c27c65ba76 100644 --- a/docs/en/orm/table-objects.md +++ b/docs/en/orm/table-objects.md @@ -70,7 +70,7 @@ class ArticlesTable extends Table ### Customizing the Entity Class a Table Uses -By default table objects use an entity class based on naming conventions. For +By default, table objects use an entity class based on naming conventions. For example if your table class is called `ArticlesTable` the entity would be `Article`. If the table class was `PurchaseOrdersTable` the entity would be `PurchaseOrder`. If however, you want to use an entity that doesn't follow the @@ -467,7 +467,7 @@ CakePHP in the chapter on [Behaviors](../orm/behaviors). ## Configuring Connections -By default all table instances use the `default` database connection. If your +By default, all table instances use the `default` database connection. If your application uses multiple database connections you will want to configure which tables use which connections. This is the `defaultConnectionName()` method: diff --git a/docs/en/orm/validation.md b/docs/en/orm/validation.md index 043f90da29..6a7922fb60 100644 --- a/docs/en/orm/validation.md +++ b/docs/en/orm/validation.md @@ -14,7 +14,7 @@ have two stages of validation: ## Validating Data Before Building Entities When marshalling data into entities, you can validate data. Validating data -allows you to check the type, shape and size of data. By default request data +allows you to check the type, shape and size of data. By default, request data will be validated before it is converted into entities. If any validation rules fail, the returned entity will contain errors. The fields with errors will not be present in the returned entity: @@ -107,7 +107,7 @@ $article = $articles->newEntity( ``` The above would call the `validationUpdate()` method on the table instance to -build the required rules. By default the `validationDefault()` method will be +build the required rules. By default, the `validationDefault()` method will be used. An example validator for our articles table would be: ``` php diff --git a/docs/en/plugins.md b/docs/en/plugins.md index 6cd2d9a1c4..9ec1d61679 100644 --- a/docs/en/plugins.md +++ b/docs/en/plugins.md @@ -113,7 +113,7 @@ appropriate parts of your application. The hooks are: - `services` Used to register application container services. This is a good opportunity to setup additional objects that need access to the container. -By default all plugins hooks are enabled. You can disable hooks by using the +By default, all plugins hooks are enabled. You can disable hooks by using the related options of the `plugin load` command: ``` bash diff --git a/docs/en/security/content-security-policy.md b/docs/en/security/content-security-policy.md index 1c4c3daa92..5f933cb263 100644 --- a/docs/en/security/content-security-policy.md +++ b/docs/en/security/content-security-policy.md @@ -38,7 +38,7 @@ and `strict-dynamic` for increased security and easier maintenance: ``` php $policy = [ - // Must exist even if empty to set nonce for for script-src + // Must exist even if empty to set nonce for script-src 'script-src' => [], 'style-src' => [], ]; diff --git a/docs/en/tutorials-and-examples.md b/docs/en/tutorials-and-examples.md index 685dc79ba5..c9e2d38a90 100644 --- a/docs/en/tutorials-and-examples.md +++ b/docs/en/tutorials-and-examples.md @@ -1,7 +1,7 @@ # Tutorials & Examples In this section, you can walk through typical CakePHP applications -to see how all of the pieces come together. +to see how all the pieces come together. - [Content Management Tutorial](tutorials-and-examples/cms/installation) - [CMS Tutorial - Creating the Database](tutorials-and-examples/cms/database) diff --git a/docs/en/tutorials-and-examples/cms/authentication.md b/docs/en/tutorials-and-examples/cms/authentication.md index 96cf920911..767fb25a25 100644 --- a/docs/en/tutorials-and-examples/cms/authentication.md +++ b/docs/en/tutorials-and-examples/cms/authentication.md @@ -183,7 +183,7 @@ public function initialize(): void Now, on every request, the `AuthenticationMiddleware` will inspect the request session to look for an authenticated user. If we are loading the `/users/login` page, it will also inspect the posted form data (if any) to extract the credentials. -By default the credentials will be extracted from the `username` and `password` +By default, the credentials will be extracted from the `username` and `password` fields in the request data. The authentication result will be injected in a request attribute named `authentication`. You can inspect the result at any time using diff --git a/docs/en/views.md b/docs/en/views.md index bab27e8b97..f5a6b81009 100644 --- a/docs/en/views.md +++ b/docs/en/views.md @@ -713,7 +713,7 @@ echo $this->cache(function () use ($user, $article) { }, ['key' => 'my_view_key']); ``` -By default cached view content will go into the `View::$elementCache` cache +By default, cached view content will go into the `View::$elementCache` cache config, but you can use the `config` option to change this. diff --git a/docs/en/views/helpers.md b/docs/en/views/helpers.md index 3dfdf70873..41e9ec98f0 100644 --- a/docs/en/views/helpers.md +++ b/docs/en/views/helpers.md @@ -111,7 +111,7 @@ class AwesomeHelper extends Helper } ``` -By default all configuration options will be merged with the `$_defaultConfig` +By default, all configuration options will be merged with the `$_defaultConfig` property. This property should define the default values of any configuration your helper requires. For example: diff --git a/docs/en/views/helpers/form.md b/docs/en/views/helpers/form.md index 53c2ed2141..f366855f4d 100644 --- a/docs/en/views/helpers/form.md +++ b/docs/en/views/helpers/form.md @@ -158,7 +158,7 @@ or more sources by setting `valueSources` option or by using `setValuesSource()` Any widgets generated by `FormHelper` will gather their values from the sources, in the order you setup. -By default `FormHelper` draws its values from `data` or `context`, i.e. it will +By default, `FormHelper` draws its values from `data` or `context`, i.e. it will fetch data from `$request->getData()` or, if not present, from the active context's data, that are the entity's data in the case of `EntityContext`. @@ -367,11 +367,11 @@ methods of FormHelper. > [!TIP] > Please note that while the fields generated by the `control()` method are > called generically "inputs" on this page, technically speaking, the -> `control()` method can generate not only all of the HTML `input` type +> `control()` method can generate not only all the HTML `input` type > elements, but also other HTML form elements such as `select`, > `button`, `textarea`. -By default the `control()` method will employ the following widget templates: +By default, the `control()` method will employ the following widget templates: ``` html 'inputContainer' => '
{{content}}
' @@ -1364,7 +1364,7 @@ array. If `$attributes['value']` is provided, then the HTML `option` element(s) which have the specified value(s) will be shown as selected when rendering the select picker. -By default `select` uses the following widget templates: +By default, `select` uses the following widget templates: ``` html 'select' => '' @@ -2035,7 +2035,7 @@ exists. If the first character is '/' then the image path is relative to *webroot*, else if the first character is not '/' then the image path is relative to *webroot/img*. -By default it will use the following widget templates: +By default, it will use the following widget templates: ``` html 'inputSubmit' => '' @@ -2437,7 +2437,7 @@ Output: ### Moving Checkboxes & Radios Outside of a Label -By default CakePHP nests checkboxes created via `control()` and radio buttons +By default, CakePHP nests checkboxes created via `control()` and radio buttons created by both `control()` and `radio()` within label elements. This helps make it easier to integrate popular CSS frameworks. If you need to place checkbox/radio inputs outside of the label you can do so by modifying the diff --git a/docs/en/views/helpers/html.md b/docs/en/views/helpers/html.md index 33ab014297..7a7012fc89 100644 --- a/docs/en/views/helpers/html.md +++ b/docs/en/views/helpers/html.md @@ -64,7 +64,7 @@ Creates a link(s) to a CSS style-sheet. If the `block` option is set to inside the head tag of the document. You can use the `block` option to control which block the link element -will be appended to. By default it will append to the `css` block. +will be appended to. By default, it will append to the `css` block. If key 'rel' in `$options` array is set to 'import' the stylesheet will be imported. @@ -501,7 +501,7 @@ once. This defaults to `true`. You can use `$options` to set additional properties to the generated script tag. If an array of script tags is used, the -attributes will be applied to all of the generated script tags. +attributes will be applied to all the generated script tags. This method of JavaScript file inclusion assumes that the JavaScript file specified resides inside the **webroot/js** diff --git a/docs/en/views/helpers/paginator.md b/docs/en/views/helpers/paginator.md index 9ee2b4c498..ade6c4d0b5 100644 --- a/docs/en/views/helpers/paginator.md +++ b/docs/en/views/helpers/paginator.md @@ -12,7 +12,7 @@ create paginated datasets and do paginated queries. `method` Cake\\View\\Helper\\PaginatorHelper::**setPaginated**(PaginatedInterface $paginated, array $options = []): void -By default the helper uses the first instance of `Cake\Datasource\Paging\PaginatedInterface` +By default, the helper uses the first instance of `Cake\Datasource\Paging\PaginatedInterface` it finds in the view variables. (Generally the result of `Controller::paginate()`). You can use `PaginatorHelper::setPaginated()` to explicitly set the paginated @@ -342,7 +342,7 @@ echo $this->Paginator->counter('range'); `method` Cake\\View\\Helper\\PaginatorHelper::**generateUrl**(array $options = [], ?string $model = null, array $url = [], array $urlOptions = []): string -By default returns a full pagination URL string for use in non-standard contexts +By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript). ``` php @@ -443,7 +443,7 @@ Sets all the options for the PaginatorHelper. Supported options are: The example above adds the `en` route parameter to all links the helper will generate. It will also create links with specific sort, direction and page - values. By default `PaginatorHelper` will merge in all of the current passed + values. By default, `PaginatorHelper` will merge in all the current passed arguments and query string parameters. - `escape` Defines if the title field for links should be HTML escaped. diff --git a/docs/en/views/json-and-xml-views.md b/docs/en/views/json-and-xml-views.md index 6f53f1e676..399bceeef4 100644 --- a/docs/en/views/json-and-xml-views.md +++ b/docs/en/views/json-and-xml-views.md @@ -11,7 +11,7 @@ There are two ways you can generate data views. The first is by using the ## Defining View Classes to Negotiate With In your `AppController` or in an individual controller you can implement the -`viewClasses()` method and provide all of the views you want to support: +`viewClasses()` method and provide all the views you want to support: ``` php use Cake\View\JsonView; @@ -132,7 +132,7 @@ output the serialized content. `class` **XmlView** -By default when using `serialize` the XmlView will wrap your serialized +By default, when using `serialize` the XmlView will wrap your serialized view variables with a `` node. You can set a custom name for this node using the `rootNode` option.