Plugin Directory

Changeset 3372394


Ignore:
Timestamp:
10/03/2025 01:48:47 PM (6 months ago)
Author:
openpos
Message:

update version 3.0

Location:
wpos-lite-version/trunk/vendor/symfony
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • wpos-lite-version/trunk/vendor/symfony/deprecation-contracts/composer.json

    r3372384 r3372394  
    2626    "extra": {
    2727        "branch-alias": {
    28             "dev-main": "3.4-dev"
     28            "dev-main": "3.6-dev"
    2929        },
    3030        "thanks": {
  • wpos-lite-version/trunk/vendor/symfony/polyfill-mbstring/Mbstring.php

    r3372171 r3372394  
    4949 * - mb_strwidth             - Return width of string
    5050 * - 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
    5156 *
    5257 * Not implemented:
     
    8186    public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
    8287    {
     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
    8397        if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) {
    8498            $fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
     
    411425    public static function mb_check_encoding($var = null, $encoding = null)
    412426    {
    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 
    419427        if (null === $encoding) {
    420428            if (null === $var) {
     
    438446
    439447        return true;
    440 
    441448    }
    442449
     
    828835    }
    829836
    830     public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string
     837    public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string
    831838    {
    832839        if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) {
     
    836843        if (null === $encoding) {
    837844            $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');
    849847        }
    850848
     
    872870    }
    873871
     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
    874900    private static function getSubpart($pos, $part, $haystack, $encoding)
    875901    {
     
    945971        return $encoding;
    946972    }
     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    }
    9471045}
  • wpos-lite-version/trunk/vendor/symfony/polyfill-mbstring/bootstrap.php

    r3372171 r3372394  
    137137}
    138138
     139if (!function_exists('mb_ucfirst')) {
     140    function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
     141}
     142
     143if (!function_exists('mb_lcfirst')) {
     144    function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
     145}
     146
     147if (!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
     151if (!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
     155if (!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
    139160if (extension_loaded('mbstring')) {
    140161    return;
  • wpos-lite-version/trunk/vendor/symfony/polyfill-mbstring/composer.json

    r3372171 r3372394  
    1717    ],
    1818    "require": {
    19         "php": ">=7.1"
     19        "php": ">=7.2",
     20        "ext-iconv": "*"
    2021    },
    2122    "provide": {
  • wpos-lite-version/trunk/vendor/symfony/polyfill-php80/PhpToken.php

    r3372384 r3372394  
    3030
    3131    /**
    32      * @var int
     32     * @var -1|positive-int
    3333     */
    3434    public $line;
     
    3939    public $pos;
    4040
     41    /**
     42     * @param -1|positive-int $line
     43     */
    4144    public function __construct(int $id, string $text, int $line = -1, int $position = -1)
    4245    {
     
    8184
    8285    /**
    83      * @return static[]
     86     * @return list<static>
    8487     */
    8588    public static function tokenize(string $code, int $flags = 0): array
  • wpos-lite-version/trunk/vendor/symfony/polyfill-php80/composer.json

    r3372384 r3372394  
    2121    ],
    2222    "require": {
    23         "php": ">=7.1"
     23        "php": ">=7.2"
    2424    },
    2525    "autoload": {
  • wpos-lite-version/trunk/vendor/symfony/translation-contracts/Test/TranslatorTest.php

    r3372384 r3372394  
    1212namespace Symfony\Contracts\Translation\Test;
    1313
     14use PHPUnit\Framework\Attributes\DataProvider;
     15use PHPUnit\Framework\Attributes\RequiresPhpExtension;
    1416use PHPUnit\Framework\TestCase;
    1517use Symfony\Contracts\Translation\TranslatorInterface;
     
    4648    public function getTranslator(): TranslatorInterface
    4749    {
    48         return new class() implements TranslatorInterface {
     50        return new class implements TranslatorInterface {
    4951            use TranslatorTrait;
    5052        };
     
    5456     * @dataProvider getTransTests
    5557     */
     58    #[DataProvider('getTransTests')]
    5659    public function testTrans($expected, $id, $parameters)
    5760    {
     
    6467     * @dataProvider getTransChoiceTests
    6568     */
     69    #[DataProvider('getTransChoiceTests')]
    6670    public function testTransChoiceWithExplicitLocale($expected, $id, $number)
    6771    {
     
    7680     * @dataProvider getTransChoiceTests
    7781     */
     82    #[DataProvider('getTransChoiceTests')]
     83    #[RequiresPhpExtension('intl')]
    7884    public function testTransChoiceWithDefaultLocale($expected, $id, $number)
    7985    {
     
    8692     * @dataProvider getTransChoiceTests
    8793     */
     94    #[DataProvider('getTransChoiceTests')]
    8895    public function testTransChoiceWithEnUsPosix($expected, $id, $number)
    8996    {
     
    104111     * @requires extension intl
    105112     */
     113    #[RequiresPhpExtension('intl')]
    106114    public function testGetLocaleReturnsDefaultLocaleIfNotSet()
    107115    {
     
    140148     * @dataProvider getInterval
    141149     */
     150    #[DataProvider('getInterval')]
    142151    public function testInterval($expected, $number, $interval)
    143152    {
     
    165174     * @dataProvider getChooseTests
    166175     */
     176    #[DataProvider('getChooseTests')]
    167177    public function testChoose($expected, $id, $number, $locale = null)
    168178    {
     
    182192     * @dataProvider getNonMatchingMessages
    183193     */
     194    #[DataProvider('getNonMatchingMessages')]
    184195    public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
    185196    {
     197        $translator = $this->getTranslator();
     198
    186199        $this->expectException(\InvalidArgumentException::class);
    187         $translator = $this->getTranslator();
    188200
    189201        $translator->trans($id, ['%count%' => $number]);
     
    296308     * @dataProvider failingLangcodes
    297309     */
     310    #[DataProvider('failingLangcodes')]
    298311    public function testFailedLangcodes($nplural, $langCodes)
    299312    {
     
    305318     * @dataProvider successLangcodes
    306319     */
     320    #[DataProvider('successLangcodes')]
    307321    public function testLangcodes($nplural, $langCodes)
    308322    {
     
    359373                $this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms.");
    360374            } else {
    361                 $this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms.");
     375                $this->assertNotCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms.");
    362376            }
    363377        }
     
    366380    protected function generateTestData($langCodes)
    367381    {
    368         $translator = new class() {
     382        $translator = new class {
    369383            use TranslatorTrait {
    370384                getPluralizationRule as public;
  • wpos-lite-version/trunk/vendor/symfony/translation-contracts/TranslatorTrait.php

    r3372384 r3372394  
    112112            }
    113113
    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);
    115115
    116116            if (class_exists(InvalidArgumentException::class)) {
     
    131131     * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    132132     */
    133     /*
    134     private function _getPluralizationRule(float $number, string $locale): int
     133    private function getPluralizationRule(float $number, string $locale): int
    135134    {
    136135        $number = abs($number);
     
    224223        };
    225224    }
    226     */
    227     private function getPluralizationRule(int $number, string $locale): int
    228     {
    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     }
    345225}
  • wpos-lite-version/trunk/vendor/symfony/translation-contracts/composer.json

    r3372384 r3372394  
    2828    "extra": {
    2929        "branch-alias": {
    30             "dev-main": "3.4-dev"
     30            "dev-main": "3.6-dev"
    3131        },
    3232        "thanks": {
  • wpos-lite-version/trunk/vendor/symfony/translation/Catalogue/AbstractOperation.php

    r3372171 r3372394  
    9898    {
    9999        if (!\in_array($domain, $this->getDomains())) {
    100             throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain));
     100            throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain));
    101101        }
    102102
     
    111111    {
    112112        if (!\in_array($domain, $this->getDomains())) {
    113             throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain));
     113            throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain));
    114114        }
    115115
     
    124124    {
    125125        if (!\in_array($domain, $this->getDomains())) {
    126             throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain));
     126            throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain));
    127127        }
    128128
     
    161161                self::NEW_BATCH => $this->getNewMessages($domain),
    162162                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)),
    164164            };
    165165
  • wpos-lite-version/trunk/vendor/symfony/translation/Command/XliffLintCommand.php

    r3372171 r3372394  
    5858        $this
    5959            ->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())))
    6161            ->setHelp(<<<EOF
    6262The <info>%command.name%</info> command lints an XLIFF file and outputs to STDOUT
     
    9999        foreach ($filenames as $filename) {
    100100            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));
    102102            }
    103103
     
    125125
    126126        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), '/'));
    128128            // strict file names require translation files to be named '____.locale.xlf'
    129129            // otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed
    130130            // also, the regexp matching must be case-insensitive, as defined for 'target-language' values
    131131            // 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);
    133133
    134134            if (0 === preg_match($expectedFilenamePattern, basename($file))) {
     
    136136                    'line' => -1,
    137137                    '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),
    139139                ];
    140140            }
     
    161161            'json' => $this->displayJson($io, $files),
    162162            '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()))),
    164164        };
    165165    }
     
    173173        foreach ($filesInfo as $info) {
    174174            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']) : ''));
    176176            } elseif (!$info['valid']) {
    177177                ++$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']) : ''));
    179179                $io->listing(array_map(function ($error) use ($info, $githubReporter) {
    180180                    // general document errors have a '-1' line number
     
    183183                    $githubReporter?->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null);
    184184
    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']);
    186186                }, $info['messages']));
    187187            }
     
    189189
    190190        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));
    192192        } 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));
    194194        }
    195195
  • wpos-lite-version/trunk/vendor/symfony/translation/DataCollectorTranslator.php

    r3372171 r3372394  
    3535    {
    3636        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)));
    3838        }
    3939
  • wpos-lite-version/trunk/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php

    r3372171 r3372394  
    3535        foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) {
    3636            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));
    3838            }
    3939
  • wpos-lite-version/trunk/vendor/symfony/translation/Dumper/CsvFileDumper.php

    r3372171 r3372394  
    2929
    3030        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, '\\');
    3232        }
    3333
  • wpos-lite-version/trunk/vendor/symfony/translation/Dumper/FileDumper.php

    r3372171 r3372394  
    5858                $directory = \dirname($fullpath);
    5959                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));
    6161                }
    6262            }
  • wpos-lite-version/trunk/vendor/symfony/translation/Dumper/PoFileDumper.php

    r3372171 r3372394  
    5252            $targetRules = $this->getStandardRules($target);
    5353            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]));
    5656                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));
    5858                }
    5959            } 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));
    6262            }
    6363        }
     
    124124
    125125        foreach ((array) $comments as $comment) {
    126             $output .= sprintf('#%s %s'."\n", $prefix, $comment);
     126            $output .= \sprintf('#%s %s'."\n", $prefix, $comment);
    127127        }
    128128
  • wpos-lite-version/trunk/vendor/symfony/translation/Dumper/XliffFileDumper.php

    r3372171 r3372394  
    4747        }
    4848
    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));
    5050    }
    5151
     
    177177
    178178            // Add notes section
    179             if ($this->hasMetadataArrayInfo('notes', $metadata)) {
     179            if ($this->hasMetadataArrayInfo('notes', $metadata) && $metadata['notes']) {
    180180                $notesElement = $dom->createElement('notes');
    181181                foreach ($metadata['notes'] as $note) {
  • wpos-lite-version/trunk/vendor/symfony/translation/Extractor/AbstractFileExtractor.php

    r3372171 r3372394  
    5050    {
    5151        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));
    5353        }
    5454
  • wpos-lite-version/trunk/vendor/symfony/translation/Extractor/PhpExtractor.php

    r3372171 r3372394  
    324324    {
    325325        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));
    327327        }
    328328
  • wpos-lite-version/trunk/vendor/symfony/translation/Loader/CsvFileLoader.php

    r3372171 r3372394  
    2323    private string $delimiter = ';';
    2424    private string $enclosure = '"';
    25     private string $escape = '\\';
     25    private string $escape = '';
    2626
    2727    protected function loadResource(string $resource): array
     
    3232            $file = new \SplFileObject($resource, 'rb');
    3333        } 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);
    3535        }
    3636
     
    5656     * @return void
    5757     */
    58     public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\')
     58    public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '')
    5959    {
    6060        $this->delimiter = $delimiter;
  • wpos-lite-version/trunk/vendor/symfony/translation/Loader/FileLoader.php

    r3372171 r3372394  
    2525    {
    2626        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));
    2828        }
    2929
    3030        if (!file_exists($resource)) {
    31             throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
     31            throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource));
    3232        }
    3333
     
    3939        // not an array
    4040        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));
    4242        }
    4343
  • wpos-lite-version/trunk/vendor/symfony/translation/Loader/IcuDatFileLoader.php

    r3372171 r3372394  
    2727    {
    2828        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));
    3030        }
    3131
    3232        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));
    3434        }
    3535
     
    4141
    4242        if (!$rb) {
    43             throw new InvalidResourceException(sprintf('Cannot load resource "%s".', $resource));
     43            throw new InvalidResourceException(\sprintf('Cannot load resource "%s".', $resource));
    4444        } elseif (intl_is_failure($rb->getErrorCode())) {
    4545            throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode());
  • wpos-lite-version/trunk/vendor/symfony/translation/Loader/IcuResFileLoader.php

    r3372171 r3372394  
    2727    {
    2828        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));
    3030        }
    3131
    3232        if (!is_dir($resource)) {
    33             throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
     33            throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource));
    3434        }
    3535
     
    4141
    4242        if (!$rb) {
    43             throw new InvalidResourceException(sprintf('Cannot load resource "%s".', $resource));
     43            throw new InvalidResourceException(\sprintf('Cannot load resource "%s".', $resource));
    4444        } elseif (intl_is_failure($rb->getErrorCode())) {
    4545            throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode());
  • wpos-lite-version/trunk/vendor/symfony/translation/Loader/QtFileLoader.php

    r3372171 r3372394  
    3333
    3434        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));
    3636        }
    3737
    3838        if (!file_exists($resource)) {
    39             throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
     39            throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource));
    4040        }
    4141
     
    4343            $dom = XmlUtils::loadFile($resource);
    4444        } 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);
    4646        }
    4747
  • wpos-lite-version/trunk/vendor/symfony/translation/Loader/XliffFileLoader.php

    r3372171 r3372394  
    3737        if (!$this->isXmlString($resource)) {
    3838            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));
    4040            }
    4141
    4242            if (!file_exists($resource)) {
    43                 throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
     43                throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource));
    4444            }
    4545
    4646            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));
    4848            }
    4949        }
     
    5656            }
    5757        } 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);
    5959        }
    6060
    6161        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));
    6363        }
    6464
     
    113113                }
    114114
    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                ) {
    116121                    continue;
    117122                }
    118123
    119                 $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
    120124                // If the xlf file has another encoding specified, try to convert it because
    121125                // simple_xml will always return utf-8 encoded values
    122126                $target = $this->utf8ToCharset((string) ($translation->target ?? $translation->source), $encoding);
    123127
    124                 $catalogue->set((string) $source, $target, $domain);
     128                $catalogue->set($source, $target, $domain);
    125129
    126130                $metadata = [
     
    145149                }
    146150
    147                 $catalogue->setMetadata((string) $source, $metadata, $domain);
     151                $catalogue->setMetadata($source, $metadata, $domain);
    148152            }
    149153        }
  • wpos-lite-version/trunk/vendor/symfony/translation/Loader/YamlFileLoader.php

    r3372171 r3372394  
    3030    {
    3131        if (!isset($this->yamlParser)) {
    32             if (!class_exists(\Symfony\Component\Yaml\Parser::class)) {
     32            if (!class_exists(YamlParser::class)) {
    3333                throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.');
    3434            }
     
    4040            $messages = $this->yamlParser->parseFile($resource, Yaml::PARSE_CONSTANT);
    4141        } 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);
    4343        }
    4444
    4545        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));
    4747        }
    4848
  • wpos-lite-version/trunk/vendor/symfony/translation/LoggingTranslator.php

    r3372171 r3372394  
    3131    {
    3232        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)));
    3434        }
    3535
     
    5757        }
    5858
    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));
    6060    }
    6161
  • wpos-lite-version/trunk/vendor/symfony/translation/MessageCatalogue.php

    r3372171 r3372394  
    156156    {
    157157        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));
    159159        }
    160160
     
    191191        while ($c = $c->getFallbackCatalogue()) {
    192192            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()));
    194194            }
    195195        }
     
    198198        do {
    199199            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()));
    201201            }
    202202
     
    236236        if ('' == $domain) {
    237237            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            }
    238248        }
    239249
  • wpos-lite-version/trunk/vendor/symfony/translation/Translator.php

    r3372171 r3372394  
    291291        $fallbackContent = $this->getFallbackContent($this->catalogues[$locale]);
    292292
    293         $content = sprintf(<<<EOF
     293        $content = \sprintf(<<<EOF
    294294<?php
    295295
     
    322322            $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current));
    323323
    324             $fallbackContent .= sprintf(<<<'EOF'
     324            $fallbackContent .= \sprintf(<<<'EOF'
    325325$catalogue%s = new MessageCatalogue('%s', %s);
    326326$catalogue%s->addFallbackCatalogue($catalogue%s);
     
    357357                if (!isset($this->loaders[$resource[0]])) {
    358358                    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]));
    360360                    }
    361361
    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]));
    363363                }
    364364                $this->catalogues[$locale]->addCatalogue($this->loaders[$resource[0]]->load($resource[1], $locale, $resource[2]));
     
    439439    {
    440440        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));
    442442        }
    443443    }
  • wpos-lite-version/trunk/vendor/symfony/translation/Writer/TranslationWriter.php

    r3372171 r3372394  
    6060    {
    6161        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));
    6363        }
    6464
     
    6767
    6868        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']));
    7070        }
    7171
Note: See TracChangeset for help on using the changeset viewer.