From 05e38eadbeb3de19e5b26003c2b401e00bb71df4 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 18 Oct 2026 00:08:23 +0200 Subject: =?UTF-8?q?sortie=20de=20vendor=20du=20d=C3=A9p=C3=B4t,=20oubli=20?= =?UTF-8?q?dans=20config-template.ini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/symfony/console/Helper/OutputWrapper.php | 76 ------------------------- 1 file changed, 76 deletions(-) delete mode 100644 vendor/symfony/console/Helper/OutputWrapper.php (limited to 'vendor/symfony/console/Helper/OutputWrapper.php') diff --git a/vendor/symfony/console/Helper/OutputWrapper.php b/vendor/symfony/console/Helper/OutputWrapper.php deleted file mode 100644 index 0ea2b70..0000000 --- a/vendor/symfony/console/Helper/OutputWrapper.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Simple output wrapper for "tagged outputs" instead of wordwrap(). This solution is based on a StackOverflow - * answer: https://stackoverflow.com/a/20434776/1476819 from user557597 (alias SLN). - * - * (?: - * # -- Words/Characters - * ( # (1 start) - * (?> # Atomic Group - Match words with valid breaks - * .{1,16} # 1-N characters - * # Followed by one of 4 prioritized, non-linebreak whitespace - * (?: # break types: - * (?<= [^\S\r\n] ) # 1. - Behind a non-linebreak whitespace - * [^\S\r\n]? # ( optionally accept an extra non-linebreak whitespace ) - * | (?= \r? \n ) # 2. - Ahead a linebreak - * | $ # 3. - EOS - * | [^\S\r\n] # 4. - Accept an extra non-linebreak whitespace - * ) - * ) # End atomic group - * | - * .{1,16} # No valid word breaks, just break on the N'th character - * ) # (1 end) - * (?: \r? \n )? # Optional linebreak after Words/Characters - * | - * # -- Or, Linebreak - * (?: \r? \n | $ ) # Stand alone linebreak or at EOS - * ) - * - * @author KrisztiƔn Ferenczi - * - * @see https://stackoverflow.com/a/20434776/1476819 - */ -final class OutputWrapper -{ - private const TAG_OPEN_REGEX_SEGMENT = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; - private const TAG_CLOSE_REGEX_SEGMENT = '[a-z][^<>]*+'; - private const URL_PATTERN = 'https?://\S+'; - - public function __construct( - private bool $allowCutUrls = false, - ) { - } - - public function wrap(string $text, int $width, string $break = "\n"): string - { - if (!$width) { - return $text; - } - - $tagPattern = sprintf('<(?:(?:%s)|/(?:%s)?)>', self::TAG_OPEN_REGEX_SEGMENT, self::TAG_CLOSE_REGEX_SEGMENT); - $limitPattern = "{1,$width}"; - $patternBlocks = [$tagPattern]; - if (!$this->allowCutUrls) { - $patternBlocks[] = self::URL_PATTERN; - } - $patternBlocks[] = '.'; - $blocks = implode('|', $patternBlocks); - $rowPattern = "(?:$blocks)$limitPattern"; - $pattern = sprintf('#(?:((?>(%1$s)((?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|(%1$s))(?:\r?\n)?|(?:\r?\n|$))#imux', $rowPattern); - $output = rtrim(preg_replace($pattern, '\\1'.$break, $text), $break); - - return str_replace(' '.$break, $break, $output); - } -} -- cgit v1.2.3