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
14 changes: 7 additions & 7 deletions docs/en/console-commands/option-parsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getOptionParser()

## Using Arguments

`method` Cake\\Console\\ConsoleOptionParser::**addArgument**($name, $params = [])
`method` Cake\\Console\\ConsoleOptionParser::**addArgument**(string $name, array $params = []): static

Positional arguments are frequently used in command line tools,
and `ConsoleOptionParser` allows you to define positional
Expand Down Expand Up @@ -73,7 +73,7 @@ The `separator` option was added.

### Adding Multiple Arguments

`method` Cake\\Console\\ConsoleOptionParser::**addArguments**(array $args)
`method` Cake\\Console\\ConsoleOptionParser::**addArguments**(array $args): static

If you have an array with multiple arguments you can use
`$parser->addArguments()` to add multiple arguments at once. :
Expand Down Expand Up @@ -109,7 +109,7 @@ will be raised and the shell will be stopped.

## Using Options

`method` Cake\\Console\\ConsoleOptionParser::**addOption**($name, array $options = [])
`method` Cake\\Console\\ConsoleOptionParser::**addOption**(string $name, array $options = []): static

Options or flags are used in command line tools to provide unordered key/value
arguments for your commands. Options can define both verbose and short aliases.
Expand Down Expand Up @@ -164,7 +164,7 @@ The `separator` option was added.

### Adding Multiple Options

`method` Cake\\Console\\ConsoleOptionParser::**addOptions**(array $options)
`method` Cake\\Console\\ConsoleOptionParser::**addOptions**(array $options): static

If you have an array with multiple options you can use `$parser->addOptions()`
to add multiple options at once. :
Expand Down Expand Up @@ -241,7 +241,7 @@ public function getOptionParser()

### Merging Option Parsers

`method` Cake\\Console\\ConsoleOptionParser::**merge**($spec)
`method` Cake\\Console\\ConsoleOptionParser::**merge**(ConsoleOptionParser $spec): static

When building a group command, you maybe want to combine several parsers for
this:
Expand Down Expand Up @@ -348,7 +348,7 @@ epilog.

### Set the Description

`method` Cake\\Console\\ConsoleOptionParser::**setDescription**($text)
`method` Cake\\Console\\ConsoleOptionParser::**setDescription**(array|string $text): static

The description displays above the argument and option information. By passing
in either an array or a string, you can set the value of the description:
Expand All @@ -363,7 +363,7 @@ $parser->getDescription();

### Set the Epilog

`method` Cake\\Console\\ConsoleOptionParser::**setEpilog**($text)
`method` Cake\\Console\\ConsoleOptionParser::**setEpilog**(array|string $text): static

Gets or sets the epilog for the option parser. The epilog is displayed after the
argument and option information. By passing in either an array or a string, you
Expand Down
8 changes: 4 additions & 4 deletions docs/en/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ rendered from the controller.

### Setting View Variables

`method` Cake\\Controller\\Controller::**set**(string $var, mixed $value)
`method` Cake\\Controller\\Controller::**set**(string $var, mixed $value): void

The `Controller::set()` method is the main way to send data from your
controller to your view. Once you've used `Controller::set()`, the variable
Expand Down Expand Up @@ -290,7 +290,7 @@ This would render **plugins/Users/templates/UserDetails/custom_file.php**

## Content Type Negotiation

`method` Cake\\Controller\\Controller::**addViewClasses**(array $viewClasses)
`method` Cake\\Controller\\Controller::**addViewClasses**(array $viewClasses): static

Controllers can define a list of view classes they support. After the
controller's action is complete CakePHP will use the view list to perform
Expand Down Expand Up @@ -462,7 +462,7 @@ a life-cycle handler.

## Loading Additional Tables/Models

`method` Cake\\Controller\\Controller::**fetchTable**(string $alias, array $config = [])
`method` Cake\\Controller\\Controller::**fetchTable**(?string $alias = null, array $options = []): Table

The `fetchTable()` method comes handy when you need to use an ORM table that is not
the controller's default one:
Expand All @@ -478,7 +478,7 @@ $recentArticles = $this->fetchTable('Articles')->find('all',

### fetchModel()

`method` Cake\\Controller\\Controller::**fetchModel**(string|null $modelClass = null, string|null $modelType = null)
`method` Cake\\Controller\\Controller::**fetchModel**(?string $modelClass = null, ?string $modelType = null): object

The `fetchModel()` method is useful to load non ORM models or ORM tables that
are not the controller's default:
Expand Down
16 changes: 8 additions & 8 deletions docs/en/controllers/request-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ public function sendIcs()

### Setting Headers

`method` Cake\\Http\\Response::**withHeader**($header, $value)
`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*
Expand Down Expand Up @@ -863,7 +863,7 @@ $response = $response->withType('application/json')
->withStringBody(json_encode(['Foo' => 'bar']));
```

`method` Cake\\Http\\Response::**withBody**($body)
`method` Cake\\Http\\Response::**withBody**(StreamInterface $body): static

To set the response body, use the `withBody()` method, which is provided by the
`Laminas\Diactoros\MessageTrait`:
Expand Down Expand Up @@ -1193,17 +1193,17 @@ criteria are met:

The `CorsBuilder` provides the following methods for configuring CORS:

`method` Cake\\Http\\CorsBuilder::**allowOrigin**(array|string $domains)
`method` Cake\\Http\\CorsBuilder::**allowOrigin**(array|string $domains): static

`method` Cake\\Http\\CorsBuilder::**allowMethods**(array $methods)
`method` Cake\\Http\\CorsBuilder::**allowMethods**(array $methods): static

`method` Cake\\Http\\CorsBuilder::**allowHeaders**(array $headers)
`method` Cake\\Http\\CorsBuilder::**allowHeaders**(array $headers): static

`method` Cake\\Http\\CorsBuilder::**allowCredentials**()
`method` Cake\\Http\\CorsBuilder::**allowCredentials**(): static

`method` Cake\\Http\\CorsBuilder::**exposeHeaders**(array $headers)
`method` Cake\\Http\\CorsBuilder::**exposeHeaders**(array $headers): static

`method` Cake\\Http\\CorsBuilder::**maxAge**(string|int $age)
`method` Cake\\Http\\CorsBuilder::**maxAge**(string|int $age): static

`method` Cake\\Http\\CorsBuilder::**build**(): ResponseInterface

Expand Down
2 changes: 1 addition & 1 deletion docs/en/core-libraries/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The App class is responsible for resource location and path management.

### App::className()

`static` Cake\\Core\\App::**className**($name, $type = '', $suffix = ''): string|null
`static` Cake\\Core\\App::**className**(string $class, string $type = '', string $suffix = ''): ?string

This method is used to resolve class names throughout CakePHP. It resolves
the short form names CakePHP uses and returns the fully resolved class name:
Expand Down
Loading