10000 Add missing `@return $this` annotations · symfony/symfony@cd81aec · GitHub
[go: up one dir, main page]

Skip to content

Commit cd81aec

Browse files
Add missing @return $this annotations
1 parent 8f081fe commit cd81aec

File tree

64 files changed

+606
-9
lines changed

Some content is hidden

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

64 files changed

+606
-9
lines changed

src/Symfony/Bridge/Twig/Mime/NotificationEmail.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ public static function asPublicEmail(Headers $headers = null, AbstractPart $body
6969
return $email;
7070
}
7171

72+
/**
73+
* @return $this
74+
*/
7275
public function markAsPublic(): self
7376
{
7477
$this->context['importance'] = null;

src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ public function enableReboot()
111111

112112
/**
113113
* @param UserInterface $user
114+
*
115+
* @return $this
114116
*/
115117
public function loginUser(object $user, string $firewallContext = 'main'): self
116118
{

src/Symfony/Component/Config/Loader/Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function import($resource, string $type = null)
6363
* @param mixed $resource A resource
6464
* @param string|null $type The resource type or null if unknown
6565
*
66-
* @return $this|LoaderInterface
66+
* @return LoaderInterface
6767
*
6868
* @throws LoaderLoadException If no loader is found
6969
*/

src/Symfony/Component/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ private function findAlternatives(string $name, iterable $collection): array
11431143
/**
11441144
* Sets the default Command name.
11451145
*
1146-
* @return self
1146+
* @return $this
11471147
*/
11481148
public function setDefaultCommand(string $commandName, bool $isSingleCommand = false)
11491149
{

src/Symfony/Component/Console/Cursor.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,69 +30,99 @@ public function __construct(OutputInterface $output, $input = null)
3030
$this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+'));
3131
}
3232

33+
/**
34+
* @return $this
35+
*/
3336
public function moveUp(int $lines = 1): self
3437
{
3538
$this->output->write(sprintf("\x1b[%dA", $lines));
3639

3740
return $this;
3841
}
3942

43+
/**
44+
* @return $this
45+
*/
4046
public function moveDown(int $lines = 1): self
4147
{
4248
$this->output->write(sprintf("\x1b[%dB", $lines));
4349

4450
return $this;
4551
}
4652

53+
/**
54+
* @return $this
55+
*/
4756
public function moveRight(int $columns = 1): self
4857
{
4958
$this->output->write(sprintf("\x1b[%dC", $columns));
5059

5160
return $this;
5261
}
5362

63+
/**
64+
* @return $this
65+
*/
5466
public function moveLeft(int $columns = 1): self
5567
{
5668
$this->output->write(sprintf("\x1b[%dD", $columns));
5769

5870
return $this;
5971
}
6072

73+
/**
74+
* @return $this
75+
*/
6176
public function moveToColumn(int $column): self
6277
{
6378
$this->output->write(sprintf("\x1b[%dG", $column));
6479

6580
return $this;
6681
}
6782

83+
/**
84+
* @return $this
85+
*/
6886
public function moveToPosition(int $column, int $row): self
6987
{
7088
$this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column));
7189

7290
return $this;
7391
}
7492

93+
/**
94+
* @return $this
95+
*/
7596
public function savePosition(): self
7697
{
7798
$this->output->write("\x1b7");
7899

79100
return $this;
80101
}
81102

103+
/**
104+
* @return $this
105+
*/
82106
public function restorePosition(): self
83107
{
84108
$this->output->write("\x1b8");
85109

86110
return $this;
87111
}
88112

113+
/**
114+
* @return $this
115+
*/
89116
public function hide(): self
90117
{
91118
$this->output->write("\x1b[?25l");
92119

93120
return $this;
94121
}
95122

123+
/**
124+
* @return $this
125+
*/
96126
public function show(): self
97127
{
98128
$this->output->write("\x1b[?25h\x1b[?0c");
@@ -102,6 +132,8 @@ public function show(): self
102132

103133
/**
104134
* Clears all the output from the current line.
135+
*
136+
* @return $this
105137
*/
106138
public function clearLine(): self
107139
{
@@ -122,6 +154,8 @@ public function clearLineAfter(): self
122154

123155
/**
124156
* Clears all the output from the cursors' current position to the end of the screen.
157+
*
158+
* @return $this
125159
*/
126160
public function clearOutput(): self
127161
{
@@ -132,6 +166,8 @@ public function clearOutput(): self
132166

133167
/**
134168
* Clears the entire screen.
169+
*
170+
* @return $this
135171
*/
136172
public function clearScreen(): self
137173
{

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ public function setColumnMaxWidth(int $columnIndex, int $width): self
229229
return $this;
230230
}
231231

232+
/**
233+
* @return $this
234+
*/
232235
public function setHeaders(array $headers)
233236
{
234237
$headers = array_values($headers);
@@ -248,6 +251,9 @@ public function setRows(array $rows)
248251
return $this->addRows($rows);
249252
}
250253

254+
/**
255+
* @return $this
256+
*/
251257
public function addRows(array $rows)
252258
{
253259
foreach ($rows as $row) {
@@ -257,6 +263,9 @@ public function addRows(array $rows)
257263
return $this;
258264
}
259265

266+
/**
267+
* @return $this
268+
*/
260269
public function addRow($row)
261270
{
262271
if ($row instanceof TableSeparator) {
@@ -276,6 +285,8 @@ public function addRow($row)
276285

277286
/**
278287
* Adds a row to the table, and re-renders the table.
288+
*
289+
* @return $this
279290
*/
280291
public function appendRow($row): self
281292
{
@@ -293,27 +304,39 @@ public function appendRow($row): self
293304
return $this;
294305
}
295306

307+
/**
308+
* @return $this
309+
*/
296310
public function setRow($column, array $row)
297311
{
298312
$this->rows[$column] = $row;
299313

300314
return $this;
301315
}
302316

317+
/**
318+
* @return $this
319+
*/
303320
public function setHeaderTitle(?string $title): self
304321
{
305322
$this->headerTitle = $title;
306323

307324
return $this;
308325
}
309326

327+
/**
328+
* @return $this
329+
*/
310330
public function setFooterTitle(?string $title): self
311331
{
312332
$this->footerTitle = $title;
313333

314334
return $this;
315335
}
316336

337+
/**
338+
* @return $this
339+
*/
317340
public function setHorizontal(bool $horizontal = true): self
318341
{
319342
$this->horizontal = $horizontal;

src/Symfony/Component/Console/Helper/TableStyle.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public function getPaddingChar()
8787
* ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║
8888
* ╚═══════════════╧══════════════════════════╧══════════════════╝
8989
* </code>
90+
*
91+
* @return $this
9092
*/
9193
public function setHorizontalBorderChars(string $outside, string $inside = null): self
9294
{
@@ -110,6 +112,8 @@ public function setHorizontalBorderChars(string $outside, string $inside = null)
110112
* ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║
111113
* ╚═══════════════╧══════════════════════════╧══════════════════╝
112114
* </code>
115+
*
116+
* @return $this
113117
*/
114118
public function setVerticalBorderChars(string $outside, string $inside = null): self
115119
{
@@ -162,6 +166,8 @@ public function getBorderChars(): array
162166
* @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null
163167
* @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null
164168
* @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null
169+
*
170+
* @return $this
165171
*/
166172
public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): self
167173
{
@@ -343,6 +349,9 @@ public function getHeaderTitleFormat(): string
343349
return $this->headerTitleFormat;
344350
}
345351

352+
/**
353+
* @return $this
354+
*/
346355
public function setHeaderTitleFormat(string $format): self
347356
{
348357
$this->headerTitleFormat = $format;
@@ -355,6 +364,9 @@ public function getFooterTitleFormat(): string
355364
return $this->footerTitleFormat;
356365
}
357366

367+
/**
368+
* @return $this
369+
*/
358370
public function setFooterTitleFormat(string $format): self
359371
{
360372
$this->footerTitleFormat = $format;

src/Symfony/Component/Console/SingleCommandApplication.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class SingleCommandApplication extends Command
2424
private $autoExit = true;
2525
private $running = false;
2626

27+
/**
28+
* @return $this
29+
*/
2730
public function setVersion(string $version): self
2831
{
2932
$this->version = $version;
@@ -33,6 +36,8 @@ public function setVersion(string $version): self
3336

3437
/**
3538
* @final
39+
*
40+
* @return $this
3641
*/
3742
public function setAutoExit(bool $autoExit): self
3843
{

src/Symfony/Component/CssSelector/XPath/XPathExpr.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public function getElement(): string
4343
return $this->element;
4444
}
4545

46+
/**
47+
* @return $this
48+
*/
4649
public function addCondition(string $condition): self
4750
{
4851
$this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition;
@@ -55,6 +58,9 @@ public function getCondition(): string
5558
return $this->condition;
5659
}
5760

61+
/**
62+
* @return $this
63+
*/
5864
public function addNameTest(): self
5965
{
6066
if ('*' !== $this->element) {
@@ -65,6 +71,9 @@ public function addNameTest(): self
6571
return $this;
6672
}
6773

74+
/**
75+
* @return $this
76+
*/
6877
public function addStarPrefix(): self
6978
{
7079
$this->path .= '*/';

src/Symfony/Component/DependencyInjection/Loader/Configurator/ServicesConfigurator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ final public function set(?string $id, string $class = null): ServiceConfigurato
9898

9999
/**
100100
* Removes an already defined service definition or alias.
101+
*
102+
* @return $this
101103
*/
102104
final public function remove(string $id): self
103105
{

src/Symfony/Component/DomCrawler/Field/ChoiceFormField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public function availableOptionValues()
310310
*
311311
* @internal since Symfony 5.3
312312
*
313-
* @return self
313+
* @return $this
314314
*/
315315
public function disableValidation()
316316
{

src/Symfony/Component/DomCrawler/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public function offsetUnset($name)
368368
/**
369369
* Disables validation.
370370
*
371-
* @return self
371+
* @return $this
372372
*/
373373
public function disableValidation()
374374
{

src/Symfony/Component/ErrorHandler/Exception/FlattenException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ public function getStatusText(): string
205205
return $this->statusText;
206206
}
207207

208+
/**
209+
* @return $this
210+
*/
208211
public function setStatusText(string $statusText): self
209212
{
210213
$this->statusText = $statusText;

src/Symfony/Component/ExpressionLanguage/Compiler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public function getSource()
4343
return $this->source;
4444
}
4545

46+
/**
47+
* @return $this
48+
*/
4649
public function reset()
4750
{
4851
$this->source = '';

src/Symfony/Component/Form/ClearableErrorsInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ interface ClearableErrorsInterface
2222
* Removes all the errors of this form.
2323
*
2424
* @param bool $deep Whether to remove errors from child forms as well
25+
*
26+
* @return $this
2527
*/
2628
public function clearErrors(bool $deep = false);
2729
}

0 commit comments

Comments
 (0)
0