Skip to content

Commit 7565926

Browse files
committed
[#15270] Minor fixes
1 parent fb749b5 commit 7565926

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.doctor-rst.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,4 @@ whitelist:
103103
- '.. code-block:: twig'
104104
- '.. versionadded:: 3.6' # MonologBundle
105105
- 'End to End Tests (E2E)'
106+
- '.. code-block:: php'

components/console/helpers/cursor.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Cursor Helper
66

77
.. versionadded:: 5.1
88

9-
The :class:`Symfony\\Component\\Console\\Cursor`
10-
class was introduced in Symfony 5.1.
9+
The :class:`Symfony\\Component\\Console\\Cursor` class was introduced
10+
in Symfony 5.1.
1111

1212
The :class:`Symfony\\Component\\Console\\Cursor` allows you to change the
1313
cursor position in a console command. This allows you to write on any position
@@ -16,10 +16,11 @@ of the output:
1616
.. image:: /_images/components/console/cursor.gif
1717
:align: center
1818

19-
2019
.. code-block:: php
2120
22-
// src/Commande/MyCommand.php
21+
// src/Command/MyCommand.php
22+
namespace App\Command;
23+
2324
use Symfony\Component\Console\Command\Command;
2425
use Symfony\Component\Console\Cursor;
2526
use Symfony\Component\Console\Input\InputInterface;
@@ -29,13 +30,14 @@ of the output:
2930
{
3031
// ...
3132
32-
public function execute(InputInterface $input, OutputInterface $output)
33+
public function execute(InputInterface $input, OutputInterface $output): int
3334
{
3435
// ...
3536
3637
$cursor = new Cursor($output);
3738
38-
// moves the cursor to a specific column and row position
39+
// moves the cursor to a specific column (1st argument) and
40+
// row (2nd argument) position
3941
$cursor->moveToPosition(7, 11);
4042
4143
// and write text on this position using the output
@@ -71,7 +73,8 @@ There are fews methods to control moving the command cursor::
7173
// same for left
7274
$cursor->moveLeft();
7375

74-
// move the cursor to a specific position from its current position
76+
// move the cursor to a specific (column, row) position from the
77+
// top-left position of the terminal
7578
$cursor->moveToPosition(7, 11);
7679

7780
You can get the current command's cursor position by using::

0 commit comments

Comments
 (0)