Skip to content

Commit e4ad988

Browse files
Add missing @return $this annotations
1 parent 349cd1e commit e4ad988

File tree

5 files changed

+77
-1
lines changed

5 files changed

+77
-1
lines changed

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
{

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
{

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;

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;

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
{

0 commit comments

Comments
 (0)