Changeset 3372394
- Timestamp:
- 10/03/2025 01:48:47 PM (6 months ago)
- Location:
- wpos-lite-version/trunk/vendor/symfony
- Files:
-
- 30 edited
-
deprecation-contracts/composer.json (modified) (1 diff)
-
polyfill-mbstring/Mbstring.php (modified) (8 diffs)
-
polyfill-mbstring/bootstrap.php (modified) (1 diff)
-
polyfill-mbstring/composer.json (modified) (1 diff)
-
polyfill-php80/PhpToken.php (modified) (3 diffs)
-
polyfill-php80/composer.json (modified) (1 diff)
-
translation-contracts/Test/TranslatorTest.php (modified) (14 diffs)
-
translation-contracts/TranslatorTrait.php (modified) (3 diffs)
-
translation-contracts/composer.json (modified) (1 diff)
-
translation/Catalogue/AbstractOperation.php (modified) (4 diffs)
-
translation/Command/XliffLintCommand.php (modified) (8 diffs)
-
translation/DataCollectorTranslator.php (modified) (1 diff)
-
translation/DependencyInjection/TranslationExtractorPass.php (modified) (1 diff)
-
translation/Dumper/CsvFileDumper.php (modified) (1 diff)
-
translation/Dumper/FileDumper.php (modified) (1 diff)
-
translation/Dumper/PoFileDumper.php (modified) (2 diffs)
-
translation/Dumper/XliffFileDumper.php (modified) (2 diffs)
-
translation/Extractor/AbstractFileExtractor.php (modified) (1 diff)
-
translation/Extractor/PhpExtractor.php (modified) (1 diff)
-
translation/Loader/CsvFileLoader.php (modified) (3 diffs)
-
translation/Loader/FileLoader.php (modified) (2 diffs)
-
translation/Loader/IcuDatFileLoader.php (modified) (2 diffs)
-
translation/Loader/IcuResFileLoader.php (modified) (2 diffs)
-
translation/Loader/QtFileLoader.php (modified) (2 diffs)
-
translation/Loader/XliffFileLoader.php (modified) (4 diffs)
-
translation/Loader/YamlFileLoader.php (modified) (2 diffs)
-
translation/LoggingTranslator.php (modified) (2 diffs)
-
translation/MessageCatalogue.php (modified) (4 diffs)
-
translation/Translator.php (modified) (4 diffs)
-
translation/Writer/TranslationWriter.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpos-lite-version/trunk/vendor/symfony/deprecation-contracts/composer.json
r3372384 r3372394 26 26 "extra": { 27 27 "branch-alias": { 28 "dev-main": "3. 4-dev"28 "dev-main": "3.6-dev" 29 29 }, 30 30 "thanks": { -
wpos-lite-version/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php
r3372171 r3372394 49 49 * - mb_strwidth - Return width of string 50 50 * - mb_substr_count - Count the number of substring occurrences 51 * - mb_ucfirst - Make a string's first character uppercase 52 * - mb_lcfirst - Make a string's first character lowercase 53 * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string 54 * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string 55 * - mb_rtrim - Strip whitespace (or other characters) from the end of a string 51 56 * 52 57 * Not implemented: … … 81 86 public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) 82 87 { 88 if (\is_array($s)) { 89 $r = []; 90 foreach ($s as $str) { 91 $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); 92 } 93 94 return $r; 95 } 96 83 97 if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { 84 98 $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); … … 411 425 public static function mb_check_encoding($var = null, $encoding = null) 412 426 { 413 if (PHP_VERSION_ID < 70200 && \is_array($var)) {414 trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING);415 416 return null;417 }418 419 427 if (null === $encoding) { 420 428 if (null === $var) { … … 438 446 439 447 return true; 440 441 448 } 442 449 … … 828 835 } 829 836 830 public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string837 public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string 831 838 { 832 839 if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { … … 836 843 if (null === $encoding) { 837 844 $encoding = self::mb_internal_encoding(); 838 } 839 840 try { 841 $validEncoding = @self::mb_check_encoding('', $encoding); 842 } catch (\ValueError $e) { 843 throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); 844 } 845 846 // BC for PHP 7.3 and lower 847 if (!$validEncoding) { 848 throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); 845 } else { 846 self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); 849 847 } 850 848 … … 872 870 } 873 871 872 public static function mb_ucfirst(string $string, ?string $encoding = null): string 873 { 874 if (null === $encoding) { 875 $encoding = self::mb_internal_encoding(); 876 } else { 877 self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); 878 } 879 880 $firstChar = mb_substr($string, 0, 1, $encoding); 881 $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); 882 883 return $firstChar.mb_substr($string, 1, null, $encoding); 884 } 885 886 public static function mb_lcfirst(string $string, ?string $encoding = null): string 887 { 888 if (null === $encoding) { 889 $encoding = self::mb_internal_encoding(); 890 } else { 891 self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); 892 } 893 894 $firstChar = mb_substr($string, 0, 1, $encoding); 895 $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); 896 897 return $firstChar.mb_substr($string, 1, null, $encoding); 898 } 899 874 900 private static function getSubpart($pos, $part, $haystack, $encoding) 875 901 { … … 945 971 return $encoding; 946 972 } 973 974 public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string 975 { 976 return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); 977 } 978 979 public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string 980 { 981 return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); 982 } 983 984 public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string 985 { 986 return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__); 987 } 988 989 private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string 990 { 991 if (null === $encoding) { 992 $encoding = self::mb_internal_encoding(); 993 } else { 994 self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given'); 995 } 996 997 if ('' === $characters) { 998 return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); 999 } 1000 1001 if ('UTF-8' === $encoding) { 1002 $encoding = null; 1003 if (!preg_match('//u', $string)) { 1004 $string = @iconv('UTF-8', 'UTF-8//IGNORE', $string); 1005 } 1006 if (null !== $characters && !preg_match('//u', $characters)) { 1007 $characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters); 1008 } 1009 } else { 1010 $string = iconv($encoding, 'UTF-8//IGNORE', $string); 1011 1012 if (null !== $characters) { 1013 $characters = iconv($encoding, 'UTF-8//IGNORE', $characters); 1014 } 1015 } 1016 1017 if (null === $characters) { 1018 $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; 1019 } else { 1020 $characters = preg_quote($characters); 1021 } 1022 1023 $string = preg_replace(sprintf($regex, $characters), '', $string); 1024 1025 if (null === $encoding) { 1026 return $string; 1027 } 1028 1029 return iconv('UTF-8', $encoding.'//IGNORE', $string); 1030 } 1031 1032 private static function assertEncoding(string $encoding, string $errorFormat): void 1033 { 1034 try { 1035 $validEncoding = @self::mb_check_encoding('', $encoding); 1036 } catch (\ValueError $e) { 1037 throw new \ValueError(sprintf($errorFormat, $encoding)); 1038 } 1039 1040 // BC for PHP 7.3 and lower 1041 if (!$validEncoding) { 1042 throw new \ValueError(sprintf($errorFormat, $encoding)); 1043 } 1044 } 947 1045 } -
wpos-lite-version/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php
r3372171 r3372394 137 137 } 138 138 139 if (!function_exists('mb_ucfirst')) { 140 function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } 141 } 142 143 if (!function_exists('mb_lcfirst')) { 144 function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } 145 } 146 147 if (!function_exists('mb_trim')) { 148 function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } 149 } 150 151 if (!function_exists('mb_ltrim')) { 152 function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } 153 } 154 155 if (!function_exists('mb_rtrim')) { 156 function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } 157 } 158 159 139 160 if (extension_loaded('mbstring')) { 140 161 return; -
wpos-lite-version/trunk/vendor/symfony/polyfill-mbstring/composer.json
r3372171 r3372394 17 17 ], 18 18 "require": { 19 "php": ">=7.1" 19 "php": ">=7.2", 20 "ext-iconv": "*" 20 21 }, 21 22 "provide": { -
wpos-lite-version/trunk/vendor/symfony/polyfill-php80/PhpToken.php
r3372384 r3372394 30 30 31 31 /** 32 * @var int32 * @var -1|positive-int 33 33 */ 34 34 public $line; … … 39 39 public $pos; 40 40 41 /** 42 * @param -1|positive-int $line 43 */ 41 44 public function __construct(int $id, string $text, int $line = -1, int $position = -1) 42 45 { … … 81 84 82 85 /** 83 * @return static[]86 * @return list<static> 84 87 */ 85 88 public static function tokenize(string $code, int $flags = 0): array -
wpos-lite-version/trunk/vendor/symfony/polyfill-php80/composer.json
r3372384 r3372394 21 21 ], 22 22 "require": { 23 "php": ">=7. 1"23 "php": ">=7.2" 24 24 }, 25 25 "autoload": { -
wpos-lite-version/trunk/vendor/symfony/translation-contracts/Test/TranslatorTest.php
r3372384 r3372394 12 12 namespace Symfony\Contracts\Translation\Test; 13 13 14 use PHPUnit\Framework\Attributes\DataProvider; 15 use PHPUnit\Framework\Attributes\RequiresPhpExtension; 14 16 use PHPUnit\Framework\TestCase; 15 17 use Symfony\Contracts\Translation\TranslatorInterface; … … 46 48 public function getTranslator(): TranslatorInterface 47 49 { 48 return new class ()implements TranslatorInterface {50 return new class implements TranslatorInterface { 49 51 use TranslatorTrait; 50 52 }; … … 54 56 * @dataProvider getTransTests 55 57 */ 58 #[DataProvider('getTransTests')] 56 59 public function testTrans($expected, $id, $parameters) 57 60 { … … 64 67 * @dataProvider getTransChoiceTests 65 68 */ 69 #[DataProvider('getTransChoiceTests')] 66 70 public function testTransChoiceWithExplicitLocale($expected, $id, $number) 67 71 { … … 76 80 * @dataProvider getTransChoiceTests 77 81 */ 82 #[DataProvider('getTransChoiceTests')] 83 #[RequiresPhpExtension('intl')] 78 84 public function testTransChoiceWithDefaultLocale($expected, $id, $number) 79 85 { … … 86 92 * @dataProvider getTransChoiceTests 87 93 */ 94 #[DataProvider('getTransChoiceTests')] 88 95 public function testTransChoiceWithEnUsPosix($expected, $id, $number) 89 96 { … … 104 111 * @requires extension intl 105 112 */ 113 #[RequiresPhpExtension('intl')] 106 114 public function testGetLocaleReturnsDefaultLocaleIfNotSet() 107 115 { … … 140 148 * @dataProvider getInterval 141 149 */ 150 #[DataProvider('getInterval')] 142 151 public function testInterval($expected, $number, $interval) 143 152 { … … 165 174 * @dataProvider getChooseTests 166 175 */ 176 #[DataProvider('getChooseTests')] 167 177 public function testChoose($expected, $id, $number, $locale = null) 168 178 { … … 182 192 * @dataProvider getNonMatchingMessages 183 193 */ 194 #[DataProvider('getNonMatchingMessages')] 184 195 public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) 185 196 { 197 $translator = $this->getTranslator(); 198 186 199 $this->expectException(\InvalidArgumentException::class); 187 $translator = $this->getTranslator();188 200 189 201 $translator->trans($id, ['%count%' => $number]); … … 296 308 * @dataProvider failingLangcodes 297 309 */ 310 #[DataProvider('failingLangcodes')] 298 311 public function testFailedLangcodes($nplural, $langCodes) 299 312 { … … 305 318 * @dataProvider successLangcodes 306 319 */ 320 #[DataProvider('successLangcodes')] 307 321 public function testLangcodes($nplural, $langCodes) 308 322 { … … 359 373 $this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); 360 374 } else { 361 $this->assertNot Equals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms.");375 $this->assertNotCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); 362 376 } 363 377 } … … 366 380 protected function generateTestData($langCodes) 367 381 { 368 $translator = new class (){382 $translator = new class { 369 383 use TranslatorTrait { 370 384 getPluralizationRule as public; -
wpos-lite-version/trunk/vendor/symfony/translation-contracts/TranslatorTrait.php
r3372384 r3372394 112 112 } 113 113 114 $message = sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number);114 $message = \sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number); 115 115 116 116 if (class_exists(InvalidArgumentException::class)) { … … 131 131 * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) 132 132 */ 133 /* 134 private function _getPluralizationRule(float $number, string $locale): int 133 private function getPluralizationRule(float $number, string $locale): int 135 134 { 136 135 $number = abs($number); … … 224 223 }; 225 224 } 226 */227 private function getPluralizationRule(int $number, string $locale): int228 {229 switch ('pt_BR' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) {230 case 'af':231 case 'bn':232 case 'bg':233 case 'ca':234 case 'da':235 case 'de':236 case 'el':237 case 'en':238 case 'eo':239 case 'es':240 case 'et':241 case 'eu':242 case 'fa':243 case 'fi':244 case 'fo':245 case 'fur':246 case 'fy':247 case 'gl':248 case 'gu':249 case 'ha':250 case 'he':251 case 'hu':252 case 'is':253 case 'it':254 case 'ku':255 case 'lb':256 case 'ml':257 case 'mn':258 case 'mr':259 case 'nah':260 case 'nb':261 case 'ne':262 case 'nl':263 case 'nn':264 case 'no':265 case 'oc':266 case 'om':267 case 'or':268 case 'pa':269 case 'pap':270 case 'ps':271 case 'pt':272 case 'so':273 case 'sq':274 case 'sv':275 case 'sw':276 case 'ta':277 case 'te':278 case 'tk':279 case 'ur':280 case 'zu':281 return (1 == $number) ? 0 : 1;282 283 case 'am':284 case 'bh':285 case 'fil':286 case 'fr':287 case 'gun':288 case 'hi':289 case 'hy':290 case 'ln':291 case 'mg':292 case 'nso':293 case 'pt_BR':294 case 'ti':295 case 'wa':296 return ((0 == $number) || (1 == $number)) ? 0 : 1;297 298 case 'be':299 case 'bs':300 case 'hr':301 case 'ru':302 case 'sh':303 case 'sr':304 case 'uk':305 return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);306 307 case 'cs':308 case 'sk':309 return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2);310 311 case 'ga':312 return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2);313 314 case 'lt':315 return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);316 317 case 'sl':318 return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3));319 320 case 'mk':321 return (1 == $number % 10) ? 0 : 1;322 323 case 'mt':324 return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3));325 326 case 'lv':327 return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2);328 329 case 'pl':330 return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2);331 332 case 'cy':333 return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3));334 335 case 'ro':336 return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2);337 338 case 'ar':339 return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5))));340 341 default:342 return 0;343 }344 }345 225 } -
wpos-lite-version/trunk/vendor/symfony/translation-contracts/composer.json
r3372384 r3372394 28 28 "extra": { 29 29 "branch-alias": { 30 "dev-main": "3. 4-dev"30 "dev-main": "3.6-dev" 31 31 }, 32 32 "thanks": { -
wpos-lite-version/trunk/vendor/symfony/translation/Catalogue/AbstractOperation.php
r3372171 r3372394 98 98 { 99 99 if (!\in_array($domain, $this->getDomains())) { 100 throw new InvalidArgumentException( sprintf('Invalid domain: "%s".', $domain));100 throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain)); 101 101 } 102 102 … … 111 111 { 112 112 if (!\in_array($domain, $this->getDomains())) { 113 throw new InvalidArgumentException( sprintf('Invalid domain: "%s".', $domain));113 throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain)); 114 114 } 115 115 … … 124 124 { 125 125 if (!\in_array($domain, $this->getDomains())) { 126 throw new InvalidArgumentException( sprintf('Invalid domain: "%s".', $domain));126 throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain)); 127 127 } 128 128 … … 161 161 self::NEW_BATCH => $this->getNewMessages($domain), 162 162 self::ALL_BATCH => $this->getMessages($domain), 163 default => throw new \InvalidArgumentException( sprintf('$batch argument must be one of ["%s", "%s", "%s"].', self::ALL_BATCH, self::NEW_BATCH, self::OBSOLETE_BATCH)),163 default => throw new \InvalidArgumentException(\sprintf('$batch argument must be one of ["%s", "%s", "%s"].', self::ALL_BATCH, self::NEW_BATCH, self::OBSOLETE_BATCH)), 164 164 }; 165 165 -
wpos-lite-version/trunk/vendor/symfony/translation/Command/XliffLintCommand.php
r3372171 r3372394 58 58 $this 59 59 ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') 60 ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))60 ->addOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions()))) 61 61 ->setHelp(<<<EOF 62 62 The <info>%command.name%</info> command lints an XLIFF file and outputs to STDOUT … … 99 99 foreach ($filenames as $filename) { 100 100 if (!$this->isReadable($filename)) { 101 throw new RuntimeException( sprintf('File or directory "%s" is not readable.', $filename));101 throw new RuntimeException(\sprintf('File or directory "%s" is not readable.', $filename)); 102 102 } 103 103 … … 125 125 126 126 if (null !== $targetLanguage = $this->getTargetLanguageFromFile($document)) { 127 $normalizedLocalePattern = sprintf('(%s|%s)', preg_quote($targetLanguage, '/'), preg_quote(str_replace('-', '_', $targetLanguage), '/'));127 $normalizedLocalePattern = \sprintf('(%s|%s)', preg_quote($targetLanguage, '/'), preg_quote(str_replace('-', '_', $targetLanguage), '/')); 128 128 // strict file names require translation files to be named '____.locale.xlf' 129 129 // otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed 130 130 // also, the regexp matching must be case-insensitive, as defined for 'target-language' values 131 131 // http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#target-language 132 $expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.(?i:%s)\.(?:xlf|xliff)/', $normalizedLocalePattern) :sprintf('/^(?:.*\.(?i:%s)|(?i:%s)\..*)\.(?:xlf|xliff)/', $normalizedLocalePattern, $normalizedLocalePattern);132 $expectedFilenamePattern = $this->requireStrictFileNames ? \sprintf('/^.*\.(?i:%s)\.(?:xlf|xliff)/', $normalizedLocalePattern) : \sprintf('/^(?:.*\.(?i:%s)|(?i:%s)\..*)\.(?:xlf|xliff)/', $normalizedLocalePattern, $normalizedLocalePattern); 133 133 134 134 if (0 === preg_match($expectedFilenamePattern, basename($file))) { … … 136 136 'line' => -1, 137 137 'column' => -1, 138 'message' => sprintf('There is a mismatch between the language included in the file name ("%s") and the "%s" value used in the "target-language" attribute of the file.', basename($file), $targetLanguage),138 'message' => \sprintf('There is a mismatch between the language included in the file name ("%s") and the "%s" value used in the "target-language" attribute of the file.', basename($file), $targetLanguage), 139 139 ]; 140 140 } … … 161 161 'json' => $this->displayJson($io, $files), 162 162 'github' => $this->displayTxt($io, $files, true), 163 default => throw new InvalidArgumentException( sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),163 default => throw new InvalidArgumentException(\sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))), 164 164 }; 165 165 } … … 173 173 foreach ($filesInfo as $info) { 174 174 if ($info['valid'] && $this->displayCorrectFiles) { 175 $io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));175 $io->comment('<info>OK</info>'.($info['file'] ? \sprintf(' in %s', $info['file']) : '')); 176 176 } elseif (!$info['valid']) { 177 177 ++$erroredFiles; 178 $io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));178 $io->text('<error> ERROR </error>'.($info['file'] ? \sprintf(' in %s', $info['file']) : '')); 179 179 $io->listing(array_map(function ($error) use ($info, $githubReporter) { 180 180 // general document errors have a '-1' line number … … 183 183 $githubReporter?->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null); 184 184 185 return null === $line ? $error['message'] : sprintf('Line %d, Column %d: %s', $line, $error['column'], $error['message']);185 return null === $line ? $error['message'] : \sprintf('Line %d, Column %d: %s', $line, $error['column'], $error['message']); 186 186 }, $info['messages'])); 187 187 } … … 189 189 190 190 if (0 === $erroredFiles) { 191 $io->success( sprintf('All %d XLIFF files contain valid syntax.', $countFiles));191 $io->success(\sprintf('All %d XLIFF files contain valid syntax.', $countFiles)); 192 192 } else { 193 $io->warning( sprintf('%d XLIFF files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles));193 $io->warning(\sprintf('%d XLIFF files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles)); 194 194 } 195 195 -
wpos-lite-version/trunk/vendor/symfony/translation/DataCollectorTranslator.php
r3372171 r3372394 35 35 { 36 36 if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) { 37 throw new InvalidArgumentException( sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', get_debug_type($translator)));37 throw new InvalidArgumentException(\sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', get_debug_type($translator))); 38 38 } 39 39 -
wpos-lite-version/trunk/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php
r3372171 r3372394 35 35 foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) { 36 36 if (!isset($attributes[0]['alias'])) { 37 throw new RuntimeException( sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id));37 throw new RuntimeException(\sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id)); 38 38 } 39 39 -
wpos-lite-version/trunk/vendor/symfony/translation/Dumper/CsvFileDumper.php
r3372171 r3372394 29 29 30 30 foreach ($messages->all($domain) as $source => $target) { 31 fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure );31 fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure, '\\'); 32 32 } 33 33 -
wpos-lite-version/trunk/vendor/symfony/translation/Dumper/FileDumper.php
r3372171 r3372394 58 58 $directory = \dirname($fullpath); 59 59 if (!file_exists($directory) && !@mkdir($directory, 0777, true)) { 60 throw new RuntimeException( sprintf('Unable to create directory "%s".', $directory));60 throw new RuntimeException(\sprintf('Unable to create directory "%s".', $directory)); 61 61 } 62 62 } -
wpos-lite-version/trunk/vendor/symfony/translation/Dumper/PoFileDumper.php
r3372171 r3372394 52 52 $targetRules = $this->getStandardRules($target); 53 53 if (2 == \count($sourceRules) && [] !== $targetRules) { 54 $output .= sprintf('msgid "%s"'."\n", $this->escape($sourceRules[0]));55 $output .= sprintf('msgid_plural "%s"'."\n", $this->escape($sourceRules[1]));54 $output .= \sprintf('msgid "%s"'."\n", $this->escape($sourceRules[0])); 55 $output .= \sprintf('msgid_plural "%s"'."\n", $this->escape($sourceRules[1])); 56 56 foreach ($targetRules as $i => $targetRule) { 57 $output .= sprintf('msgstr[%d] "%s"'."\n", $i, $this->escape($targetRule));57 $output .= \sprintf('msgstr[%d] "%s"'."\n", $i, $this->escape($targetRule)); 58 58 } 59 59 } else { 60 $output .= sprintf('msgid "%s"'."\n", $this->escape($source));61 $output .= sprintf('msgstr "%s"'."\n", $this->escape($target));60 $output .= \sprintf('msgid "%s"'."\n", $this->escape($source)); 61 $output .= \sprintf('msgstr "%s"'."\n", $this->escape($target)); 62 62 } 63 63 } … … 124 124 125 125 foreach ((array) $comments as $comment) { 126 $output .= sprintf('#%s %s'."\n", $prefix, $comment);126 $output .= \sprintf('#%s %s'."\n", $prefix, $comment); 127 127 } 128 128 -
wpos-lite-version/trunk/vendor/symfony/translation/Dumper/XliffFileDumper.php
r3372171 r3372394 47 47 } 48 48 49 throw new InvalidArgumentException( sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion));49 throw new InvalidArgumentException(\sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion)); 50 50 } 51 51 … … 177 177 178 178 // Add notes section 179 if ($this->hasMetadataArrayInfo('notes', $metadata) ) {179 if ($this->hasMetadataArrayInfo('notes', $metadata) && $metadata['notes']) { 180 180 $notesElement = $dom->createElement('notes'); 181 181 foreach ($metadata['notes'] as $note) { -
wpos-lite-version/trunk/vendor/symfony/translation/Extractor/AbstractFileExtractor.php
r3372171 r3372394 50 50 { 51 51 if (!is_file($file)) { 52 throw new InvalidArgumentException( sprintf('The "%s" file does not exist.', $file));52 throw new InvalidArgumentException(\sprintf('The "%s" file does not exist.', $file)); 53 53 } 54 54 -
wpos-lite-version/trunk/vendor/symfony/translation/Extractor/PhpExtractor.php
r3372171 r3372394 324 324 { 325 325 if (!class_exists(Finder::class)) { 326 throw new \LogicException( sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class));326 throw new \LogicException(\sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); 327 327 } 328 328 -
wpos-lite-version/trunk/vendor/symfony/translation/Loader/CsvFileLoader.php
r3372171 r3372394 23 23 private string $delimiter = ';'; 24 24 private string $enclosure = '"'; 25 private string $escape = ' \\';25 private string $escape = ''; 26 26 27 27 protected function loadResource(string $resource): array … … 32 32 $file = new \SplFileObject($resource, 'rb'); 33 33 } catch (\RuntimeException $e) { 34 throw new NotFoundResourceException( sprintf('Error opening file "%s".', $resource), 0, $e);34 throw new NotFoundResourceException(\sprintf('Error opening file "%s".', $resource), 0, $e); 35 35 } 36 36 … … 56 56 * @return void 57 57 */ 58 public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = ' \\')58 public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '') 59 59 { 60 60 $this->delimiter = $delimiter; -
wpos-lite-version/trunk/vendor/symfony/translation/Loader/FileLoader.php
r3372171 r3372394 25 25 { 26 26 if (!stream_is_local($resource)) { 27 throw new InvalidResourceException( sprintf('This is not a local file "%s".', $resource));27 throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); 28 28 } 29 29 30 30 if (!file_exists($resource)) { 31 throw new NotFoundResourceException( sprintf('File "%s" not found.', $resource));31 throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); 32 32 } 33 33 … … 39 39 // not an array 40 40 if (!\is_array($messages)) { 41 throw new InvalidResourceException( sprintf('Unable to load file "%s".', $resource));41 throw new InvalidResourceException(\sprintf('Unable to load file "%s".', $resource)); 42 42 } 43 43 -
wpos-lite-version/trunk/vendor/symfony/translation/Loader/IcuDatFileLoader.php
r3372171 r3372394 27 27 { 28 28 if (!stream_is_local($resource.'.dat')) { 29 throw new InvalidResourceException( sprintf('This is not a local file "%s".', $resource));29 throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); 30 30 } 31 31 32 32 if (!file_exists($resource.'.dat')) { 33 throw new NotFoundResourceException( sprintf('File "%s" not found.', $resource));33 throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); 34 34 } 35 35 … … 41 41 42 42 if (!$rb) { 43 throw new InvalidResourceException( sprintf('Cannot load resource "%s".', $resource));43 throw new InvalidResourceException(\sprintf('Cannot load resource "%s".', $resource)); 44 44 } elseif (intl_is_failure($rb->getErrorCode())) { 45 45 throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); -
wpos-lite-version/trunk/vendor/symfony/translation/Loader/IcuResFileLoader.php
r3372171 r3372394 27 27 { 28 28 if (!stream_is_local($resource)) { 29 throw new InvalidResourceException( sprintf('This is not a local file "%s".', $resource));29 throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); 30 30 } 31 31 32 32 if (!is_dir($resource)) { 33 throw new NotFoundResourceException( sprintf('File "%s" not found.', $resource));33 throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); 34 34 } 35 35 … … 41 41 42 42 if (!$rb) { 43 throw new InvalidResourceException( sprintf('Cannot load resource "%s".', $resource));43 throw new InvalidResourceException(\sprintf('Cannot load resource "%s".', $resource)); 44 44 } elseif (intl_is_failure($rb->getErrorCode())) { 45 45 throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); -
wpos-lite-version/trunk/vendor/symfony/translation/Loader/QtFileLoader.php
r3372171 r3372394 33 33 34 34 if (!stream_is_local($resource)) { 35 throw new InvalidResourceException( sprintf('This is not a local file "%s".', $resource));35 throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); 36 36 } 37 37 38 38 if (!file_exists($resource)) { 39 throw new NotFoundResourceException( sprintf('File "%s" not found.', $resource));39 throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); 40 40 } 41 41 … … 43 43 $dom = XmlUtils::loadFile($resource); 44 44 } catch (\InvalidArgumentException $e) { 45 throw new InvalidResourceException( sprintf('Unable to load "%s".', $resource), $e->getCode(), $e);45 throw new InvalidResourceException(\sprintf('Unable to load "%s".', $resource), $e->getCode(), $e); 46 46 } 47 47 -
wpos-lite-version/trunk/vendor/symfony/translation/Loader/XliffFileLoader.php
r3372171 r3372394 37 37 if (!$this->isXmlString($resource)) { 38 38 if (!stream_is_local($resource)) { 39 throw new InvalidResourceException( sprintf('This is not a local file "%s".', $resource));39 throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); 40 40 } 41 41 42 42 if (!file_exists($resource)) { 43 throw new NotFoundResourceException( sprintf('File "%s" not found.', $resource));43 throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); 44 44 } 45 45 46 46 if (!is_file($resource)) { 47 throw new InvalidResourceException( sprintf('This is neither a file nor an XLIFF string "%s".', $resource));47 throw new InvalidResourceException(\sprintf('This is neither a file nor an XLIFF string "%s".', $resource)); 48 48 } 49 49 } … … 56 56 } 57 57 } catch (\InvalidArgumentException|XmlParsingException|InvalidXmlException $e) { 58 throw new InvalidResourceException( sprintf('Unable to load "%s": ', $resource).$e->getMessage(), $e->getCode(), $e);58 throw new InvalidResourceException(\sprintf('Unable to load "%s": ', $resource).$e->getMessage(), $e->getCode(), $e); 59 59 } 60 60 61 61 if ($errors = XliffUtils::validateSchema($dom)) { 62 throw new InvalidResourceException( sprintf('Invalid resource provided: "%s"; Errors: ', $resource).XliffUtils::getErrorsAsString($errors));62 throw new InvalidResourceException(\sprintf('Invalid resource provided: "%s"; Errors: ', $resource).XliffUtils::getErrorsAsString($errors)); 63 63 } 64 64 … … 113 113 } 114 114 115 if (isset($translation->target) && 'needs-translation' === (string) $translation->target->attributes()['state']) { 115 $source = (string) (isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source); 116 117 if (isset($translation->target) 118 && 'needs-translation' === (string) $translation->target->attributes()['state'] 119 && \in_array((string) $translation->target, [$source, (string) $translation->source], true) 120 ) { 116 121 continue; 117 122 } 118 123 119 $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;120 124 // If the xlf file has another encoding specified, try to convert it because 121 125 // simple_xml will always return utf-8 encoded values 122 126 $target = $this->utf8ToCharset((string) ($translation->target ?? $translation->source), $encoding); 123 127 124 $catalogue->set( (string)$source, $target, $domain);128 $catalogue->set($source, $target, $domain); 125 129 126 130 $metadata = [ … … 145 149 } 146 150 147 $catalogue->setMetadata( (string)$source, $metadata, $domain);151 $catalogue->setMetadata($source, $metadata, $domain); 148 152 } 149 153 } -
wpos-lite-version/trunk/vendor/symfony/translation/Loader/YamlFileLoader.php
r3372171 r3372394 30 30 { 31 31 if (!isset($this->yamlParser)) { 32 if (!class_exists( \Symfony\Component\Yaml\Parser::class)) {32 if (!class_exists(YamlParser::class)) { 33 33 throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.'); 34 34 } … … 40 40 $messages = $this->yamlParser->parseFile($resource, Yaml::PARSE_CONSTANT); 41 41 } catch (ParseException $e) { 42 throw new InvalidResourceException( sprintf('The file "%s" does not contain valid YAML: ', $resource).$e->getMessage(), 0, $e);42 throw new InvalidResourceException(\sprintf('The file "%s" does not contain valid YAML: ', $resource).$e->getMessage(), 0, $e); 43 43 } 44 44 45 45 if (null !== $messages && !\is_array($messages)) { 46 throw new InvalidResourceException( sprintf('Unable to load file "%s".', $resource));46 throw new InvalidResourceException(\sprintf('Unable to load file "%s".', $resource)); 47 47 } 48 48 -
wpos-lite-version/trunk/vendor/symfony/translation/LoggingTranslator.php
r3372171 r3372394 31 31 { 32 32 if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) { 33 throw new InvalidArgumentException( sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', get_debug_type($translator)));33 throw new InvalidArgumentException(\sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', get_debug_type($translator))); 34 34 } 35 35 … … 57 57 } 58 58 59 $this->logger->debug( sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale));59 $this->logger->debug(\sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale)); 60 60 } 61 61 -
wpos-lite-version/trunk/vendor/symfony/translation/MessageCatalogue.php
r3372171 r3372394 156 156 { 157 157 if ($catalogue->getLocale() !== $this->locale) { 158 throw new LogicException( sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s".', $catalogue->getLocale(), $this->locale));158 throw new LogicException(\sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s".', $catalogue->getLocale(), $this->locale)); 159 159 } 160 160 … … 191 191 while ($c = $c->getFallbackCatalogue()) { 192 192 if ($c->getLocale() === $this->getLocale()) { 193 throw new LogicException( sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale()));193 throw new LogicException(\sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); 194 194 } 195 195 } … … 198 198 do { 199 199 if ($c->getLocale() === $catalogue->getLocale()) { 200 throw new LogicException( sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale()));200 throw new LogicException(\sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); 201 201 } 202 202 … … 236 236 if ('' == $domain) { 237 237 return $this->metadata; 238 } 239 240 if (isset($this->metadata[$domain.self::INTL_DOMAIN_SUFFIX])) { 241 if ('' === $key) { 242 return $this->metadata[$domain.self::INTL_DOMAIN_SUFFIX]; 243 } 244 245 if (isset($this->metadata[$domain.self::INTL_DOMAIN_SUFFIX][$key])) { 246 return $this->metadata[$domain.self::INTL_DOMAIN_SUFFIX][$key]; 247 } 238 248 } 239 249 -
wpos-lite-version/trunk/vendor/symfony/translation/Translator.php
r3372171 r3372394 291 291 $fallbackContent = $this->getFallbackContent($this->catalogues[$locale]); 292 292 293 $content = sprintf(<<<EOF293 $content = \sprintf(<<<EOF 294 294 <?php 295 295 … … 322 322 $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current)); 323 323 324 $fallbackContent .= sprintf(<<<'EOF'324 $fallbackContent .= \sprintf(<<<'EOF' 325 325 $catalogue%s = new MessageCatalogue('%s', %s); 326 326 $catalogue%s->addFallbackCatalogue($catalogue%s); … … 357 357 if (!isset($this->loaders[$resource[0]])) { 358 358 if (\is_string($resource[1])) { 359 throw new RuntimeException( sprintf('No loader is registered for the "%s" format when loading the "%s" resource.', $resource[0], $resource[1]));359 throw new RuntimeException(\sprintf('No loader is registered for the "%s" format when loading the "%s" resource.', $resource[0], $resource[1])); 360 360 } 361 361 362 throw new RuntimeException( sprintf('No loader is registered for the "%s" format.', $resource[0]));362 throw new RuntimeException(\sprintf('No loader is registered for the "%s" format.', $resource[0])); 363 363 } 364 364 $this->catalogues[$locale]->addCatalogue($this->loaders[$resource[0]]->load($resource[1], $locale, $resource[2])); … … 439 439 { 440 440 if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { 441 throw new InvalidArgumentException( sprintf('Invalid "%s" locale.', $locale));441 throw new InvalidArgumentException(\sprintf('Invalid "%s" locale.', $locale)); 442 442 } 443 443 } -
wpos-lite-version/trunk/vendor/symfony/translation/Writer/TranslationWriter.php
r3372171 r3372394 60 60 { 61 61 if (!isset($this->dumpers[$format])) { 62 throw new InvalidArgumentException( sprintf('There is no dumper associated with format "%s".', $format));62 throw new InvalidArgumentException(\sprintf('There is no dumper associated with format "%s".', $format)); 63 63 } 64 64 … … 67 67 68 68 if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) { 69 throw new RuntimeException( sprintf('Translation Writer was not able to create directory "%s".', $options['path']));69 throw new RuntimeException(\sprintf('Translation Writer was not able to create directory "%s".', $options['path'])); 70 70 } 71 71
Note: See TracChangeset
for help on using the changeset viewer.