Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/appendices/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Would point to the following value:
[
'Cache' => [
'default' => [
'engine' => 'File'
'engine' => 'File',
]
]
]
Expand Down
2 changes: 1 addition & 1 deletion docs/en/appendices/phpunit-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ should be converted to:

``` php
->with(
...self::withConsecutive(['firstCallArg'], ['secondCallArg'])
...self::withConsecutive(['firstCallArg'], ['secondCallArg']),
)
```

Expand Down
10 changes: 5 additions & 5 deletions docs/en/console-commands/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class UserCommand extends Command
{
$parser
->addArgument('name', [
'help' => 'What is your name'
'help' => 'What is your name',
]);

return $parser;
Expand Down Expand Up @@ -392,7 +392,7 @@ class UpdateTableCommand extends Command
->setDescription('My cool console app')
->addArgument('table', [
'help' => 'Table to update',
'required' => true
'required' => true,
]);

return $parser;
Expand All @@ -403,7 +403,7 @@ class UpdateTableCommand extends Command
$table = $args->getArgument('table');
$this->fetchTable($table)->updateQuery()
->set([
'modified' => new DateTime()
'modified' => new DateTime(),
])
->execute();

Expand Down Expand Up @@ -492,7 +492,7 @@ class UpdateTableCommand extends Command
->setDescription('My cool console app')
->addArgument('table', [
'help' => 'Table to update',
'required' => true
'required' => true,
]);

return $parser;
Expand All @@ -507,7 +507,7 @@ class UpdateTableCommand extends Command
}
$this->fetchTable($table)->updateQuery()
->set([
'modified' => new DateTime()
'modified' => new DateTime(),
])
->execute();

Expand Down
4 changes: 2 additions & 2 deletions docs/en/console-commands/option-parsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ are set to `true`, when they are absent they are set to `false`:
``` php
$parser->addOption('verbose', [
'help' => 'Enable verbose output.',
'boolean' => true
'boolean' => true,
]);
```

Expand All @@ -228,7 +228,7 @@ public function getOptionParser()
'description' => [
__("Use this command to grant ACL permissions. Once executed, the "),
__("ARO specified (and its children, if any) will have ALLOW access "),
__("to the specified ACO action (and the ACO's children, if any).")
__("to the specified ACO action (and the ACO's children, if any)."),
],
'arguments' => [
'aro' => ['help' => __('ARO to check.'), 'required' => true],
Expand Down
2 changes: 1 addition & 1 deletion docs/en/contributing/cakephp-coding-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Use this instead:
$matches = array_intersect_key(
$this->_listeners,
array_flip(
preg_grep($matchPattern, array_keys($this->_listeners), 0)
preg_grep($matchPattern, array_keys($this->_listeners), 0),
)
);
```
Expand Down
8 changes: 4 additions & 4 deletions docs/en/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ return $this->redirect([
$order->id,
'?' => [
'product' => 'pizza',
'quantity' => 5
'quantity' => 5,
],
'#' => 'top'
'#' => 'top',
]);
```

Expand All @@ -438,7 +438,7 @@ Or using a relative or absolute URL:
``` php
return $this->redirect('/orders/confirm');

return $this->redirect('http://www.example.com');
return $this->redirect('https://www.example.com');
```

Or to the referer page:
Expand Down Expand Up @@ -471,7 +471,7 @@ the controller's default one:
// In a controller method.
$recentArticles = $this->fetchTable('Articles')->find('all',
limit: 5,
order: 'Articles.created DESC'
order: 'Articles.created DESC',
)
->all();
```
Expand Down
2 changes: 1 addition & 1 deletion docs/en/controllers/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class SsoComponent extends Component
public function __construct(
ComponentRegistry $registry,
array $config = [],
UserService $users
UserService $users,
) {
parent::__construct($registry, $config);
$this->users = $users;
Expand Down
10 changes: 5 additions & 5 deletions docs/en/controllers/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ $middlewareQueue->insertAt(2, $layer);
// an exception will be raised.
$middlewareQueue->insertBefore(
'Cake\Error\Middleware\ErrorHandlerMiddleware',
$layer
$layer,
);

// Insert after another middleware.
// If the named class cannot be found, the
// middleware will added to the end.
$middlewareQueue->insertAfter(
'Cake\Error\Middleware\ErrorHandlerMiddleware',
$layer
$layer,
);
```

Expand Down Expand Up @@ -189,7 +189,7 @@ class TrackingCookieMiddleware implements MiddlewareInterface
{
public function process(
ServerRequestInterface $request,
RequestHandlerInterface $handler
RequestHandlerInterface $handler,
): ResponseInterface
{
// Calling $handler->handle() delegates control to the *next* middleware
Expand All @@ -201,7 +201,7 @@ class TrackingCookieMiddleware implements MiddlewareInterface
$response = $response->withCookie(new Cookie(
'landing_page',
$request->getRequestTarget(),
$expiry
$expiry,
));
}

Expand Down Expand Up @@ -265,7 +265,7 @@ use Cake\Http\Middleware\EncryptedCookieMiddleware;
$cookies = new EncryptedCookieMiddleware(
// Names of cookies to protect
['secrets', 'protected'],
Configure::read('Security.cookieKey')
Configure::read('Security.cookieKey'),
);

$middlewareQueue->add($cookies);
Expand Down
2 changes: 1 addition & 1 deletion docs/en/controllers/pages-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a simple and optional controller for serving up static content. The home
you see after installation is generated using this controller and the view
file **templates/Pages/home.php**. If you make the view file
**templates/Pages/about_us.php** you can access it using the URL
**http://example.com/pages/about_us**. You are free to modify the Pages
**https://example.com/pages/about_us**. You are free to modify the Pages
Controller to meet your needs.

When you "bake" an app using Composer the Pages Controller is created in your
Expand Down
12 changes: 6 additions & 6 deletions docs/en/controllers/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ArticlesController extends AppController
$tags = $this->request->getParam('pass');

$customFinderOptions = [
'tags' => $tags
'tags' => $tags,
];
// We're using the $settings argument to paginate() here.
// But the same structure could be used in $this->paginate
Expand All @@ -90,7 +90,7 @@ class ArticlesController extends AppController
// public function findTagged(Query $query, array $tagged = [])
$settings = [
'finder' => [
'tagged' => $customFinderOptions
'tagged' => $customFinderOptions,
]
];
$articles = $this->paginate($this->Articles, $settings);
Expand Down Expand Up @@ -153,7 +153,7 @@ call to the `paginate()` method:
// Paginate property
protected array $paginate = [
'Articles' => ['scope' => 'article'],
'Tags' => ['scope' => 'tag']
'Tags' => ['scope' => 'tag'],
];

// In a controller action
Expand Down Expand Up @@ -197,7 +197,7 @@ $this->paginate = [

$publishedArticles = $this->paginate(
$this->Articles->find('all', scope: 'published_articles')
->where(['published' => true])
->where(['published' => true]),
);

// Load an additional table object to allow differentiating in the paginator
Expand All @@ -209,7 +209,7 @@ $unpublishedArticlesTable = $this->fetchTable('UnpublishedArticles', [

$unpublishedArticles = $this->paginate(
$unpublishedArticlesTable->find('all', scope: 'unpublished_articles')
->where(['published' => false])
->where(['published' => false]),
);
```

Expand Down Expand Up @@ -355,7 +355,7 @@ example reducing it to `10`:
``` php
protected array $paginate = [
// Other keys here.
'maxLimit' => 10
'maxLimit' => 10,
];
```

Expand Down
34 changes: 17 additions & 17 deletions docs/en/controllers/request-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ Returns all uploaded files in a normalized array structure. For the above exampl

``` php
[
'attachment' => object(Laminas\Diactoros\UploadedFile) {
// ...
}
'attachment' => object(Laminas\Diactoros\UploadedFile) {
// ...
}
]
```

Expand All @@ -258,14 +258,14 @@ $files = [
$size,
$errorStatus,
$clientFilename,
$clientMediaType
$clientMediaType,
),
'anotherAttachment' => new \Laminas\Diactoros\UploadedFile(
'/tmp/hfz6dbn.tmp',
123,
\UPLOAD_ERR_OK,
'attachment.txt',
'text/plain'
'text/plain',
),
],
];
Expand Down Expand Up @@ -411,34 +411,34 @@ Some examples would be:
// Add an environment detector.
$this->request->addDetector(
'post',
['env' => 'REQUEST_METHOD', 'value' => 'POST']
['env' => 'REQUEST_METHOD', 'value' => 'POST'],
);

// Add a pattern value detector.
$this->request->addDetector(
'iphone',
['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i']
['env' => 'HTTP_USER_AGENT', 'pattern' => '/iPhone/i'],
);

// Add an option detector
$this->request->addDetector('internalIp', [
'env' => 'CLIENT_IP',
'options' => ['192.168.0.101', '192.168.0.100']
'options' => ['192.168.0.101', '192.168.0.100'],
]);


// Add a header detector with value comparison
$this->request->addDetector('fancy', [
'env' => 'CLIENT_IP',
'header' => ['X-Fancy' => 1]
'header' => ['X-Fancy' => 1],
]);

// Add a header detector with callable comparison
$this->request->addDetector('fancy', [
'env' => 'CLIENT_IP',
'header' => ['X-Fancy' => function ($value, $header) {
return in_array($value, ['1', '0', 'yes', 'no'], true);
}]
}],
]);

// Add a callback detector. Must be a valid callable.
Expand Down Expand Up @@ -782,17 +782,17 @@ the browser by specifying the options:
``` php
$response = $this->response->withFile(
$file['path'],
['download' => true, 'name' => 'foo']
['download' => true, 'name' => 'foo'],
);
```

The supported options are:

name
name
The name allows you to specify an alternate file name to be sent to
the user.

download
download
A boolean value indicating whether headers should be set to force
download.

Expand Down Expand Up @@ -835,7 +835,7 @@ $response = $response->withHeader('X-Extra', 'My header');

// Set multiple headers
$response = $response->withHeader('X-Extra', 'My header')
->withHeader('Location', 'http://example.com');
->withHeader('Location', 'https://example.com');

// Append a value to an existing header
$response = $response->withAddedHeader('Set-Cookie', 'remember_me=1');
Expand Down Expand Up @@ -1149,7 +1149,7 @@ $this->response = $this->response->withCookie(Cookie::create(
'domain' => '',
'secure' => false,
'httponly' => false,
'samesite' => null // Or one of CookieInterface::SAMESITE_* constants
'samesite' => null, // Or one of CookieInterface::SAMESITE_* constants
]
));
```
Expand Down Expand Up @@ -1273,7 +1273,7 @@ class CorsMiddleware implements MiddlewareInterface
{
public function process(
ServerRequestInterface $request,
RequestHandlerInterface $handler
RequestHandlerInterface $handler,
): ResponseInterface {
// Handle preflight requests
if ($request->getMethod() === 'OPTIONS') {
Expand Down Expand Up @@ -1385,7 +1385,7 @@ $cookie = new Cookie(
'/', // path, if applicable
'example.com', // domain, if applicable
false, // secure only?
true // http only ?
true, // http only ?
);

// Using the builder methods
Expand Down
Loading