From 29daeadfc0f03ee817a2ceb05258f197ca06fe07 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Mon, 23 May 2022 15:50:27 +0300 Subject: [PATCH 1/2] Add method chaining style specification --- spec.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec.md b/spec.md index 66dbad4..9b68c10 100644 --- a/spec.md +++ b/spec.md @@ -649,6 +649,16 @@ $app->get('/hello/{name}', function ($name) use ($app) { }); ``` +Method chaining SHOULD be put on separate lines, where each subsequent line is indented once. When doing so, the first +method MUST be on the next line. + +```php +$someInstance + ->create() + ->prepare() + ->run(); +``` + ## 5. Control Structures The general style rules for control structures are as follows: From 8d68bb4024802e9649945e464c80ac51185c8c65 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sun, 17 Jul 2022 23:25:24 +0300 Subject: [PATCH 2/2] Update spec.md --- spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.md b/spec.md index 9b68c10..1b15d03 100644 --- a/spec.md +++ b/spec.md @@ -649,7 +649,7 @@ $app->get('/hello/{name}', function ($name) use ($app) { }); ``` -Method chaining SHOULD be put on separate lines, where each subsequent line is indented once. When doing so, the first +Method chaining MAY be put on separate lines, where each subsequent line is indented once. When doing so, the first method MUST be on the next line. ```php