Skip to content

Commit 609351c

Browse files
minor #50137 [BrowserKit][Cache][Config][Console] Add missing return types (wouterj)
This PR was merged into the 6.3 branch. Discussion ---------- [BrowserKit][Cache][Config][Console] Add missing return types | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Ref symfony/symfony#47551 | License | MIT | Doc PR | - Commits ------- f0b9511474 Add missing return types
2 parents 614616d + f201d28 commit 609351c

File tree

6 files changed

+25
-6
lines changed

6 files changed

+25
-6
lines changed

Command/LockableTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private function lock(string $name = null, bool $blocking = false): bool
5858
/**
5959
* Releases the command lock if there is one.
6060
*/
61-
private function release()
61+
private function release(): void
6262
{
6363
if ($this->lock) {
6464
$this->lock->release();

Formatter/OutputFormatter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ public function format(?string $message): ?string
121121
return $this->formatAndWrap($message, 0);
122122
}
123123

124+
/**
125+
* @return string
126+
*/
124127
public function formatAndWrap(?string $message, int $width)
125128
{
126129
if (null === $message) {

Helper/Helper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ public static function substr(?string $string, int $from, int $length = null): s
9191
return mb_substr($string, $from, $length, $encoding);
9292
}
9393

94+
/**
95+
* @return string
96+
*/
9497
public static function formatTime(int|float $secs)
9598
{
9699
static $timeFormats = [

Helper/Table.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public function __construct(OutputInterface $output)
6666

6767
/**
6868
* Sets a style definition.
69+
*
70+
* @return void
6971
*/
7072
public static function setStyleDefinition(string $name, TableStyle $style)
7173
{
@@ -310,6 +312,8 @@ public function setVertical(bool $vertical = true): static
310312
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
311313
* | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
312314
* +---------------+-----------------------+------------------+
315+
*
316+
* @return void
313317
*/
314318
public function render()
315319
{
@@ -450,7 +454,7 @@ public function render()
450454
*
451455
* +-----+-----------+-------+
452456
*/
453-
private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null)
457+
private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null): void
454458
{
455459
if (!$count = $this->numberOfColumns) {
456460
return;
@@ -515,7 +519,7 @@ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string
515519
*
516520
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
517521
*/
518-
private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null)
522+
private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null): void
519523
{
520524
$rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
521525
$columns = $this->getRowColumns($row);
@@ -588,7 +592,7 @@ private function renderCell(array $row, int $column, string $cellFormat): string
588592
/**
589593
* Calculate number of columns for this table.
590594
*/
591-
private function calculateNumberOfColumns(array $rows)
595+
private function calculateNumberOfColumns(array $rows): void
592596
{
593597
$columns = [0];
594598
foreach ($rows as $row) {
@@ -789,7 +793,7 @@ private function getRowColumns(array $row): array
789793
/**
790794
* Calculates columns widths.
791795
*/
792-
private function calculateColumnsWidth(iterable $groups)
796+
private function calculateColumnsWidth(iterable $groups): void
793797
{
794798
for ($column = 0; $column < $this->numberOfColumns; ++$column) {
795799
$lengths = [];
@@ -843,7 +847,7 @@ private function getCellWidth(array $row, int $column): int
843847
/**
844848
* Called after rendering to cleanup cache data.
845849
*/
846-
private function cleanup()
850+
private function cleanup(): void
847851
{
848852
$this->effectiveColumnWidths = [];
849853
unset($this->numberOfColumns);

Input/Input.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public function bind(InputDefinition $definition)
5757

5858
/**
5959
* Processes command line arguments.
60+
*
61+
* @return void
6062
*/
6163
abstract protected function parse();
6264

@@ -171,13 +173,18 @@ public function escapeToken(string $token): string
171173
}
172174

173175
/**
176+
* @param resource $stream
177+
*
174178
* @return void
175179
*/
176180
public function setStream($stream)
177181
{
178182
$this->stream = $stream;
179183
}
180184

185+
/**
186+
* @return resource
187+
*/
181188
public function getStream()
182189
{
183190
return $this->stream;

Output/Output.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ public function write(string|iterable $messages, bool $newline = false, int $opt
148148

149149
/**
150150
* Writes a message to the output.
151+
*
152+
* @return void
151153
*/
152154
abstract protected function doWrite(string $message, bool $newline);
153155
}

0 commit comments

Comments
 (0)