File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -412,6 +412,38 @@ Result Methods
412412 'Consectetur adipiscing elit',
413413 ]);
414414
415+ Configuring the Default Styles
416+ ------------------------------
417+
418+ By default, Symfony Styles wrap all contents to avoid having lines of text that
419+ are too long. The only exception is URLs, which are not wrapped, no matter how
420+ long they are. This is done to enable clickable URLs in terminals that support them.
421+
422+ If you prefer to wrap all contents, including URLs, use this method::
423+
424+ // src/Command/GreetCommand.php
425+ namespace App\Command;
426+
427+ // ...
428+ use Symfony\Component\Console\Style\SymfonyStyle;
429+
430+ class GreetCommand extends Command
431+ {
432+ // ...
433+
434+ protected function execute(InputInterface $input, OutputInterface $output): int
435+ {
436+ $io = new SymfonyStyle($input, $output);
437+ $io->getOutputWrapper()->setAllowCutUrls(true);
438+
439+ // ...
440+ }
441+ }
442+
443+ .. versionadded :: 6.2
444+
445+ The ``setAllowCutUrls() `` method was introduced in Symfony 6.2.
446+
415447Defining your Own Styles
416448------------------------
417449
You can’t perform that action at this time.
0 commit comments