diff --git a/data/conf/rspamd/lua/ivm-sg.lua b/data/conf/rspamd/lua/ivm-sg.lua deleted file mode 100644 index 6642fe4d..00000000 --- a/data/conf/rspamd/lua/ivm-sg.lua +++ /dev/null @@ -1,61 +0,0 @@ --- Thanks to https://raw.githubusercontent.com/fatalbanana - -local lua_maps = require 'lua_maps' -local rspamd_regexp = require 'rspamd_regexp' -local rspamd_util = require 'rspamd_util' - -local ivm_sendgrid_ids = lua_maps.map_add_from_ucl( - 'https://www.invaluement.com/spdata/sendgrid-id-dnsbl.txt', - 'set', - 'Invaluement Service Provider DNSBL: Sendgrid IDs' -) - -local ivm_sendgrid_envfromdomains = lua_maps.map_add_from_ucl( - 'https://www.invaluement.com/spdata/sendgrid-envelopefromdomain-dnsbl.txt', - 'set', - 'Invaluement Service Provider DNSBL: Sendgrid envelope domains' -) - -local cb_id = rspamd_config:register_symbol({ - name = 'IVM_SENDGRID', - callback = function(task) - -- Is it Sendgrid? - local sg_hdr = task:get_header('X-SG-EID') - if not sg_hdr then return end - - -- Get original envelope from - local env_from = task:get_from{'smtp', 'orig'} - if not env_from then return end - - -- Check normalised domain in domains list - if ivm_sendgrid_envfromdomains and ivm_sendgrid_envfromdomains:get_key(rspamd_util.get_tld(env_from[1].domain)) then - task:insert_result('IVM_SENDGRID_DOMAIN', 1.0) - end - - -- Check ID in ID list - local lp_re = rspamd_regexp.create_cached([[^bounces\+(\d+)-]]) - local res = lp_re:search(env_from[1].user, true, true) - if not res then return end - if ivm_sendgrid_ids and ivm_sendgrid_ids:get_key(res[1][2]) then - task:insert_result('IVM_SENDGRID_ID', 1.0) - end - end, - description = 'Invaluement Service Provider DNSBL: Sendgrid', - type = 'callback', -}) - -rspamd_config:register_symbol({ - name = 'IVM_SENDGRID_DOMAIN', - parent = cb_id, - group = 'ivmspdnsbl', - score = 8.0, - type = 'virtual', -}) - -rspamd_config:register_symbol({ - name = 'IVM_SENDGRID_ID', - parent = cb_id, - group = 'ivmspdnsbl', - score = 8.0, - type = 'virtual', -}) diff --git a/data/web/css/build/008-mailcow.css b/data/web/css/build/008-mailcow.css index 4d45a75e..d04feb25 100644 --- a/data/web/css/build/008-mailcow.css +++ b/data/web/css/build/008-mailcow.css @@ -204,11 +204,10 @@ legend { color: #959595; display: flex; flex-direction: column; - width: 100% !important; - padding: 0 !important; } .footer .version { margin-left: auto; + margin-top: 20px; } .slave-info { padding: 15px 0px 15px 15px; diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 21b6b130..dccdcd93 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -4054,6 +4054,10 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { $stmt->execute(array( ':alias_domain' => $alias_domain, )); + $stmt = $pdo->prepare("DELETE FROM `spamalias` WHERE `address` LIKE :domain"); + $stmt->execute(array( + ':domain' => '%@'.$alias_domain, + )); $stmt = $pdo->prepare("DELETE FROM `bcc_maps` WHERE `local_dest` = :alias_domain"); $stmt->execute(array( ':alias_domain' => $alias_domain, diff --git a/data/web/inc/lib/composer.lock b/data/web/inc/lib/composer.lock index b1507525..870382f3 100644 --- a/data/web/inc/lib/composer.lock +++ b/data/web/inc/lib/composer.lock @@ -62,35 +62,40 @@ "oauth", "oauth2" ], + "support": { + "issues": "https://github.com/bshaffer/oauth2-server-php/issues", + "source": "https://github.com/bshaffer/oauth2-server-php/tree/master" + }, "time": "2018-12-04T00:29:32+00:00" }, { "name": "ddeboer/imap", - "version": "1.12.1", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/ddeboer/imap.git", - "reference": "dbed05ca67b93509345a820b2859de10c48948fb" + "reference": "8b772d04b1deadb5df13782fb78c4b648f77496e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ddeboer/imap/zipball/dbed05ca67b93509345a820b2859de10c48948fb", - "reference": "dbed05ca67b93509345a820b2859de10c48948fb", + "url": "https://api.github.com/repos/ddeboer/imap/zipball/8b772d04b1deadb5df13782fb78c4b648f77496e", + "reference": "8b772d04b1deadb5df13782fb78c4b648f77496e", "shasum": "" }, "require": { "ext-iconv": "*", "ext-imap": "*", "ext-mbstring": "*", - "php": "^7.4 || ^8.0" + "php": "^8.0.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18.6", - "laminas/laminas-mail": "^2.14.0", - "phpstan/phpstan": "^0.12.84", - "phpstan/phpstan-phpunit": "^0.12.18", - "phpstan/phpstan-strict-rules": "^0.12.9", - "phpunit/phpunit": "^9.5.4" + "friendsofphp/php-cs-fixer": "^v3.4.0", + "laminas/laminas-mail": "^2.15.1", + "malukenho/mcbumpface": "^1.1.5", + "phpstan/phpstan": "^1.3.3", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.1.0", + "phpunit/phpunit": "^9.5.11" }, "type": "library", "autoload": { @@ -124,7 +129,7 @@ ], "support": { "issues": "https://github.com/ddeboer/imap/issues", - "source": "https://github.com/ddeboer/imap/tree/1.12.1" + "source": "https://github.com/ddeboer/imap/tree/1.13.1" }, "funding": [ { @@ -136,35 +141,35 @@ "type": "github" } ], - "time": "2021-04-27T08:38:46+00:00" + "time": "2022-01-10T10:53:05+00:00" }, { "name": "directorytree/ldaprecord", - "version": "v2.6.3", + "version": "v2.10.1", "source": { "type": "git", "url": "https://github.com/DirectoryTree/LdapRecord.git", - "reference": "5c93ec6d1ef458290825a8b0a148946dce7c1e7a" + "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/5c93ec6d1ef458290825a8b0a148946dce7c1e7a", - "reference": "5c93ec6d1ef458290825a8b0a148946dce7c1e7a", + "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/bf512d9af7a7b0e2ed7a666ab29cefdd027bee88", + "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88", "shasum": "" }, "require": { "ext-json": "*", "ext-ldap": "*", - "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0", + "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0", "nesbot/carbon": "^1.0|^2.0", "php": ">=7.3", - "psr/log": "^1.0", - "psr/simple-cache": "^1.0", + "psr/log": "*", + "psr/simple-cache": "^1.0|^2.0", "tightenco/collect": "^5.6|^6.0|^7.0|^8.0" }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^9.0", "spatie/ray": "^1.24" }, "type": "library", @@ -209,31 +214,31 @@ "type": "github" } ], - "time": "2021-08-05T21:52:43+00:00" + "time": "2022-02-25T16:00:51+00:00" }, { "name": "illuminate/contracts", - "version": "v8.53.1", + "version": "v9.3.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "504a34286a1b4c5421c43087d6bd4e176138f6fb" + "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/504a34286a1b4c5421c43087d6bd4e176138f6fb", - "reference": "504a34286a1b4c5421c43087d6bd4e176138f6fb", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/bf4b3c254c49d28157645d01e4883b5951b1e1d0", + "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -257,7 +262,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-03T14:03:47+00:00" + "time": "2022-02-22T14:45:39+00:00" }, { "name": "matthiasmullie/minify", @@ -384,6 +389,10 @@ "paths", "relative" ], + "support": { + "issues": "https://github.com/matthiasmullie/path-converter/issues", + "source": "https://github.com/matthiasmullie/path-converter/tree/1.1.3" + }, "time": "2019-02-05T23:41:09+00:00" }, { @@ -438,16 +447,16 @@ }, { "name": "nesbot/carbon", - "version": "2.51.1", + "version": "2.57.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "8619c299d1e0d4b344e1f98ca07a1ce2cfbf1922" + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8619c299d1e0d4b344e1f98ca07a1ce2cfbf1922", - "reference": "8619c299d1e0d4b344e1f98ca07a1ce2cfbf1922", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78", + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78", "shasum": "" }, "require": { @@ -455,15 +464,16 @@ "php": "^7.1.8 || ^8.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0" + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^0.12.54 || ^1.0", "phpunit/phpunit": "^7.5.20 || ^8.5.14", "squizlabs/php_codesniffer": "^3.4" }, @@ -515,6 +525,7 @@ "time" ], "support": { + "docs": "https://carbon.nesbot.com/docs", "issues": "https://github.com/briannesbitt/Carbon/issues", "source": "https://github.com/briannesbitt/Carbon" }, @@ -528,7 +539,7 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:16:28+00:00" + "time": "2022-02-13T18:13:33+00:00" }, { "name": "paragonie/random_compat", @@ -673,16 +684,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.5.0", + "version": "v6.6.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1", + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1", "shasum": "" }, "require": { @@ -694,10 +705,12 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" + "squizlabs/php_codesniffer": "^3.6.2", + "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", @@ -737,7 +750,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0" }, "funding": [ { @@ -745,26 +758,31 @@ "type": "github" } ], - "time": "2021-06-16T14:33:43+00:00" + "time": "2022-02-28T15:31:21+00:00" }, { "name": "psr/container", - "version": "1.1.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -791,36 +809,36 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -841,31 +859,31 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "8707bf3cea6f710bf6ef05491234e3ab06f6432a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/8707bf3cea6f710bf6ef05491234e3ab06f6432a", + "reference": "8707bf3cea6f710bf6ef05491234e3ab06f6432a", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -880,7 +898,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -892,22 +910,22 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/2.0.0" }, - "time": "2017-10-23T01:57:42+00:00" + "time": "2021-10-29T13:22:09+00:00" }, { "name": "robthree/twofactorauth", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/RobThree/TwoFactorAuth.git", - "reference": "30a38627ae1e7c9399dae67e265063cd6ec5276c" + "reference": "5afcb45282f1c75562a48d479ecd1732c9bdb11b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/30a38627ae1e7c9399dae67e265063cd6ec5276c", - "reference": "30a38627ae1e7c9399dae67e265063cd6ec5276c", + "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/5afcb45282f1c75562a48d479ecd1732c9bdb11b", + "reference": "5afcb45282f1c75562a48d479ecd1732c9bdb11b", "shasum": "" }, "require": { @@ -964,7 +982,7 @@ "type": "github" } ], - "time": "2021-03-09T18:24:05+00:00" + "time": "2021-10-20T12:19:55+00:00" }, { "name": "soundasleep/html2text", @@ -1014,92 +1032,33 @@ "php", "text" ], + "support": { + "email": "support@jevon.org", + "issues": "https://github.com/soundasleep/html2text/issues", + "source": "https://github.com/soundasleep/html2text/tree/master" + }, "time": "2017-04-19T22:01:50+00:00" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-03-23T23:28:01+00:00" - }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -1114,12 +1073,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1144,7 +1103,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" }, "funding": [ { @@ -1160,25 +1119,28 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -1193,12 +1155,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1224,7 +1186,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" }, "funding": [ { @@ -1240,20 +1202,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "" }, "require": { @@ -1270,12 +1232,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1307,7 +1269,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" }, "funding": [ { @@ -1323,50 +1285,50 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2021-09-13T13:58:33+00:00" }, { "name": "symfony/translation", - "version": "v5.3.4", + "version": "v6.0.5", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1" + "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/d89ad7292932c2699cbe4af98d72c5c6bbc504c1", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1", + "url": "https://api.github.com/repos/symfony/translation/zipball/e69501c71107cc3146b32aaa45f4edd0c3427875", + "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "conflict": { - "symfony/config": "<4.4", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^4.4|^5.0", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^4.4|^5.0" + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^5.4|^6.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -1402,7 +1364,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.4" + "source": "https://github.com/symfony/translation/tree/v6.0.5" }, "funding": [ { @@ -1418,24 +1380,24 @@ "type": "tidelift" } ], - "time": "2021-07-25T09:39:16+00:00" + "time": "2022-02-09T15:52:48+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.4.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95" + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -1443,7 +1405,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1480,7 +1442,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" }, "funding": [ { @@ -1496,35 +1458,35 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2021-09-07T12:43:40+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.3.6", + "version": "v6.0.5", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0" + "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0", - "reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/60d6a756d5f485df5e6e40b337334848f79f61ce", + "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" + "symfony/console": "<5.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", + "symfony/console": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, "suggest": { @@ -1568,7 +1530,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.3.6" + "source": "https://github.com/symfony/var-dumper/tree/v6.0.5" }, "funding": [ { @@ -1584,25 +1546,25 @@ "type": "tidelift" } ], - "time": "2021-07-27T01:56:02+00:00" + "time": "2022-02-21T17:15:17+00:00" }, { "name": "tightenco/collect", - "version": "v8.34.0", + "version": "v8.83.2", "source": { "type": "git", "url": "https://github.com/tighten/collect.git", - "reference": "b069783ab0c547bb894ebcf8e7f6024bb401f9d2" + "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tighten/collect/zipball/b069783ab0c547bb894ebcf8e7f6024bb401f9d2", - "reference": "b069783ab0c547bb894ebcf8e7f6024bb401f9d2", + "url": "https://api.github.com/repos/tighten/collect/zipball/d9c66d586ec2d216d8a31283d73f8df1400cc722", + "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" + "php": "^7.3|^8.0", + "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { "mockery/mockery": "^1.0", @@ -1636,22 +1598,22 @@ ], "support": { "issues": "https://github.com/tighten/collect/issues", - "source": "https://github.com/tighten/collect/tree/v8.34.0" + "source": "https://github.com/tighten/collect/tree/v8.83.2" }, - "time": "2021-03-29T21:29:00+00:00" + "time": "2022-02-16T16:15:54+00:00" }, { "name": "twig/twig", - "version": "v3.3.2", + "version": "v3.3.8", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790" + "reference": "972d8604a92b7054828b539f2febb0211dd5945c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/21578f00e83d4a82ecfa3d50752b609f13de6790", - "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/972d8604a92b7054828b539f2febb0211dd5945c", + "reference": "972d8604a92b7054828b539f2febb0211dd5945c", "shasum": "" }, "require": { @@ -1661,7 +1623,7 @@ }, "require-dev": { "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, "type": "library", "extra": { @@ -1702,7 +1664,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.2" + "source": "https://github.com/twigphp/Twig/tree/v3.3.8" }, "funding": [ { @@ -1714,7 +1676,7 @@ "type": "tidelift" } ], - "time": "2021-05-16T12:14:13+00:00" + "time": "2022-02-04T06:59:48+00:00" }, { "name": "yubico/u2flib-server", @@ -1751,6 +1713,10 @@ ], "description": "Library for U2F implementation", "homepage": "https://developers.yubico.com/php-u2flib-server", + "support": { + "issues": "https://github.com/Yubico/php-u2flib-server/issues", + "source": "https://github.com/Yubico/php-u2flib-server/tree/1.0.2" + }, "time": "2018-09-07T08:16:44+00:00" } ], @@ -1762,5 +1728,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.2.0" } diff --git a/data/web/inc/lib/vendor/bin/carbon b/data/web/inc/lib/vendor/bin/carbon deleted file mode 120000 index 0da48041..00000000 --- a/data/web/inc/lib/vendor/bin/carbon +++ /dev/null @@ -1 +0,0 @@ -../nesbot/carbon/bin/carbon \ No newline at end of file diff --git a/data/web/inc/lib/vendor/bin/carbon b/data/web/inc/lib/vendor/bin/carbon new file mode 100755 index 00000000..7b63379a --- /dev/null +++ b/data/web/inc/lib/vendor/bin/carbon @@ -0,0 +1,97 @@ +#!/usr/bin/env php +<?php + +/** + * Proxy PHP file generated by Composer + * + * This file includes the referenced bin path (../nesbot/carbon/bin/carbon) + * using a stream wrapper to prevent the shebang from being output on PHP<8 + * + * @generated + */ + +namespace Composer; + +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 21); + $opened_path = realpath($opened_path) ?: $opened_path; + $this->handle = fopen($opened_path, $mode); + $this->position = 0; + + // remove all traces of this stream wrapper once it has been used + stream_wrapper_unregister('composer-bin-proxy'); + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return fstat($this->handle); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { + include("composer-bin-proxy://" . __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'); + exit(0); + } +} + +include __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'; diff --git a/data/web/inc/lib/vendor/bin/minifycss b/data/web/inc/lib/vendor/bin/minifycss deleted file mode 120000 index 04f60a4b..00000000 --- a/data/web/inc/lib/vendor/bin/minifycss +++ /dev/null @@ -1 +0,0 @@ -../matthiasmullie/minify/bin/minifycss \ No newline at end of file diff --git a/data/web/inc/lib/vendor/bin/minifycss b/data/web/inc/lib/vendor/bin/minifycss new file mode 100755 index 00000000..0604366b --- /dev/null +++ b/data/web/inc/lib/vendor/bin/minifycss @@ -0,0 +1,97 @@ +#!/usr/bin/env php +<?php + +/** + * Proxy PHP file generated by Composer + * + * This file includes the referenced bin path (../matthiasmullie/minify/bin/minifycss) + * using a stream wrapper to prevent the shebang from being output on PHP<8 + * + * @generated + */ + +namespace Composer; + +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 21); + $opened_path = realpath($opened_path) ?: $opened_path; + $this->handle = fopen($opened_path, $mode); + $this->position = 0; + + // remove all traces of this stream wrapper once it has been used + stream_wrapper_unregister('composer-bin-proxy'); + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return fstat($this->handle); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { + include("composer-bin-proxy://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifycss'); + exit(0); + } +} + +include __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifycss'; diff --git a/data/web/inc/lib/vendor/bin/minifyjs b/data/web/inc/lib/vendor/bin/minifyjs deleted file mode 120000 index 61124467..00000000 --- a/data/web/inc/lib/vendor/bin/minifyjs +++ /dev/null @@ -1 +0,0 @@ -../matthiasmullie/minify/bin/minifyjs \ No newline at end of file diff --git a/data/web/inc/lib/vendor/bin/minifyjs b/data/web/inc/lib/vendor/bin/minifyjs new file mode 100755 index 00000000..f8ee9123 --- /dev/null +++ b/data/web/inc/lib/vendor/bin/minifyjs @@ -0,0 +1,97 @@ +#!/usr/bin/env php +<?php + +/** + * Proxy PHP file generated by Composer + * + * This file includes the referenced bin path (../matthiasmullie/minify/bin/minifyjs) + * using a stream wrapper to prevent the shebang from being output on PHP<8 + * + * @generated + */ + +namespace Composer; + +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 21); + $opened_path = realpath($opened_path) ?: $opened_path; + $this->handle = fopen($opened_path, $mode); + $this->position = 0; + + // remove all traces of this stream wrapper once it has been used + stream_wrapper_unregister('composer-bin-proxy'); + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return fstat($this->handle); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { + include("composer-bin-proxy://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifyjs'); + exit(0); + } +} + +include __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifyjs'; diff --git a/data/web/inc/lib/vendor/bin/var-dump-server b/data/web/inc/lib/vendor/bin/var-dump-server deleted file mode 120000 index 6bd4e93d..00000000 --- a/data/web/inc/lib/vendor/bin/var-dump-server +++ /dev/null @@ -1 +0,0 @@ -../symfony/var-dumper/Resources/bin/var-dump-server \ No newline at end of file diff --git a/data/web/inc/lib/vendor/bin/var-dump-server b/data/web/inc/lib/vendor/bin/var-dump-server new file mode 100755 index 00000000..1eafd5d9 --- /dev/null +++ b/data/web/inc/lib/vendor/bin/var-dump-server @@ -0,0 +1,97 @@ +#!/usr/bin/env php +<?php + +/** + * Proxy PHP file generated by Composer + * + * This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server) + * using a stream wrapper to prevent the shebang from being output on PHP<8 + * + * @generated + */ + +namespace Composer; + +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 21); + $opened_path = realpath($opened_path) ?: $opened_path; + $this->handle = fopen($opened_path, $mode); + $this->position = 0; + + // remove all traces of this stream wrapper once it has been used + stream_wrapper_unregister('composer-bin-proxy'); + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return fstat($this->handle); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) { + include("composer-bin-proxy://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'); + exit(0); + } +} + +include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'; diff --git a/data/web/inc/lib/vendor/composer/ClassLoader.php b/data/web/inc/lib/vendor/composer/ClassLoader.php index 6d0c3f2d..afef3fa2 100644 --- a/data/web/inc/lib/vendor/composer/ClassLoader.php +++ b/data/web/inc/lib/vendor/composer/ClassLoader.php @@ -42,30 +42,75 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var ?string */ private $vendorDir; // PSR-4 + /** + * @var array[] + * @psalm-var array<string, array<string, int>> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array<string, array<int, string>> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array<string, string> + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array<string, array<string, string[]>> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array<string, string> + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array<string, string> + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array<string, bool> + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ private static $registeredLoaders = array(); + /** + * @param ?string $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +120,47 @@ class ClassLoader return array(); } + /** + * @return array[] + * @psalm-return array<string, array<int, string>> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array<string, string> + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array<string, string> + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-return array<string, string> + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array<string, string> $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,9 +175,11 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -156,11 +222,13 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -204,8 +272,10 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +290,12 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +315,8 @@ class ClassLoader * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +339,8 @@ class ClassLoader * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +361,8 @@ class ClassLoader * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -305,6 +383,8 @@ class ClassLoader * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { @@ -324,6 +404,8 @@ class ClassLoader /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -403,6 +485,11 @@ class ClassLoader return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -474,6 +561,10 @@ class ClassLoader * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/data/web/inc/lib/vendor/composer/InstalledVersions.php b/data/web/inc/lib/vendor/composer/InstalledVersions.php index b3a4e161..d50e0c9f 100644 --- a/data/web/inc/lib/vendor/composer/InstalledVersions.php +++ b/data/web/inc/lib/vendor/composer/InstalledVersions.php @@ -20,12 +20,25 @@ use Composer\Semver\VersionParser; * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * - * To require it's presence, you can require `composer-runtime-api ^2.0` + * To require its presence, you can require `composer-runtime-api ^2.0` */ class InstalledVersions { + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null + */ private static $installed; + + /** + * @var bool|null + */ private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + */ private static $installedByVendor = array(); /** @@ -228,7 +241,7 @@ class InstalledVersions /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} */ public static function getRootPackage() { @@ -242,7 +255,7 @@ class InstalledVersions * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} */ public static function getRawData() { @@ -265,7 +278,7 @@ class InstalledVersions * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> */ public static function getAllRawData() { @@ -288,7 +301,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data */ public static function reload($data) { @@ -298,7 +311,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}> + * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> */ private static function getInstalled() { diff --git a/data/web/inc/lib/vendor/composer/autoload_files.php b/data/web/inc/lib/vendor/composer/autoload_files.php index 183b68df..02f24c12 100644 --- a/data/web/inc/lib/vendor/composer/autoload_files.php +++ b/data/web/inc/lib/vendor/composer/autoload_files.php @@ -7,10 +7,9 @@ $baseDir = dirname($vendorDir); return array( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'fe62ba7e10580d903cc46d808b5961a4' => $vendorDir . '/tightenco/collect/src/Collect/Support/helpers.php', 'caf31cc6ec7cf2241cb6f12c226c3846' => $vendorDir . '/tightenco/collect/src/Collect/Support/alias.php', diff --git a/data/web/inc/lib/vendor/composer/autoload_psr4.php b/data/web/inc/lib/vendor/composer/autoload_psr4.php index 6e9d44e1..f75b7fa7 100644 --- a/data/web/inc/lib/vendor/composer/autoload_psr4.php +++ b/data/web/inc/lib/vendor/composer/autoload_psr4.php @@ -16,7 +16,7 @@ return array( 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), 'RobThree\\Auth\\' => array($vendorDir . '/robthree/twofactorauth/lib'), 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'PhpMimeMailParser\\' => array($vendorDir . '/php-mime-mail-parser/php-mime-mail-parser/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), diff --git a/data/web/inc/lib/vendor/composer/autoload_real.php b/data/web/inc/lib/vendor/composer/autoload_real.php index 8a7686a4..250af557 100644 --- a/data/web/inc/lib/vendor/composer/autoload_real.php +++ b/data/web/inc/lib/vendor/composer/autoload_real.php @@ -65,11 +65,16 @@ class ComposerAutoloaderInit873464e4bd965a3168f133248b1b218b } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire873464e4bd965a3168f133248b1b218b($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/data/web/inc/lib/vendor/composer/autoload_static.php b/data/web/inc/lib/vendor/composer/autoload_static.php index 19aadb61..bdd03180 100644 --- a/data/web/inc/lib/vendor/composer/autoload_static.php +++ b/data/web/inc/lib/vendor/composer/autoload_static.php @@ -8,10 +8,9 @@ class ComposerStaticInit873464e4bd965a3168f133248b1b218b { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'fe62ba7e10580d903cc46d808b5961a4' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/helpers.php', 'caf31cc6ec7cf2241cb6f12c226c3846' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/alias.php', @@ -115,7 +114,7 @@ class ComposerStaticInit873464e4bd965a3168f133248b1b218b ), 'Psr\\Log\\' => array ( - 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', + 0 => __DIR__ . '/..' . '/psr/log/src', ), 'Psr\\Container\\' => array ( diff --git a/data/web/inc/lib/vendor/composer/installed.json b/data/web/inc/lib/vendor/composer/installed.json index c5247040..a5cfe0e6 100644 --- a/data/web/inc/lib/vendor/composer/installed.json +++ b/data/web/inc/lib/vendor/composer/installed.json @@ -63,34 +63,35 @@ }, { "name": "ddeboer/imap", - "version": "1.12.1", - "version_normalized": "1.12.1.0", + "version": "1.13.1", + "version_normalized": "1.13.1.0", "source": { "type": "git", "url": "https://github.com/ddeboer/imap.git", - "reference": "dbed05ca67b93509345a820b2859de10c48948fb" + "reference": "8b772d04b1deadb5df13782fb78c4b648f77496e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ddeboer/imap/zipball/dbed05ca67b93509345a820b2859de10c48948fb", - "reference": "dbed05ca67b93509345a820b2859de10c48948fb", + "url": "https://api.github.com/repos/ddeboer/imap/zipball/8b772d04b1deadb5df13782fb78c4b648f77496e", + "reference": "8b772d04b1deadb5df13782fb78c4b648f77496e", "shasum": "" }, "require": { "ext-iconv": "*", "ext-imap": "*", "ext-mbstring": "*", - "php": "^7.4 || ^8.0" + "php": "^8.0.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18.6", - "laminas/laminas-mail": "^2.14.0", - "phpstan/phpstan": "^0.12.84", - "phpstan/phpstan-phpunit": "^0.12.18", - "phpstan/phpstan-strict-rules": "^0.12.9", - "phpunit/phpunit": "^9.5.4" + "friendsofphp/php-cs-fixer": "^v3.4.0", + "laminas/laminas-mail": "^2.15.1", + "malukenho/mcbumpface": "^1.1.5", + "phpstan/phpstan": "^1.3.3", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.1.0", + "phpunit/phpunit": "^9.5.11" }, - "time": "2021-04-27T08:38:46+00:00", + "time": "2022-01-10T10:53:05+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -124,7 +125,7 @@ ], "support": { "issues": "https://github.com/ddeboer/imap/issues", - "source": "https://github.com/ddeboer/imap/tree/1.12.1" + "source": "https://github.com/ddeboer/imap/tree/1.13.1" }, "funding": [ { @@ -140,35 +141,35 @@ }, { "name": "directorytree/ldaprecord", - "version": "v2.6.3", - "version_normalized": "2.6.3.0", + "version": "v2.10.1", + "version_normalized": "2.10.1.0", "source": { "type": "git", "url": "https://github.com/DirectoryTree/LdapRecord.git", - "reference": "5c93ec6d1ef458290825a8b0a148946dce7c1e7a" + "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/5c93ec6d1ef458290825a8b0a148946dce7c1e7a", - "reference": "5c93ec6d1ef458290825a8b0a148946dce7c1e7a", + "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/bf512d9af7a7b0e2ed7a666ab29cefdd027bee88", + "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88", "shasum": "" }, "require": { "ext-json": "*", "ext-ldap": "*", - "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0", + "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0", "nesbot/carbon": "^1.0|^2.0", "php": ">=7.3", - "psr/log": "^1.0", - "psr/simple-cache": "^1.0", + "psr/log": "*", + "psr/simple-cache": "^1.0|^2.0", "tightenco/collect": "^5.6|^6.0|^7.0|^8.0" }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^9.0", "spatie/ray": "^1.24" }, - "time": "2021-08-05T21:52:43+00:00", + "time": "2022-02-25T16:00:51+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -216,29 +217,29 @@ }, { "name": "illuminate/contracts", - "version": "v8.53.1", - "version_normalized": "8.53.1.0", + "version": "v9.3.0", + "version_normalized": "9.3.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "504a34286a1b4c5421c43087d6bd4e176138f6fb" + "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/504a34286a1b4c5421c43087d6bd4e176138f6fb", - "reference": "504a34286a1b4c5421c43087d6bd4e176138f6fb", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/bf4b3c254c49d28157645d01e4883b5951b1e1d0", + "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" }, - "time": "2021-08-03T14:03:47+00:00", + "time": "2022-02-22T14:45:39+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -453,17 +454,17 @@ }, { "name": "nesbot/carbon", - "version": "2.51.1", - "version_normalized": "2.51.1.0", + "version": "2.57.0", + "version_normalized": "2.57.0.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "8619c299d1e0d4b344e1f98ca07a1ce2cfbf1922" + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8619c299d1e0d4b344e1f98ca07a1ce2cfbf1922", - "reference": "8619c299d1e0d4b344e1f98ca07a1ce2cfbf1922", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78", + "reference": "4a54375c21eea4811dbd1149fe6b246517554e78", "shasum": "" }, "require": { @@ -471,19 +472,20 @@ "php": "^7.1.8 || ^8.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0" + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^0.12.54 || ^1.0", "phpunit/phpunit": "^7.5.20 || ^8.5.14", "squizlabs/php_codesniffer": "^3.4" }, - "time": "2021-07-28T13:16:28+00:00", + "time": "2022-02-13T18:13:33+00:00", "bin": [ "bin/carbon" ], @@ -533,6 +535,7 @@ "time" ], "support": { + "docs": "https://carbon.nesbot.com/docs", "issues": "https://github.com/briannesbitt/Carbon/issues", "source": "https://github.com/briannesbitt/Carbon" }, @@ -697,17 +700,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.5.0", - "version_normalized": "6.5.0.0", + "version": "v6.6.0", + "version_normalized": "6.6.0.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1", + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1", "shasum": "" }, "require": { @@ -719,10 +722,12 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" + "squizlabs/php_codesniffer": "^3.6.2", + "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", @@ -732,7 +737,7 @@ "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, - "time": "2021-06-16T14:33:43+00:00", + "time": "2022-02-28T15:31:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -764,7 +769,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0" }, "funding": [ { @@ -776,24 +781,29 @@ }, { "name": "psr/container", - "version": "1.1.1", - "version_normalized": "1.1.1.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, - "time": "2021-03-05T17:36:06+00:00", + "time": "2021-11-05T16:47:00+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-4": { @@ -821,39 +831,39 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, "install-path": "../psr/container" }, { "name": "psr/log", - "version": "1.1.4", - "version_normalized": "1.1.4.0", + "version": "3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, - "time": "2021-05-03T11:20:27+00:00", + "time": "2021-07-14T16:46:02+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -874,33 +884,33 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, "install-path": "../psr/log" }, { "name": "psr/simple-cache", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "2.0.0", + "version_normalized": "2.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "8707bf3cea6f710bf6ef05491234e3ab06f6432a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/8707bf3cea6f710bf6ef05491234e3ab06f6432a", + "reference": "8707bf3cea6f710bf6ef05491234e3ab06f6432a", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, - "time": "2017-10-23T01:57:42+00:00", + "time": "2021-10-29T13:22:09+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", @@ -916,7 +926,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -928,23 +938,23 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/2.0.0" }, "install-path": "../psr/simple-cache" }, { "name": "robthree/twofactorauth", - "version": "1.8.0", - "version_normalized": "1.8.0.0", + "version": "1.8.1", + "version_normalized": "1.8.1.0", "source": { "type": "git", "url": "https://github.com/RobThree/TwoFactorAuth.git", - "reference": "30a38627ae1e7c9399dae67e265063cd6ec5276c" + "reference": "5afcb45282f1c75562a48d479ecd1732c9bdb11b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/30a38627ae1e7c9399dae67e265063cd6ec5276c", - "reference": "30a38627ae1e7c9399dae67e265063cd6ec5276c", + "url": "https://api.github.com/repos/RobThree/TwoFactorAuth/zipball/5afcb45282f1c75562a48d479ecd1732c9bdb11b", + "reference": "5afcb45282f1c75562a48d479ecd1732c9bdb11b", "shasum": "" }, "require": { @@ -958,7 +968,7 @@ "bacon/bacon-qr-code": "Needed for BaconQrCodeProvider provider", "endroid/qr-code": "Needed for EndroidQrCodeProvider" }, - "time": "2021-03-09T18:24:05+00:00", + "time": "2021-10-20T12:19:55+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1058,98 +1068,31 @@ ], "install-path": "../soundasleep/html2text" }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.4.0", - "version_normalized": "2.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2021-03-23T23:28:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, - "time": "2021-02-19T12:13:01+00:00", + "time": "2021-10-20T20:35:02+00:00", "type": "library", "extra": { "branch-alias": { @@ -1162,12 +1105,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1192,7 +1135,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" }, "funding": [ { @@ -1212,26 +1155,29 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2021-05-27T12:26:48+00:00", + "time": "2021-11-30T18:21:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -1244,12 +1190,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1275,7 +1221,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" }, "funding": [ { @@ -1295,23 +1241,23 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-07-28T13:41:28+00:00", + "time": "2021-09-13T13:58:33+00:00", "type": "library", "extra": { "branch-alias": { @@ -1324,12 +1270,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1361,7 +1307,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" }, "funding": [ { @@ -1381,54 +1327,54 @@ }, { "name": "symfony/translation", - "version": "v5.3.4", - "version_normalized": "5.3.4.0", + "version": "v6.0.5", + "version_normalized": "6.0.5.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1" + "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/d89ad7292932c2699cbe4af98d72c5c6bbc504c1", - "reference": "d89ad7292932c2699cbe4af98d72c5c6bbc504c1", + "url": "https://api.github.com/repos/symfony/translation/zipball/e69501c71107cc3146b32aaa45f4edd0c3427875", + "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "conflict": { - "symfony/config": "<4.4", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^4.4|^5.0", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^4.4|^5.0" + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^5.4|^6.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", "symfony/config": "", "symfony/yaml": "" }, - "time": "2021-07-25T09:39:16+00:00", + "time": "2022-02-09T15:52:48+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1459,7 +1405,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.4" + "source": "https://github.com/symfony/translation/tree/v6.0.5" }, "funding": [ { @@ -1479,30 +1425,30 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.4.0", - "version_normalized": "2.4.0.0", + "version": "v3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95" + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", - "reference": "95c812666f3e91db75385749fe219c5e494c7f95", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" }, - "time": "2021-03-23T23:28:01+00:00", + "time": "2021-09-07T12:43:40+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1540,7 +1486,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" }, "funding": [ { @@ -1560,32 +1506,32 @@ }, { "name": "symfony/var-dumper", - "version": "v5.3.6", - "version_normalized": "5.3.6.0", + "version": "v6.0.5", + "version_normalized": "6.0.5.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0" + "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0", - "reference": "3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/60d6a756d5f485df5e6e40b337334848f79f61ce", + "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" + "symfony/console": "<5.4" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", + "symfony/console": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, "suggest": { @@ -1593,7 +1539,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2021-07-27T01:56:02+00:00", + "time": "2022-02-21T17:15:17+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -1631,7 +1577,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.3.6" + "source": "https://github.com/symfony/var-dumper/tree/v6.0.5" }, "funding": [ { @@ -1651,29 +1597,29 @@ }, { "name": "tightenco/collect", - "version": "v8.34.0", - "version_normalized": "8.34.0.0", + "version": "v8.83.2", + "version_normalized": "8.83.2.0", "source": { "type": "git", "url": "https://github.com/tighten/collect.git", - "reference": "b069783ab0c547bb894ebcf8e7f6024bb401f9d2" + "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tighten/collect/zipball/b069783ab0c547bb894ebcf8e7f6024bb401f9d2", - "reference": "b069783ab0c547bb894ebcf8e7f6024bb401f9d2", + "url": "https://api.github.com/repos/tighten/collect/zipball/d9c66d586ec2d216d8a31283d73f8df1400cc722", + "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" + "php": "^7.3|^8.0", + "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { "mockery/mockery": "^1.0", "nesbot/carbon": "^2.23.0", "phpunit/phpunit": "^8.3" }, - "time": "2021-03-29T21:29:00+00:00", + "time": "2022-02-16T16:15:54+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1702,23 +1648,23 @@ ], "support": { "issues": "https://github.com/tighten/collect/issues", - "source": "https://github.com/tighten/collect/tree/v8.34.0" + "source": "https://github.com/tighten/collect/tree/v8.83.2" }, "install-path": "../tightenco/collect" }, { "name": "twig/twig", - "version": "v3.3.2", - "version_normalized": "3.3.2.0", + "version": "v3.3.8", + "version_normalized": "3.3.8.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790" + "reference": "972d8604a92b7054828b539f2febb0211dd5945c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/21578f00e83d4a82ecfa3d50752b609f13de6790", - "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/972d8604a92b7054828b539f2febb0211dd5945c", + "reference": "972d8604a92b7054828b539f2febb0211dd5945c", "shasum": "" }, "require": { @@ -1728,9 +1674,9 @@ }, "require-dev": { "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, - "time": "2021-05-16T12:14:13+00:00", + "time": "2022-02-04T06:59:48+00:00", "type": "library", "extra": { "branch-alias": { @@ -1771,7 +1717,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.2" + "source": "https://github.com/twigphp/Twig/tree/v3.3.8" }, "funding": [ { diff --git a/data/web/inc/lib/vendor/composer/installed.php b/data/web/inc/lib/vendor/composer/installed.php index cc343e04..9230ba25 100644 --- a/data/web/inc/lib/vendor/composer/installed.php +++ b/data/web/inc/lib/vendor/composer/installed.php @@ -1,22 +1,22 @@ <?php return array( 'root' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', + 'pretty_version' => '1.0.0+no-version-set', + 'version' => '1.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '1c2923a4ddd7f89b3cf38c9594db289b7dd756d3', + 'reference' => NULL, 'name' => '__root__', 'dev' => true, ), 'versions' => array( '__root__' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', + 'pretty_version' => '1.0.0+no-version-set', + 'version' => '1.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '1c2923a4ddd7f89b3cf38c9594db289b7dd756d3', + 'reference' => NULL, 'dev_requirement' => false, ), 'bshaffer/oauth2-server-php' => array( @@ -29,21 +29,21 @@ 'dev_requirement' => false, ), 'ddeboer/imap' => array( - 'pretty_version' => '1.12.1', - 'version' => '1.12.1.0', + 'pretty_version' => '1.13.1', + 'version' => '1.13.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../ddeboer/imap', 'aliases' => array(), - 'reference' => 'dbed05ca67b93509345a820b2859de10c48948fb', + 'reference' => '8b772d04b1deadb5df13782fb78c4b648f77496e', 'dev_requirement' => false, ), 'directorytree/ldaprecord' => array( - 'pretty_version' => 'v2.6.3', - 'version' => '2.6.3.0', + 'pretty_version' => 'v2.10.1', + 'version' => '2.10.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../directorytree/ldaprecord', 'aliases' => array(), - 'reference' => '5c93ec6d1ef458290825a8b0a148946dce7c1e7a', + 'reference' => 'bf512d9af7a7b0e2ed7a666ab29cefdd027bee88', 'dev_requirement' => false, ), 'exorus/php-mime-mail-parser' => array( @@ -53,12 +53,12 @@ ), ), 'illuminate/contracts' => array( - 'pretty_version' => 'v8.53.1', - 'version' => '8.53.1.0', + 'pretty_version' => 'v9.3.0', + 'version' => '9.3.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), - 'reference' => '504a34286a1b4c5421c43087d6bd4e176138f6fb', + 'reference' => 'bf4b3c254c49d28157645d01e4883b5951b1e1d0', 'dev_requirement' => false, ), 'matthiasmullie/minify' => array( @@ -95,12 +95,12 @@ 'dev_requirement' => false, ), 'nesbot/carbon' => array( - 'pretty_version' => '2.51.1', - 'version' => '2.51.1.0', + 'pretty_version' => '2.57.0', + 'version' => '2.57.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../nesbot/carbon', 'aliases' => array(), - 'reference' => '8619c299d1e0d4b344e1f98ca07a1ce2cfbf1922', + 'reference' => '4a54375c21eea4811dbd1149fe6b246517554e78', 'dev_requirement' => false, ), 'paragonie/random_compat' => array( @@ -122,48 +122,48 @@ 'dev_requirement' => false, ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.5.0', - 'version' => '6.5.0.0', + 'pretty_version' => 'v6.6.0', + 'version' => '6.6.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), - 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c', + 'reference' => 'e43bac82edc26ca04b36143a48bde1c051cfd5b1', 'dev_requirement' => false, ), 'psr/container' => array( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'dev_requirement' => false, ), 'psr/log' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'dev_requirement' => false, ), 'psr/simple-cache' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), - 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', + 'reference' => '8707bf3cea6f710bf6ef05491234e3ab06f6432a', 'dev_requirement' => false, ), 'robthree/twofactorauth' => array( - 'pretty_version' => '1.8.0', - 'version' => '1.8.0.0', + 'pretty_version' => '1.8.1', + 'version' => '1.8.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../robthree/twofactorauth', 'aliases' => array(), - 'reference' => '30a38627ae1e7c9399dae67e265063cd6ec5276c', + 'reference' => '5afcb45282f1c75562a48d479ecd1732c9bdb11b', 'dev_requirement' => false, ), 'soundasleep/html2text' => array( @@ -175,91 +175,82 @@ 'reference' => 'cdb89f6ffa2c4cc78f8ed9ea6ee0594a9133ccad', 'dev_requirement' => false, ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v2.4.0', - 'version' => '2.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => '5f38c8804a9e97d23e0c8d63341088cd8a22d627', - 'dev_requirement' => false, - ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), - 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', + 'reference' => '30885182c981ab175d4d034db0f6f469898070ab', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', + 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', + 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9', 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v5.3.4', - 'version' => '5.3.4.0', + 'pretty_version' => 'v6.0.5', + 'version' => '6.0.5.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), - 'reference' => 'd89ad7292932c2699cbe4af98d72c5c6bbc504c1', + 'reference' => 'e69501c71107cc3146b32aaa45f4edd0c3427875', 'dev_requirement' => false, ), 'symfony/translation-contracts' => array( - 'pretty_version' => 'v2.4.0', - 'version' => '2.4.0.0', + 'pretty_version' => 'v3.0.0', + 'version' => '3.0.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation-contracts', 'aliases' => array(), - 'reference' => '95c812666f3e91db75385749fe219c5e494c7f95', + 'reference' => '1b6ea5a7442af5a12dba3dbd6d71034b5b234e77', 'dev_requirement' => false, ), 'symfony/translation-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '2.3', + 0 => '2.3|3.0', ), ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v5.3.6', - 'version' => '5.3.6.0', + 'pretty_version' => 'v6.0.5', + 'version' => '6.0.5.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), - 'reference' => '3dd8ddd1e260e58ecc61bb78da3b6584b3bfcba0', + 'reference' => '60d6a756d5f485df5e6e40b337334848f79f61ce', 'dev_requirement' => false, ), 'tightenco/collect' => array( - 'pretty_version' => 'v8.34.0', - 'version' => '8.34.0.0', + 'pretty_version' => 'v8.83.2', + 'version' => '8.83.2.0', 'type' => 'library', 'install_path' => __DIR__ . '/../tightenco/collect', 'aliases' => array(), - 'reference' => 'b069783ab0c547bb894ebcf8e7f6024bb401f9d2', + 'reference' => 'd9c66d586ec2d216d8a31283d73f8df1400cc722', 'dev_requirement' => false, ), 'twig/twig' => array( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', + 'pretty_version' => 'v3.3.8', + 'version' => '3.3.8.0', 'type' => 'library', 'install_path' => __DIR__ . '/../twig/twig', 'aliases' => array(), - 'reference' => '21578f00e83d4a82ecfa3d50752b609f13de6790', + 'reference' => '972d8604a92b7054828b539f2febb0211dd5945c', 'dev_requirement' => false, ), 'yubico/u2flib-server' => array( diff --git a/data/web/inc/lib/vendor/composer/platform_check.php b/data/web/inc/lib/vendor/composer/platform_check.php index 580fa960..b168ddd5 100644 --- a/data/web/inc/lib/vendor/composer/platform_check.php +++ b/data/web/inc/lib/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70400)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80002)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/data/web/inc/lib/vendor/ddeboer/imap/.php-cs-fixer.php b/data/web/inc/lib/vendor/ddeboer/imap/.php-cs-fixer.php new file mode 100644 index 00000000..22b4ada2 --- /dev/null +++ b/data/web/inc/lib/vendor/ddeboer/imap/.php-cs-fixer.php @@ -0,0 +1,73 @@ +<?php + +declare(strict_types=1); + +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@DoctrineAnnotation' => true, + '@Symfony' => true, + '@Symfony:risky' => true, + '@PHPUnit75Migration:risky' => true, + '@PHP71Migration' => true, + '@PHP70Migration:risky' => true, // @TODO with next major version + 'align_multiline_comment' => ['comment_type' => 'all_multiline'], + 'array_indentation' => true, + 'array_syntax' => ['syntax' => 'short'], + 'binary_operator_spaces' => ['default' => 'align_single_space'], + 'blank_line_before_statement' => true, + 'class_definition' => ['single_item_single_line' => true], + 'compact_nullable_typehint' => true, + 'concat_space' => ['spacing' => 'one'], + 'echo_tag_syntax' => ['format' => 'long'], + 'error_suppression' => false, + 'escape_implicit_backslashes' => true, + 'explicit_indirect_variable' => true, + 'explicit_string_variable' => true, + 'fully_qualified_strict_types' => true, + 'heredoc_to_nowdoc' => true, + 'list_syntax' => ['syntax' => 'long'], + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], + 'method_chaining_indentation' => true, + 'multiline_comment_opening_closing' => true, + 'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'], + 'native_constant_invocation' => true, + 'native_function_invocation' => ['include' => ['@internal']], + 'no_alternative_syntax' => true, + 'no_break_comment' => true, + 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], + 'no_null_property_initialization' => true, + 'no_php4_constructor' => true, + 'no_superfluous_elseif' => true, + 'no_unneeded_curly_braces' => true, + 'no_unneeded_final_method' => true, + 'no_unreachable_default_argument_value' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_imports' => true, + 'php_unit_method_casing' => true, + 'php_unit_set_up_tear_down_visibility' => true, + 'php_unit_strict' => true, + 'php_unit_test_annotation' => true, + 'php_unit_test_case_static_method_calls' => true, + 'php_unit_test_class_requires_covers' => false, + 'phpdoc_add_missing_param_annotation' => true, + 'phpdoc_order' => true, + 'phpdoc_order_by_value' => true, + 'phpdoc_types_order' => true, + 'random_api_migration' => true, + 'semicolon_after_instruction' => true, + 'simplified_null_return' => true, + 'single_line_comment_style' => true, + 'single_line_throw' => false, + 'space_after_semicolon' => true, + 'static_lambda' => true, + 'strict_comparison' => true, + 'string_line_ending' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__ . '/src') + ->in(__DIR__ . '/tests') + ) +; diff --git a/data/web/inc/lib/vendor/ddeboer/imap/composer.json b/data/web/inc/lib/vendor/ddeboer/imap/composer.json index 92b4a07f..0bcf72af 100644 --- a/data/web/inc/lib/vendor/ddeboer/imap/composer.json +++ b/data/web/inc/lib/vendor/ddeboer/imap/composer.json @@ -1,12 +1,12 @@ { "name": "ddeboer/imap", "description": "Object-oriented IMAP for PHP", + "license": "MIT", "keywords": [ "email", "mail", "imap" ], - "license": "MIT", "authors": [ { "name": "David de Boer", @@ -22,18 +22,19 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0.1", "ext-iconv": "*", "ext-imap": "*", "ext-mbstring": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18.6", - "laminas/laminas-mail": "^2.14.0", - "phpstan/phpstan": "^0.12.84", - "phpstan/phpstan-phpunit": "^0.12.18", - "phpstan/phpstan-strict-rules": "^0.12.9", - "phpunit/phpunit": "^9.5.4" + "friendsofphp/php-cs-fixer": "^v3.4.0", + "laminas/laminas-mail": "^2.15.1", + "malukenho/mcbumpface": "^1.1.5", + "phpstan/phpstan": "^1.3.3", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.1.0", + "phpunit/phpunit": "^9.5.11" }, "autoload": { "psr-4": { @@ -44,5 +45,10 @@ "psr-4": { "Ddeboer\\Imap\\Tests\\": "tests/" } + }, + "config": { + "allow-plugins": { + "malukenho/mcbumpface": true + } } } diff --git a/data/web/inc/lib/vendor/ddeboer/imap/src/Connection.php b/data/web/inc/lib/vendor/ddeboer/imap/src/Connection.php index d9f2bb68..9f5ef90f 100644 --- a/data/web/inc/lib/vendor/ddeboer/imap/src/Connection.php +++ b/data/web/inc/lib/vendor/ddeboer/imap/src/Connection.php @@ -117,6 +117,7 @@ final class Connection implements ConnectionInterface return new Mailbox($this->resource, $name, $this->mailboxNames[$name]); } + #[\ReturnTypeWillChange] public function count() { $return = \imap_num_msg($this->resource->getStream()); diff --git a/data/web/inc/lib/vendor/ddeboer/imap/src/ImapResource.php b/data/web/inc/lib/vendor/ddeboer/imap/src/ImapResource.php index 123ea239..60d348a9 100644 --- a/data/web/inc/lib/vendor/ddeboer/imap/src/ImapResource.php +++ b/data/web/inc/lib/vendor/ddeboer/imap/src/ImapResource.php @@ -6,6 +6,7 @@ namespace Ddeboer\Imap; use Ddeboer\Imap\Exception\InvalidResourceException; use Ddeboer\Imap\Exception\ReopenMailboxException; +use IMAP\Connection; /** * An imap resource stream. @@ -22,7 +23,7 @@ final class ImapResource implements ImapResourceInterface /** * Constructor. * - * @param resource $resource + * @param Connection|resource $resource */ public function __construct($resource, MailboxInterface $mailbox = null) { @@ -32,7 +33,10 @@ final class ImapResource implements ImapResourceInterface public function getStream() { - if (false === \is_resource($this->resource) || 'imap' !== \get_resource_type($this->resource)) { + if ( + !$this->resource instanceof Connection + && (false === \is_resource($this->resource) || 'imap' !== \get_resource_type($this->resource)) + ) { throw new InvalidResourceException('Supplied resource is not a valid imap resource'); } @@ -55,8 +59,14 @@ final class ImapResource implements ImapResourceInterface return; } + \set_error_handler(static function (): bool { + return true; + }); + \imap_reopen($this->resource, $this->mailbox->getFullEncodedName()); + \restore_error_handler(); + if (self::isMailboxOpen($this->mailbox, $this->resource)) { return; } diff --git a/data/web/inc/lib/vendor/ddeboer/imap/src/Mailbox.php b/data/web/inc/lib/vendor/ddeboer/imap/src/Mailbox.php index 2f77799f..38823fee 100644 --- a/data/web/inc/lib/vendor/ddeboer/imap/src/Mailbox.php +++ b/data/web/inc/lib/vendor/ddeboer/imap/src/Mailbox.php @@ -64,6 +64,7 @@ final class Mailbox implements MailboxInterface return $this->info->delimiter; } + #[\ReturnTypeWillChange] public function count() { $return = \imap_num_msg($this->resource->getStream()); diff --git a/data/web/inc/lib/vendor/ddeboer/imap/src/Message/AbstractPart.php b/data/web/inc/lib/vendor/ddeboer/imap/src/Message/AbstractPart.php index 0ab0ca58..0647133c 100644 --- a/data/web/inc/lib/vendor/ddeboer/imap/src/Message/AbstractPart.php +++ b/data/web/inc/lib/vendor/ddeboer/imap/src/Message/AbstractPart.php @@ -268,6 +268,7 @@ abstract class AbstractPart implements PartInterface * * @return mixed */ + #[\ReturnTypeWillChange] final public function current() { $this->lazyParseStructure(); @@ -275,11 +276,13 @@ abstract class AbstractPart implements PartInterface return $this->parts[$this->key]; } + #[\ReturnTypeWillChange] final public function getChildren() { return $this->current(); } + #[\ReturnTypeWillChange] final public function hasChildren() { $this->lazyParseStructure(); @@ -290,21 +293,25 @@ abstract class AbstractPart implements PartInterface /** * @return int */ + #[\ReturnTypeWillChange] final public function key() { return $this->key; } + #[\ReturnTypeWillChange] final public function next() { ++$this->key; } + #[\ReturnTypeWillChange] final public function rewind() { $this->key = 0; } + #[\ReturnTypeWillChange] final public function valid() { $this->lazyParseStructure(); diff --git a/data/web/inc/lib/vendor/ddeboer/imap/src/Message/EmailAddress.php b/data/web/inc/lib/vendor/ddeboer/imap/src/Message/EmailAddress.php index 9f60fb14..4833487d 100644 --- a/data/web/inc/lib/vendor/ddeboer/imap/src/Message/EmailAddress.php +++ b/data/web/inc/lib/vendor/ddeboer/imap/src/Message/EmailAddress.php @@ -19,6 +19,7 @@ final class EmailAddress $this->mailbox = $mailbox; $this->hostname = $hostname; $this->name = $name; + $this->address = null; if (null !== $hostname) { $this->address = $mailbox . '@' . $hostname; diff --git a/data/web/inc/lib/vendor/ddeboer/imap/src/MessageIteratorInterface.php b/data/web/inc/lib/vendor/ddeboer/imap/src/MessageIteratorInterface.php index 36a79438..736084b1 100644 --- a/data/web/inc/lib/vendor/ddeboer/imap/src/MessageIteratorInterface.php +++ b/data/web/inc/lib/vendor/ddeboer/imap/src/MessageIteratorInterface.php @@ -9,7 +9,7 @@ use Ddeboer\Imap\Message\PartInterface; /** * @extends \Iterator<MessageInterface> */ -interface MessageIteratorInterface extends \Iterator +interface MessageIteratorInterface extends \Iterator, \Countable { /** * Get current message. diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml index ba002183..8c7b5314 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - php: [8.0, 7.4, 7.3] + php: [8.1, 8.0, 7.4, 7.3] name: ${{ matrix.os }} - P${{ matrix.php }} @@ -39,3 +39,40 @@ jobs: - name: Execute tests run: vendor/bin/phpunit + + run-analysis: + runs-on: ${{ matrix.os }} + name: Static code analysis (PHP ${{ matrix.php }}) + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + php: [8.0] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.composer/cache/files + key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ldap, json + coverage: none + tools: psalm + + - name: Validate composer.json + run: composer validate + + - name: Install dependencies + run: composer update --prefer-dist --no-interaction + + - name: Run Psalm + run: psalm diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.gitignore b/data/web/inc/lib/vendor/directorytree/ldaprecord/.gitignore index d5389fd6..e288894f 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/.gitignore +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.gitignore @@ -1,5 +1,6 @@ vendor composer.lock +psalm.phar .php_cs.cache .phpunit.result.cache .php-cs-fixer.cache \ No newline at end of file diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml b/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml index c7740212..9f5e38cf 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml @@ -1,4 +1,8 @@ preset: laravel enabled: - phpdoc_align + - phpdoc_separation - unalign_double_arrow +disabled: + - laravel_phpdoc_alignment + - laravel_phpdoc_separation diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json b/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json index 2e995d9d..35c60576 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json @@ -32,19 +32,21 @@ "php": ">=7.3", "ext-ldap": "*", "ext-json": "*", - "psr/log": "^1.0", - "psr/simple-cache": "^1.0", + "psr/log": "*", + "psr/simple-cache": "^1.0|^2.0", "nesbot/carbon": "^1.0|^2.0", "tightenco/collect": "^5.6|^6.0|^7.0|^8.0", - "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0" + "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0" }, "require-dev": { - "phpunit/phpunit": "^8.0", + "phpunit/phpunit": "^9.0", "mockery/mockery": "^1.0", "spatie/ray": "^1.24" }, "archive": { - "exclude": ["/tests"] + "exclude": [ + "/tests" + ] }, "autoload": { "psr-4": { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md b/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md index 08ecd9e7..505d6992 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md @@ -92,3 +92,13 @@ We've all been there -- accidentally deleting a user or group in Active Director <p align="center">If you discover a security vulnerability within LdapRecord, please send an e-mail to Steve Bauman via <a href="mailto:steven_bauman@outlook.com">steven_bauman@outlook.com</a>.</p> <p align="center">All security vulnerabilities will be promptly addressed.</p> + +--- + +<h3 align="center">Credits</h3> + +<p align="center">This package is directly inspired from <a href="https://laravel.com/docs/eloquent">Laravel's Eloquent</a>, and most features are direct ports to an LDAP equivalent.</p> + +<p align="center">I am forever grateful for the work <a href="https://github.com/taylorotwell">Taylor Otwell</a> has produced.</p> + +<p align="center">If you can, support his work by purchasing a <a href="https://github.com/sponsors/taylorotwell">sponsorship</a>, or one of his many Laravel based services.</p> diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php index 696cc40d..d41af156 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php @@ -54,10 +54,10 @@ class Guard * @param string $password * @param bool $stayBound * + * @return bool + * * @throws UsernameRequiredException * @throws PasswordRequiredException - * - * @return bool */ public function attempt($username, $password, $stayBound = false) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php index 1dcdd1a1..d1124bfc 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php @@ -124,9 +124,9 @@ class DomainConfiguration * * @param string $key * - * @throws ConfigurationException When the option specified does not exist. - * * @return mixed + * + * @throws ConfigurationException When the option specified does not exist. */ public function get($key) { @@ -155,9 +155,9 @@ class DomainConfiguration * @param string $key * @param mixed $value * - * @throws ConfigurationException When an option value given is an invalid type. - * * @return bool + * + * @throws ConfigurationException When an option value given is an invalid type. */ protected function validate($key, $value) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php index 908a6395..de2f13f5 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php @@ -49,9 +49,9 @@ abstract class Validator /** * Validate the configuration value. * - * @throws ConfigurationException - * * @return bool + * + * @throws ConfigurationException */ public function validate() { @@ -65,9 +65,9 @@ abstract class Validator /** * Throw a configuration exception. * - * @throws ConfigurationException - * * @return void + * + * @throws ConfigurationException */ protected function fail() { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php index 8ba0ef1d..d429aa46 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php @@ -111,9 +111,9 @@ class Connection * * @param array $config * - * @throws Configuration\ConfigurationException - * * @return $this + * + * @throws Configuration\ConfigurationException */ public function setConfiguration($config = []) { @@ -241,10 +241,10 @@ class Connection * @param string|null $username * @param string|null $password * + * @return Connection + * * @throws Auth\BindException * @throws LdapRecordException - * - * @return Connection */ public function connect($username = null, $password = null) { @@ -274,10 +274,10 @@ class Connection /** * Reconnect to the LDAP server. * + * @return void + * * @throws Auth\BindException * @throws ConnectionException - * - * @return void */ public function reconnect() { @@ -385,9 +385,9 @@ class Connection * * @param Closure $operation * - * @throws LdapRecordException - * * @return mixed + * + * @throws LdapRecordException */ protected function runOperationCallback(Closure $operation) { @@ -442,9 +442,9 @@ class Connection * @param LdapRecordException $e * @param Closure $operation * - * @throws LdapRecordException - * * @return mixed + * + * @throws LdapRecordException */ protected function tryAgainIfCausedByLostConnection(LdapRecordException $e, Closure $operation) { @@ -463,9 +463,9 @@ class Connection * * @param Closure $operation * - * @throws LdapRecordException - * * @return mixed + * + * @throws LdapRecordException */ protected function retry(Closure $operation) { @@ -486,9 +486,9 @@ class Connection * @param LdapRecordException $e * @param Closure $operation * - * @throws LdapRecordException - * * @return mixed + * + * @throws LdapRecordException */ protected function retryOnNextHost(LdapRecordException $e, Closure $operation) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php index 0eacbc3f..01b072b4 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php @@ -149,9 +149,9 @@ class ConnectionManager * * @param string|null $name * - * @throws ContainerException If the given connection does not exist. - * * @return Connection + * + * @throws ContainerException If the given connection does not exist. */ public function get($name = null) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php index f3840c28..b2082e59 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php @@ -39,11 +39,14 @@ class Logger { switch (true) { case $event instanceof AuthEvent: - return $this->auth($event); + $this->auth($event); + break; case $event instanceof ModelEvent: - return $this->model($event); + $this->model($event); + break; case $event instanceof QueryEvent: - return $this->query($event); + $this->query($event); + break; } } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php new file mode 100644 index 00000000..73b1f5a8 --- /dev/null +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php @@ -0,0 +1,113 @@ +<?php + +namespace LdapRecord\Events; + +class NullDispatcher implements DispatcherInterface +{ + /** + * The underlying dispatcher instance. + * + * @var DispatcherInterface + */ + protected $dispatcher; + + /** + * Constructor. + * + * @param DispatcherInterface $dispatcher + */ + public function __construct(DispatcherInterface $dispatcher) + { + $this->dispatcher = $dispatcher; + } + + /** + * Register an event listener with the dispatcher. + * + * @param string|array $events + * @param mixed $listener + * + * @return void + */ + public function listen($events, $listener) + { + $this->dispatcher->listen($events, $listener); + } + + /** + * Determine if a given event has listeners. + * + * @param string $eventName + * + * @return bool + */ + public function hasListeners($eventName) + { + return $this->dispatcher->hasListeners($eventName); + } + + /** + * Fire an event until the first non-null response is returned. + * + * @param string|object $event + * @param mixed $payload + * + * @return null + */ + public function until($event, $payload = []) + { + return null; + } + + /** + * Fire an event and call the listeners. + * + * @param string|object $event + * @param mixed $payload + * @param bool $halt + * + * @return null + */ + public function fire($event, $payload = [], $halt = false) + { + return null; + } + + /** + * Fire an event and call the listeners. + * + * @param string|object $event + * @param mixed $payload + * @param bool $halt + * + * @return null + */ + public function dispatch($event, $payload = [], $halt = false) + { + return null; + } + + /** + * Get all of the listeners for a given event name. + * + * @param string $eventName + * + * @return array + */ + public function getListeners($eventName) + { + return $this->dispatcher->getListeners($eventName); + } + + /** + * Remove a set of listeners from the dispatcher. + * + * @param string $event + * + * @return void + */ + public function forget($event) + { + $this->dispatcher->forget($event); + } +} diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php index 41334b68..9af7ad75 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php @@ -150,19 +150,21 @@ trait HandlesConnection * * @param Closure $operation * - * @throws LdapRecordException - * * @return mixed + * + * @throws LdapRecordException */ protected function executeFailableOperation(Closure $operation) { // If some older versions of PHP, errors are reported instead of throwing - // exceptions, which could be a signifcant detriment to our application. + // exceptions, which could be a significant detriment to our application. // Here, we will enforce these operations to throw exceptions instead. - set_error_handler(function ($severity, $message, $file, $line) { + set_error_handler(function (int $severity, string $message, string $file, int $line): bool { if (! $this->shouldBypassError($message)) { throw new ErrorException($message, $severity, $severity, $file, $line); } + + return true; }); try { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php index 6503cead..0c3574f1 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php @@ -2,6 +2,9 @@ namespace LdapRecord; +use LDAP\Connection as RawLdapConnection; + +/** @psalm-suppress UndefinedClass */ class Ldap implements LdapInterface { use HandlesConnection, DetectsErrors; @@ -104,7 +107,7 @@ class Ldap implements LdapInterface public function getLastError() { if (! $this->connection) { - return; + return null; } return ldap_error($this->connection); @@ -116,7 +119,7 @@ class Ldap implements LdapInterface public function getDetailedError() { if (! $number = $this->errNo()) { - return; + return null; } $this->getOption(LDAP_OPT_DIAGNOSTIC_MESSAGE, $message); @@ -202,7 +205,9 @@ class Ldap implements LdapInterface */ public function close() { - $result = is_resource($this->connection) ? @ldap_close($this->connection) : false; + $result = (is_resource($this->connection) || $this->connection instanceof RawLdapConnection) + ? @ldap_close($this->connection) + : false; $this->connection = null; $this->bound = false; @@ -214,7 +219,7 @@ class Ldap implements LdapInterface /** * @inheritdoc */ - public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []) + public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []) { return $this->executeFailableOperation(function () use ( $dn, @@ -235,7 +240,7 @@ class Ldap implements LdapInterface /** * @inheritdoc */ - public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []) + public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []) { return $this->executeFailableOperation(function () use ( $dn, @@ -256,7 +261,7 @@ class Ldap implements LdapInterface /** * @inheritdoc */ - public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []) + public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []) { return $this->executeFailableOperation(function () use ( $dn, diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php index a1773add..c74fe4e8 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php @@ -156,7 +156,7 @@ interface LdapInterface /** * Return detailed information about an error. * - * Returns false when there was a successful last request. + * Returns null when there was a successful last request. * * Returns DetailedError when there was an error. * @@ -202,9 +202,9 @@ interface LdapInterface * * @see http://php.net/manual/en/function.ldap-start-tls.php * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function startTLS(); @@ -247,7 +247,7 @@ interface LdapInterface * * @return resource */ - public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []); + public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []); /** * Performs a single level search on the current connection. @@ -265,7 +265,7 @@ interface LdapInterface * * @return resource */ - public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []); + public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []); /** * Reads an entry on the current connection. @@ -283,7 +283,7 @@ interface LdapInterface * * @return resource */ - public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []); + public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []); /** * Extract information from an LDAP result. @@ -292,10 +292,10 @@ interface LdapInterface * * @param resource $result * @param int $errorCode - * @param string $dn - * @param string $errorMessage - * @param array $referrals - * @param array $serverControls + * @param ?string $dn + * @param ?string $errorMessage + * @param ?array $referrals + * @param ?array $serverControls * * @return bool */ @@ -310,9 +310,9 @@ interface LdapInterface * @param string $username * @param string $password * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function bind($username, $password); @@ -324,9 +324,9 @@ interface LdapInterface * @param string $dn * @param array $entry * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function add($dn, array $entry); @@ -337,9 +337,9 @@ interface LdapInterface * * @param string $dn * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function delete($dn); @@ -353,9 +353,9 @@ interface LdapInterface * @param string $newParent * @param bool $deleteOldRdn * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function rename($dn, $newRdn, $newParent, $deleteOldRdn = false); @@ -367,9 +367,9 @@ interface LdapInterface * @param string $dn * @param array $entry * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function modify($dn, array $entry); @@ -381,9 +381,9 @@ interface LdapInterface * @param string $dn * @param array $values * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function modifyBatch($dn, array $values); @@ -395,9 +395,9 @@ interface LdapInterface * @param string $dn * @param array $entry * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function modAdd($dn, array $entry); @@ -409,9 +409,9 @@ interface LdapInterface * @param string $dn * @param array $entry * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function modReplace($dn, array $entry); @@ -423,9 +423,9 @@ interface LdapInterface * @param string $dn * @param array $entry * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function modDelete($dn, array $entry); diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php index 79a9d63d..652ad563 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php @@ -78,7 +78,7 @@ class Entry extends BaseEntry implements ActiveDirectory */ public function isDeleted() { - return strtoupper($this->getFirstAttribute('isDeleted')) === 'TRUE'; + return strtoupper((string) $this->getFirstAttribute('isDeleted')) === 'TRUE'; } /** @@ -86,9 +86,9 @@ class Entry extends BaseEntry implements ActiveDirectory * * @param string|null $newParentDn * - * @throws \LdapRecord\LdapRecordException - * * @return bool + * + * @throws \LdapRecord\LdapRecordException */ public function restore($newParentDn = null) { @@ -109,10 +109,9 @@ class Entry extends BaseEntry implements ActiveDirectory } }); - $this->save([ - 'isDeleted' => null, - 'distinguishedName' => $newDn, - ]); + $this->setRawAttribute('distinguishedname', $newDn); + + $this->save(['isDeleted' => null]); } /** @@ -120,9 +119,9 @@ class Entry extends BaseEntry implements ActiveDirectory * * @param string|null $connection * - * @throws \LdapRecord\Models\ModelNotFoundException - * * @return static + * + * @throws \LdapRecord\Models\ModelNotFoundException */ public static function getRootDse($connection = null) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Group.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Group.php index 6076f2fd..78458877 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Group.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Group.php @@ -63,7 +63,7 @@ class Group extends Entry */ public function getRidAttribute() { - $objectSidComponents = explode('-', $this->getConvertedSid()); + $objectSidComponents = explode('-', (string) $this->getConvertedSid()); return [end($objectSidComponents)]; } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php index 2b1a177b..9f2fbe4d 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php @@ -15,9 +15,9 @@ class InConfigurationContext implements Scope * @param Builder $query * @param Model $model * - * @throws \LdapRecord\Models\ModelNotFoundException - * * @return void + * + * @throws \LdapRecord\Models\ModelNotFoundException */ public function apply(Builder $query, Model $model) { @@ -29,9 +29,9 @@ class InConfigurationContext implements Scope * * @param Model $model * - * @throws \LdapRecord\Models\ModelNotFoundException - * * @return mixed + * + * @throws \LdapRecord\Models\ModelNotFoundException */ protected function getConfigurationNamingContext(Model $model) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php index 84dd74b7..b735b03b 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php @@ -2,6 +2,7 @@ namespace LdapRecord\Models\ActiveDirectory; +use Carbon\Carbon; use Illuminate\Contracts\Auth\Authenticatable; use LdapRecord\Models\ActiveDirectory\Concerns\HasPrimaryGroup; use LdapRecord\Models\ActiveDirectory\Scopes\RejectComputerObjectClass; @@ -117,4 +118,42 @@ class User extends Entry implements Authenticatable { return $query->whereHas('msExchMailboxGuid'); } + + /** + * Scopes the query to users having a lockout value set. + * + * @param Builder $query + * + * @return Builder + */ + public function scopeWhereHasLockout(Builder $query) + { + return $query->where('lockoutTime', '>=', 1); + } + + /** + * Determine if the user is locked out using the domains LockoutDuration group policy value. + * + * @see https://ldapwiki.com/wiki/Active%20Directory%20Account%20Lockout + * @see https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/account-lockout-duration + * + * @param string|int $localTimezone + * @param int|null $durationInMinutes + * + * @return bool + */ + public function isLockedOut($localTimezone, $durationInMinutes = null) + { + $time = $this->getFirstAttribute('lockouttime'); + + if (! $time instanceof Carbon) { + return false; + } + + is_int($localTimezone) + ? $time->addMinutes($localTimezone) + : $time->setTimezone($localTimezone)->addMinutes($durationInMinutes ?: 0); + + return ! $time->isPast(); + } } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php index 9c6240bc..7e241462 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php @@ -53,14 +53,14 @@ class AccountControl /** * The account control flag values. * - * @var array + * @var array<int, int> */ protected $values = []; /** * Constructor. * - * @param int $flag + * @param ?int $flag */ public function __construct($flag = null) { @@ -431,7 +431,7 @@ class AccountControl /** * Get the account control flag values. * - * @return array + * @return array<int, int> */ public function getValues() { @@ -441,7 +441,7 @@ class AccountControl /** * Set the account control values. * - * @param array $flags + * @param array<int, int> $flags * * @return void */ diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php index c092173e..c6977a8e 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php @@ -12,7 +12,7 @@ class DistinguishedName /** * The underlying raw value. * - * @var string|null + * @var string */ protected $value; @@ -23,7 +23,7 @@ class DistinguishedName */ public function __construct($value = null) { - $this->value = trim($value); + $this->value = trim((string) $value); } /** @@ -72,6 +72,18 @@ class DistinguishedName return new static($value); } + /** + * Determine if the given value is a valid distinguished name. + * + * @param string $value + * + * @return bool + */ + public static function isValid($value) + { + return ! static::make($value)->isEmpty(); + } + /** * Explode a distinguished name into relative distinguished names. * @@ -81,19 +93,19 @@ class DistinguishedName */ public static function explode($dn) { - $dn = ldap_explode_dn($dn, $withoutAttributes = false); + $components = ldap_explode_dn($dn, (int) $withoutAttributes = false); - if (! is_array($dn)) { + if (! is_array($components)) { return []; } - if (! array_key_exists('count', $dn)) { + if (! array_key_exists('count', $components)) { return []; } - unset($dn['count']); + unset($components['count']); - return $dn; + return $components; } /** @@ -310,6 +322,18 @@ class DistinguishedName return implode(',', $components) ?: null; } + /** + * Determine if the distinguished name is empty. + * + * @return bool + */ + public function isEmpty() + { + return empty( + array_filter($this->values()) + ); + } + /** * Determine if the current distinguished name is a parent of the given child. * diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php index 83dfe716..601902bf 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php @@ -236,7 +236,7 @@ class DistinguishedNameBuilder /** * Build the distinguished name from the components. * - * @return $this + * @return string */ protected function build() { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php index cc04a67d..2f611129 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php @@ -34,7 +34,7 @@ class EscapedValue */ public function __construct($value, $ignore = '', $flags = 0) { - $this->value = $value; + $this->value = (string) $value; $this->ignore = $ignore; $this->flags = $flags; } @@ -59,6 +59,16 @@ class EscapedValue return ldap_escape($this->value, $this->ignore, $this->flags); } + /** + * Get the raw (unescaped) value. + * + * @return mixed + */ + public function raw() + { + return $this->value; + } + /** * Set the characters to exclude from being escaped. * diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php index 7f0b4128..644f0a8d 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php @@ -244,9 +244,9 @@ class Password * * @param int $type * - * @throws InvalidArgumentException - * * @return array + * + * @throws InvalidArgumentException */ protected static function makeCryptPrefixAndLength($type) { @@ -297,9 +297,9 @@ class Password /** * Attempt to retrieve a salt from the encrypted password. * - * @throws LdapRecordException - * * @return string + * + * @throws LdapRecordException */ public static function getSalt($encryptedPassword) { @@ -321,9 +321,9 @@ class Password * * @param string $method * - * @throws \ReflectionException - * * @return bool + * + * @throws \ReflectionException */ public static function hashMethodRequiresSalt($method): bool { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php index abd656c8..e5d9dc34 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php @@ -61,9 +61,9 @@ class Timestamp * * @param mixed $value * - * @throws LdapRecordException - * * @return float|string + * + * @throws LdapRecordException */ public function fromDateTime($value) { @@ -121,9 +121,9 @@ class Timestamp * * @param mixed $value * - * @throws LdapRecordException - * * @return Carbon|false + * + * @throws LdapRecordException */ public function toDateTime($value) { @@ -155,7 +155,7 @@ class Timestamp * * @param string $value * - * @return DateTime|bool + * @return DateTime|false */ protected function convertLdapTimeToDateTime($value) { @@ -184,7 +184,7 @@ class Timestamp * * @param string $value * - * @return DateTime|bool + * @return DateTime|false */ protected function convertWindowsTimeToDateTime($value) { @@ -213,9 +213,9 @@ class Timestamp * * @param int $value * - * @throws \Exception + * @return DateTime|false * - * @return DateTime|bool + * @throws \Exception */ protected function convertWindowsIntegerTimeToDateTime($value) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php index f287454e..451738ab 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php @@ -31,6 +31,7 @@ trait CanAuthenticate */ public function getAuthPassword() { + return ''; } /** @@ -40,6 +41,7 @@ trait CanAuthenticate */ public function getRememberToken() { + return ''; } /** @@ -60,5 +62,6 @@ trait CanAuthenticate */ public function getRememberTokenName() { + return ''; } } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php index 20fcec02..b5f33357 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php @@ -238,26 +238,28 @@ trait HasAttributes * Returns the models attribute by its key. * * @param int|string $key + * @param mixed $default * * @return mixed */ - public function getAttribute($key) + public function getAttribute($key, $default = null) { if (! $key) { return; } - return $this->getAttributeValue($key); + return $this->getAttributeValue($key, $default); } /** * Get an attributes value. * * @param string $key + * @param mixed $default * * @return mixed */ - public function getAttributeValue($key) + public function getAttributeValue($key, $default = null) { $key = $this->normalizeAttributeKey($key); $value = $this->getAttributeFromArray($key); @@ -274,7 +276,7 @@ trait HasAttributes return $this->castAttribute($key, $value); } - return $value; + return is_null($value) ? $default : $value; } /** @@ -311,9 +313,9 @@ trait HasAttributes * @param string $type * @param mixed $value * - * @throws LdapRecordException - * * @return float|string + * + * @throws LdapRecordException */ public function fromDateTime($type, $value) { @@ -326,9 +328,9 @@ trait HasAttributes * @param mixed $value * @param string $type * - * @throws LdapRecordException - * * @return Carbon|false + * + * @throws LdapRecordException */ public function asDateTime($value, $type) { @@ -686,13 +688,14 @@ trait HasAttributes * Returns the first attribute by the specified key. * * @param string $key + * @param mixed $default * * @return mixed */ - public function getFirstAttribute($key) + public function getFirstAttribute($key, $default = null) { return Arr::first( - Arr::wrap($this->getAttribute($key)) + Arr::wrap($this->getAttribute($key, $default)), ); } @@ -707,10 +710,10 @@ trait HasAttributes } /** - * Set an attribute value by the specified key and sub-key. + * Set an attribute value by the specified key. * - * @param mixed $key - * @param mixed $value + * @param string $key + * @param mixed $value * * @return $this */ @@ -737,6 +740,23 @@ trait HasAttributes return $this; } + /** + * Set an attribute on the model. No checking is done. + * + * @param string $key + * @param mixed $value + * + * @return $this + */ + public function setRawAttribute($key, $value) + { + $key = $this->normalizeAttributeKey($key); + + $this->attributes[$key] = Arr::wrap($value); + + return $this; + } + /** * Set the models first attribute value. * diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php index 1bc76d09..5adec96e 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php @@ -3,10 +3,39 @@ namespace LdapRecord\Models\Concerns; use Closure; +use LdapRecord\Events\NullDispatcher; use LdapRecord\Models\Events\Event; trait HasEvents { + /** + * Execute the callback without raising any events. + * + * @param Closure $callback + * + * @return mixed + */ + protected static function withoutEvents(Closure $callback) + { + $container = static::getConnectionContainer(); + + $dispatcher = $container->getEventDispatcher(); + + if ($dispatcher) { + $container->setEventDispatcher( + new NullDispatcher($dispatcher) + ); + } + + try { + return $callback(); + } finally { + if ($dispatcher) { + $container->setEventDispatcher($dispatcher); + } + } + } + /** * Fires the specified model event. * diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php index c14abad2..f7552c1b 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php @@ -14,9 +14,9 @@ trait HasGlobalScopes * @param Scope|Closure|string $scope * @param Closure|null $implementation * - * @throws InvalidArgumentException - * * @return mixed + * + * @throws InvalidArgumentException */ public static function addGlobalScope($scope, Closure $implementation = null) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php index 98224566..1a938c14 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php @@ -159,9 +159,9 @@ trait HasPassword * @param string $password * @param string $salt * - * @throws LdapRecordException - * * @return string + * + * @throws LdapRecordException */ protected function getHashedPassword($method, $password, $salt = null) { @@ -179,9 +179,9 @@ trait HasPassword /** * Validates that the current LDAP connection is secure. * - * @throws ConnectionException - * * @return void + * + * @throws ConnectionException */ protected function validateSecureConnection() { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php index 6ba24b45..2e11696b 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php @@ -3,6 +3,7 @@ namespace LdapRecord\Models; use ArrayAccess; +use Illuminate\Contracts\Support\Arrayable; use InvalidArgumentException; use JsonSerializable; use LdapRecord\Connection; @@ -17,7 +18,7 @@ use LdapRecord\Support\Arr; use UnexpectedValueException; /** @mixin Builder */ -abstract class Model implements ArrayAccess, JsonSerializable +abstract class Model implements ArrayAccess, Arrayable, JsonSerializable { use EscapesValues; use Concerns\HasEvents; @@ -28,7 +29,7 @@ abstract class Model implements ArrayAccess, JsonSerializable use Concerns\HasRelationships; /** - * Indicates if the model exists in the LDAP directory. + * Indicates if the model exists in the directory. * * @var bool */ @@ -63,7 +64,7 @@ abstract class Model implements ArrayAccess, JsonSerializable protected $in; /** - * The object classes of the LDAP model. + * The object classes of the model. * * @var array */ @@ -77,7 +78,7 @@ abstract class Model implements ArrayAccess, JsonSerializable protected static $container; /** - * The LDAP connection name for the model. + * The connection name for the model. * * @var string|null */ @@ -138,7 +139,7 @@ abstract class Model implements ArrayAccess, JsonSerializable } /** - * The "booting" method of the model. + * The "boot" method of the model. * * @return void */ @@ -204,7 +205,7 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @param string $dn * - * @return static + * @return $this */ public function setDn($dn) { @@ -214,7 +215,31 @@ abstract class Model implements ArrayAccess, JsonSerializable } /** - * Get the LDAP connection for the model. + * A mutator for setting the models distinguished name. + * + * @param string $dn + * + * @return $this + */ + public function setDnAttribute($dn) + { + return $this->setRawAttribute('dn', $dn)->setDn($dn); + } + + /** + * A mutator for setting the models distinguished name. + * + * @param string $dn + * + * @return $this + */ + public function setDistinguishedNameAttribute($dn) + { + return $this->setRawAttribute('distinguishedname', $dn)->setDn($dn); + } + + /** + * Get the connection for the model. * * @return Connection */ @@ -275,6 +300,18 @@ abstract class Model implements ArrayAccess, JsonSerializable return static::query()->select($attributes)->paginate(); } + /** + * Make a new model instance. + * + * @param array $attributes + * + * @return static + */ + public static function make($attributes = []) + { + return new static($attributes); + } + /** * Begin querying the model. * @@ -501,6 +538,7 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return ! is_null($this->getAttribute($offset)); @@ -513,6 +551,7 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->getAttribute($offset); @@ -526,6 +565,7 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->setAttribute($offset, $value); @@ -538,6 +578,7 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->attributes[$offset]); @@ -568,15 +609,26 @@ abstract class Model implements ArrayAccess, JsonSerializable } /** - * Convert the object into something JSON serializable. + * Convert the model to its JSON encodeable array form. * * @return array */ - public function jsonSerialize() + public function toArray() { return $this->attributesToArray(); } + /** + * Convert the model's attributes into JSON encodeable values. + * + * @return array + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->toArray(); + } + /** * Converts extra attributes for JSON serialization. * @@ -615,17 +667,31 @@ abstract class Model implements ArrayAccess, JsonSerializable /** * Determine if two models have the same distinguished name and belong to the same connection. * - * @param static $model + * @param Model|null $model * * @return bool */ - public function is(self $model) + public function is($model) { - return $this->dn == $model->getDn() && $this->getConnectionName() == $model->getConnectionName(); + return ! is_null($model) + && $this->dn == $model->getDn() + && $this->getConnectionName() == $model->getConnectionName(); } /** - * Hydrate a new collection of models from LDAP search results. + * Determine if two models are not the same. + * + * @param Model|null $model + * + * @return bool + */ + public function isNot($model) + { + return ! $this->is($model); + } + + /** + * Hydrate a new collection of models from search results. * * @param array $records * @@ -714,9 +780,9 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @param array|BatchModification $mod * - * @throws InvalidArgumentException - * * @return $this + * + * @throws InvalidArgumentException */ public function addModification($mod = []) { @@ -818,7 +884,7 @@ abstract class Model implements ArrayAccess, JsonSerializable /** * Get the model's object GUID key. * - * @return void + * @return string */ public function getObjectGuidKey() { @@ -942,14 +1008,30 @@ abstract class Model implements ArrayAccess, JsonSerializable return $this; } + /** + * Save the model to the directory without raising any events. + * + * @param array $attributes + * + * @return void + * + * @throws \LdapRecord\LdapRecordException + */ + public function saveQuietly(array $attributes = []) + { + static::withoutEvents(function () use ($attributes) { + $this->save($attributes); + }); + } + /** * Save the model to the directory. * * @param array $attributes The attributes to update or create for the current entry. * - * @throws \LdapRecord\LdapRecordException - * * @return void + * + * @throws \LdapRecord\LdapRecordException */ public function save(array $attributes = []) { @@ -967,9 +1049,9 @@ abstract class Model implements ArrayAccess, JsonSerializable /** * Inserts the model into the directory. * - * @throws \LdapRecord\LdapRecordException - * * @return void + * + * @throws \LdapRecord\LdapRecordException */ protected function performInsert() { @@ -1009,9 +1091,9 @@ abstract class Model implements ArrayAccess, JsonSerializable /** * Updates the model in the directory. * - * @throws \LdapRecord\LdapRecordException - * * @return void + * + * @throws \LdapRecord\LdapRecordException */ protected function performUpdate() { @@ -1035,9 +1117,9 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @param array $attributes The attributes for the new entry. * - * @throws \LdapRecord\LdapRecordException - * * @return Model + * + * @throws \LdapRecord\LdapRecordException */ public static function create(array $attributes = []) { @@ -1054,14 +1136,14 @@ abstract class Model implements ArrayAccess, JsonSerializable * @param string $attribute The attribute to create * @param mixed $value The value of the new attribute * + * @return void + * * @throws ModelDoesNotExistException * @throws \LdapRecord\LdapRecordException - * - * @return void */ public function createAttribute($attribute, $value) { - $this->validateExistence(); + $this->requireExistence(); $this->newQuery()->insertAttributes($this->dn, [$attribute => (array) $value]); @@ -1073,14 +1155,14 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @param array $attributes The attributes to update for the current entry. * + * @return void + * * @throws ModelDoesNotExistException * @throws \LdapRecord\LdapRecordException - * - * @return void */ public function update(array $attributes = []) { - $this->validateExistence(); + $this->requireExistence(); $this->save($attributes); } @@ -1091,14 +1173,14 @@ abstract class Model implements ArrayAccess, JsonSerializable * @param string $attribute The attribute to modify * @param mixed $value The new value for the attribute * + * @return void + * * @throws ModelDoesNotExistException * @throws \LdapRecord\LdapRecordException - * - * @return void */ public function updateAttribute($attribute, $value) { - $this->validateExistence(); + $this->requireExistence(); $this->newQuery()->updateAttributes($this->dn, [$attribute => (array) $value]); @@ -1111,9 +1193,9 @@ abstract class Model implements ArrayAccess, JsonSerializable * @param Collection|array|string $dns * @param bool $recursive * - * @throws \LdapRecord\LdapRecordException - * * @return int + * + * @throws \LdapRecord\LdapRecordException */ public static function destroy($dns, $recursive = false) { @@ -1144,14 +1226,14 @@ abstract class Model implements ArrayAccess, JsonSerializable * * @param bool $recursive Whether to recursively delete leaf nodes (models that are children). * + * @return void + * * @throws ModelDoesNotExistException * @throws \LdapRecord\LdapRecordException - * - * @return void */ public function delete($recursive = false) { - $this->validateExistence(); + $this->requireExistence(); $this->fireModelEvent(new Events\Deleting($this)); @@ -1172,18 +1254,17 @@ abstract class Model implements ArrayAccess, JsonSerializable /** * Deletes leaf nodes that are attached to the model. * - * @throws \LdapRecord\LdapRecordException + * @return void * - * @return Collection + * @throws \LdapRecord\LdapRecordException */ protected function deleteLeafNodes() { - return $this->newQueryWithoutScopes() + $this->newQueryWithoutScopes() ->in($this->dn) ->listing() - ->paginate() - ->each(function (self $model) { - $model->delete($recursive = true); + ->chunk(250, function ($models) { + $models->each->delete($recursive = true); }); } @@ -1200,14 +1281,14 @@ abstract class Model implements ArrayAccess, JsonSerializable * * ["memberuid" => []] * + * @return void + * * @throws ModelDoesNotExistException * @throws \LdapRecord\LdapRecordException - * - * @return void */ public function deleteAttribute($attributes) { - $this->validateExistence(); + $this->requireExistence(); $attributes = $this->makeDeletableAttributes($attributes); @@ -1261,15 +1342,15 @@ abstract class Model implements ArrayAccess, JsonSerializable * @param static|string $newParentDn The new parent of the current model. * @param bool $deleteOldRdn Whether to delete the old models relative distinguished name once renamed / moved. * + * @return void + * * @throws UnexpectedValueException * @throws ModelDoesNotExistException * @throws \LdapRecord\LdapRecordException - * - * @return void */ public function move($newParentDn, $deleteOldRdn = true) { - $this->validateExistence(); + $this->requireExistence(); if (! $rdn = $this->getRdn()) { throw new UnexpectedValueException('Current model does not contain an RDN to move.'); @@ -1285,14 +1366,14 @@ abstract class Model implements ArrayAccess, JsonSerializable * @param static|string|null $newParentDn The models new parent distinguished name (if moving). Leave this null if you are only renaming. Example: "ou=MovedUsers,dc=acme,dc=org" * @param bool|true $deleteOldRdn Whether to delete the old models relative distinguished name once renamed / moved. * + * @return void + * * @throws ModelDoesNotExistException * @throws \LdapRecord\LdapRecordException - * - * @return void */ public function rename($rdn, $newParentDn = null, $deleteOldRdn = true) { - $this->validateExistence(); + $this->requireExistence(); if ($newParentDn instanceof self) { $newParentDn = $newParentDn->getDn(); @@ -1312,6 +1393,13 @@ abstract class Model implements ArrayAccess, JsonSerializable return; } + // If the RDN we have been given is empty when parsed, we must + // have been given a string, with no attribute. In this case, + // we will create a new RDN using the current DN's head. + if ($this->newDn($rdn)->isEmpty()) { + $rdn = $this->getUpdateableRdn($rdn); + } + $this->fireModelEvent(new Renaming($this, $rdn, $newParentDn)); $this->newQuery()->rename($this->dn, $rdn, $newParentDn, $deleteOldRdn); @@ -1337,6 +1425,18 @@ abstract class Model implements ArrayAccess, JsonSerializable $this->wasRecentlyRenamed = true; } + /** + * Get an updateable RDN for the model. + * + * @param string $name + * + * @return string + */ + public function getUpdateableRdn($name) + { + return $this->getCreatableRdn($name, $this->newDn($this->dn)->head()); + } + /** * Get a distinguished name that is creatable for the model. * @@ -1426,13 +1526,13 @@ abstract class Model implements ArrayAccess, JsonSerializable } /** - * Validates that the current model exists. - * - * @throws ModelDoesNotExistException + * Throw an exception if the model does not exist. * * @return void + * + * @throws ModelDoesNotExistException */ - protected function validateExistence() + protected function requireExistence() { if (! $this->exists || is_null($this->dn)) { throw ModelDoesNotExistException::forModel($this); diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php index d8dfa08c..ae36720c 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php @@ -284,9 +284,9 @@ class HasMany extends OneToMany * * @param string $model * - * @throws ModelNotFoundException - * * @return Model + * + * @throws ModelNotFoundException */ protected function getForeignModelByValueOrFail($model) { @@ -309,9 +309,9 @@ class HasMany extends OneToMany * @param string|array $bypass * @param mixed $value * - * @throws LdapRecordException - * * @return mixed + * + * @throws LdapRecordException */ protected function attemptFailableOperation($operation, $bypass, $value) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php index 9a9b2f9b..7bad4ab6 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php @@ -27,9 +27,9 @@ class HasOne extends Relation * * @param Model|string $model * - * @throws \LdapRecord\LdapRecordException - * * @return Model|string + * + * @throws \LdapRecord\LdapRecordException */ public function attach($model) { @@ -45,9 +45,9 @@ class HasOne extends Relation /** * Detach the related model from the parent. * - * @throws \LdapRecord\LdapRecordException - * * @return void + * + * @throws \LdapRecord\LdapRecordException */ public function detach() { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php index d0a407cc..6d14c857 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php @@ -49,7 +49,7 @@ abstract class OneToMany extends Relation /** * Set the relation to load with its parent. * - * @param OneToMany $relation + * @param Relation $relation * * @return $this */ diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php index c75afa2e..b9e31960 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php @@ -6,6 +6,7 @@ use BadMethodCallException; use Closure; use DateTimeInterface; use InvalidArgumentException; +use LDAP\Result; use LdapRecord\Connection; use LdapRecord\Container; use LdapRecord\EscapesValues; @@ -19,6 +20,7 @@ use LdapRecord\Query\Pagination\Paginator; use LdapRecord\Support\Arr; use LdapRecord\Utilities; +/** @psalm-suppress UndefinedClass */ class Builder { use EscapesValues; @@ -48,6 +50,13 @@ class Builder */ public $controls = []; + /** + * The LDAP server controls that were processed. + * + * @var array + */ + public $controlsResponse = []; + /** * The size limit of the query. * @@ -238,12 +247,12 @@ class Builder * * After running the callback, the columns are reset to the original value. * - * @param array $columns - * @param callable $callback + * @param array $columns + * @param Closure $callback * * @return mixed */ - protected function onceWithColumns($columns, $callback) + protected function onceWithColumns($columns, Closure $callback) { $original = $this->columns; @@ -383,8 +392,8 @@ class Builder { return str_replace( '{base}', - $this->baseDn, - $dn instanceof Model ? $dn->getDn() : $dn + $this->baseDn ?: '', + (string) ($dn instanceof Model ? $dn->getDn() : $dn) ); } @@ -500,6 +509,25 @@ class Builder }); } + /** + * Execute a callback over each item while chunking. + * + * @param Closure $callback + * @param int $count + * + * @return bool + */ + public function each(Closure $callback, $count = 1000) + { + return $this->chunk($count, function ($results) use ($callback) { + foreach ($results as $key => $value) { + if ($callback($value, $key) === false) { + return false; + } + } + }); + } + /** * Chunk the results of a paginated LDAP query. * @@ -507,7 +535,7 @@ class Builder * @param Closure $callback * @param bool $isCritical * - * @return void + * @return bool */ public function chunk($pageSize, Closure $callback, $isCritical = false) { @@ -515,11 +543,19 @@ class Builder $query = $this->getQuery(); + $page = 1; + foreach ($this->runChunk($query, $pageSize, $isCritical) as $chunk) { - $callback($this->process($chunk)); + if ($callback($this->process($chunk), $page) === false) { + return false; + } + + $page++; } $this->logQuery($this, 'chunk', $this->getElapsedTime($start)); + + return true; } /** @@ -549,7 +585,11 @@ class Builder { unset($results['count']); - return $this->paginated ? $this->flattenPages($results) : $results; + if ($this->paginated) { + return $this->flattenPages($results); + } + + return $results; } /** @@ -582,9 +622,7 @@ class Builder */ protected function getCachedResponse($query, Closure $callback) { - // If caching is enabled and we have a cache instance available, - // we will try to retrieve the cached results instead. - if ($this->caching && $this->cache) { + if ($this->cache && $this->caching) { $key = $this->getCacheKey($query); if ($this->flushCache) { @@ -594,7 +632,6 @@ class Builder return $this->cache->remember($key, $this->cacheUntil, $callback); } - // Otherwise, we will simply execute the callback. return $callback(); } @@ -642,10 +679,25 @@ class Builder } return $this->connection->run(function (LdapInterface $ldap) use ($resource) { + $this->controlsResponse = $this->controls; + + $errorCode = 0; + $dn = $errorMessage = $refs = null; + + // Process the server controls response. + $ldap->parseResult( + $resource, + $errorCode, + $dn, + $errorMessage, + $refs, + $this->controlsResponse + ); + $entries = $ldap->getEntries($resource); // Free up memory. - if (is_resource($resource)) { + if (is_resource($resource) || $resource instanceof Result) { $ldap->freeResult($resource); } @@ -684,7 +736,9 @@ class Builder */ public function first($columns = ['*']) { - return Arr::get($this->limit(1)->get($columns), 0); + return Arr::first( + $this->limit(1)->get($columns) + ); } /** @@ -694,9 +748,9 @@ class Builder * * @param array|string $columns * - * @throws ObjectNotFoundException + * @return Model|array * - * @return Model|static + * @throws ObjectNotFoundException */ public function firstOrFail($columns = ['*']) { @@ -707,6 +761,75 @@ class Builder return $record; } + /** + * Return the first entry in a result, or execute the callback. + * + * @param Closure $callback + * + * @return Model|mixed + */ + public function firstOr(Closure $callback) + { + return $this->first() ?: $callback(); + } + + /** + * Execute the query and get the first result if it's the sole matching record. + * + * @param array|string $columns + * + * @return Model|array + * + * @throws ObjectsNotFoundException + * @throws MultipleObjectsFoundException + */ + public function sole($columns = ['*']) + { + $result = $this->limit(2)->get($columns); + + if (empty($result)) { + throw new ObjectsNotFoundException; + } + + if (count($result) > 1) { + throw new MultipleObjectsFoundException; + } + + return reset($result); + } + + /** + * Determine if any results exist for the current query. + * + * @return bool + */ + public function exists() + { + return ! is_null($this->first()); + } + + /** + * Determine if no results exist for the current query. + * + * @return bool + */ + public function doesntExist() + { + return ! $this->exists(); + } + + /** + * Execute the given callback if no rows exist for the current query. + * + * @param Closure $callback + * + * @return bool|mixed + */ + public function existsOr(Closure $callback) + { + return $this->exists() ? true : $callback(); + } + /** * Throws a not found exception. * @@ -747,9 +870,9 @@ class Builder * @param string $value * @param array|string $columns * - * @throws ObjectNotFoundException - * * @return Model + * + * @throws ObjectNotFoundException */ public function findByOrFail($attribute, $value, $columns = ['*']) { @@ -830,9 +953,9 @@ class Builder * @param string $dn * @param array|string $columns * - * @throws ObjectNotFoundException - * * @return Model|static + * + * @throws ObjectNotFoundException */ public function findOrFail($dn, $columns = ['*']) { @@ -876,6 +999,33 @@ class Builder return $this; } + /** + * Add an order by control to the query. + * + * @param string $attribute + * @param string $direction + * + * @return $this + */ + public function orderBy($attribute, $direction = 'asc') + { + return $this->addControl(LDAP_CONTROL_SORTREQUEST, true, [ + ['attr' => $attribute, 'reverse' => $direction === 'desc'], + ]); + } + + /** + * Add an order by descending control to the query. + * + * @param string $attribute + * + * @return $this + */ + public function orderByDesc($attribute) + { + return $this->orderBy($attribute, 'desc'); + } + /** * Adds a raw filter to the current query. * @@ -951,9 +1101,9 @@ class Builder * @param string $boolean * @param bool $raw * - * @throws InvalidArgumentException - * * @return $this + * + * @throws InvalidArgumentException */ public function where($field, $operator = null, $value = null, $boolean = 'and', $raw = false) { @@ -1414,9 +1564,9 @@ class Builder * @param string $type The type of filter to add. * @param array $bindings The bindings of the filter. * - * @throws InvalidArgumentException - * * @return $this + * + * @throws InvalidArgumentException */ public function addFilter($type, array $bindings) { @@ -1610,9 +1760,9 @@ class Builder * @param string $dn * @param array $attributes * - * @throws LdapRecordException - * * @return bool + * + * @throws LdapRecordException */ public function insert($dn, array $attributes) { @@ -1728,9 +1878,9 @@ class Builder * @param string $method * @param array $parameters * - * @throws BadMethodCallException - * * @return mixed + * + * @throws BadMethodCallException */ public function __call($method, $parameters) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Collection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Collection.php index a02146dc..036affa2 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Collection.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Collection.php @@ -13,6 +13,7 @@ class Collection extends BaseCollection protected function valueRetriever($value) { if ($this->useAsCallable($value)) { + /** @var callable $value */ return $value; } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php index f13ddeb3..4f17ea2a 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php @@ -9,14 +9,14 @@ class QueryExecuted /** * The LDAP filter that was used for the query. * - * @var string + * @var Builder */ protected $query; /** * The number of milliseconds it took to execute the query. * - * @var float + * @var ?float */ protected $time; diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php index 3217173e..35a6c484 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php @@ -506,9 +506,9 @@ class Grammar * * @param array $where * - * @throws UnexpectedValueException - * * @return string + * + * @throws UnexpectedValueException */ protected function compileWhere(array $where) { @@ -522,9 +522,9 @@ class Grammar * * @param string $operator * - * @throws UnexpectedValueException - * * @return string + * + * @throws UnexpectedValueException */ protected function makeCompileMethod($operator) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php index 8923015e..c3911d80 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php @@ -34,9 +34,9 @@ class ActiveDirectoryBuilder extends Builder * @param string $sid * @param array|string $columns * - * @throws ModelNotFoundException - * * @return \LdapRecord\Models\ActiveDirectory\Entry|static + * + * @throws ModelNotFoundException */ public function findBySidOrFail($sid, $columns = []) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php index eed5e91e..234dd0ad 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php @@ -181,9 +181,9 @@ class Builder extends BaseBuilder * @param string $value * @param array|string $columns * - * @throws ModelNotFoundException - * * @return Model + * + * @throws ModelNotFoundException */ public function findByAnrOrFail($value, $columns = ['*']) { @@ -271,9 +271,9 @@ class Builder extends BaseBuilder * @param string $guid * @param array|string $columns * - * @throws ModelNotFoundException - * * @return Model|static + * + * @throws ModelNotFoundException */ public function findByGuidOrFail($guid, $columns = ['*']) { @@ -434,7 +434,7 @@ class Builder extends BaseBuilder if (! $this->model->isDateAttribute($field)) { throw new \UnexpectedValueException( "Cannot convert field [$field] to an LDAP timestamp. You must add this field as a model date." - .' Refer to https://ldaprecord.com/docs/model-mutators/#date-mutators' + .' Refer to https://ldaprecord.com/docs/core/v2/model-mutators/#date-mutators' ); } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/MultipleObjectsFoundException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/MultipleObjectsFoundException.php new file mode 100644 index 00000000..0ece752c --- /dev/null +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/MultipleObjectsFoundException.php @@ -0,0 +1,9 @@ +<?php + +namespace LdapRecord\Query; + +use LdapRecord\LdapRecordException; + +class MultipleObjectsFoundException extends LdapRecordException +{ +} diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php index b2dec28c..c22563cf 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php @@ -23,8 +23,8 @@ class ObjectNotFoundException extends LdapRecordException /** * Create a new exception for the executed filter. * - * @param string $query - * @param null $baseDn + * @param string $query + * @param ?string $baseDn * * @return static */ diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectsNotFoundException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectsNotFoundException.php new file mode 100644 index 00000000..a9846005 --- /dev/null +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectsNotFoundException.php @@ -0,0 +1,9 @@ +<?php + +namespace LdapRecord\Query; + +use LdapRecord\LdapRecordException; + +class ObjectsNotFoundException extends LdapRecordException +{ +} diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php index 3dfd3f12..e2b04824 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php @@ -71,13 +71,25 @@ abstract class AbstractPaginator $this->updateServerControls($ldap, $resource); $pages[] = $this->query->parse($resource); - } while (! empty($this->fetchCookie())); + } while ($this->shouldContinue()); $this->resetServerControls($ldap); return $pages; } + /** + * Whether the paginater should continue iterating. + * + * @return bool + */ + protected function shouldContinue() + { + $cookie = (string) $this->fetchCookie(); + + return $cookie !== ''; + } + /** * Fetch the pagination cookie. * @@ -106,7 +118,7 @@ abstract class AbstractPaginator * * @param LdapInterface $ldap * - * @return mixed + * @return void */ abstract protected function resetServerControls(LdapInterface $ldap); diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php index 2974b8fd..b9df77e4 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php @@ -11,7 +11,7 @@ class LazyPaginator extends Paginator * * @param LdapInterface $ldap * - * @return Generator + * @return \Generator */ public function execute(LdapInterface $ldap) { @@ -27,7 +27,7 @@ class LazyPaginator extends Paginator $this->updateServerControls($ldap, $resource); yield $this->query->parse($resource); - } while (! empty($this->fetchCookie())); + } while ($this->shouldContinue()); $this->resetServerControls($ldap); } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/Paginator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/Paginator.php index 9ab6e670..c0a31afd 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/Paginator.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/Paginator.php @@ -37,7 +37,9 @@ class Paginator extends AbstractPaginator */ protected function updateServerControls(LdapInterface $ldap, $resource) { - $errorCode = $dn = $errorMessage = $refs = null; + $errorCode = 0; + $dn = $errorMessage = $refs = null; + $controls = $this->query->controls; $ldap->parseResult( $resource, @@ -45,20 +47,15 @@ class Paginator extends AbstractPaginator $dn, $errorMessage, $refs, - $this->query->controls + $controls ); - $this->resetPageSize(); - } + $cookie = $controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? ''; - /** - * Reset the page control page size. - * - * @return void - */ - protected function resetPageSize() - { - $this->query->controls[LDAP_CONTROL_PAGEDRESULTS]['value']['size'] = $this->perPage; + $this->query->controls[LDAP_CONTROL_PAGEDRESULTS]['value'] = [ + 'size' => $this->perPage, + 'cookie' => $cookie, + ]; } /** @@ -66,6 +63,6 @@ class Paginator extends AbstractPaginator */ protected function resetServerControls(LdapInterface $ldap) { - $this->query->controls = []; + unset($this->query->controls[LDAP_CONTROL_PAGEDRESULTS]); } } diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php index 70640af9..9d50dcdf 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php @@ -11,9 +11,9 @@ class DirectoryFake * * @param string|null $name * - * @throws \LdapRecord\ContainerException - * * @return ConnectionFake + * + * @throws \LdapRecord\ContainerException */ public static function setup($name = null) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php index 7ba0e153..00470e14 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php @@ -2,6 +2,7 @@ namespace LdapRecord\Testing; +use Closure; use Exception; use LdapRecord\DetailedError; use LdapRecord\DetectsErrors; @@ -81,11 +82,14 @@ class LdapFake implements LdapInterface $expectations = Arr::wrap($expectations); foreach ($expectations as $key => $expectation) { - // If the key is non-numeric, we will assume - // that the string is the method name and - // the expectation is the return value. - if (! is_numeric($key)) { - $expectation = static::operation($key)->andReturn($expectation); + if (! is_int($key)) { + $operation = static::operation($key); + + $expectation instanceof Closure + ? $expectation($operation) + : $operation->andReturn($expectation); + + $expectation = $operation; } if (! $expectation instanceof LdapExpectation) { @@ -322,7 +326,7 @@ class LdapFake implements LdapInterface /** * @inheritdoc */ - public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []) + public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []) { return $this->resolveExpectation('search', func_get_args()); } @@ -330,7 +334,7 @@ class LdapFake implements LdapInterface /** * @inheritdoc */ - public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []) + public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []) { return $this->resolveExpectation('listing', func_get_args()); } @@ -338,7 +342,7 @@ class LdapFake implements LdapInterface /** * @inheritdoc */ - public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = null, $serverControls = []) + public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []) { return $this->resolveExpectation('read', func_get_args()); } @@ -453,9 +457,9 @@ class LdapFake implements LdapInterface * @param string $method * @param array $args * - * @throws Exception - * * @return mixed + * + * @throws Exception */ protected function resolveExpectation($method, array $args = []) { diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php index 0f0ca3c7..01d55c79 100644 --- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php +++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php @@ -112,7 +112,7 @@ class Utilities */ public static function binaryGuidToString($binGuid) { - if (trim($binGuid) == '' || is_null($binGuid)) { + if (is_null($binGuid) || trim($binGuid) == '') { return; } @@ -179,7 +179,7 @@ class Utilities */ public static function isValidSid($sid) { - return (bool) preg_match("/^S-\d(-\d{1,10}){1,16}$/i", $sid); + return (bool) preg_match("/^S-\d(-\d{1,10}){1,16}$/i", (string) $sid); } /** @@ -191,6 +191,6 @@ class Utilities */ public static function isValidGuid($guid) { - return (bool) preg_match('/^([0-9a-fA-F]){8}(-([0-9a-fA-F]){4}){3}-([0-9a-fA-F]){12}$/', $guid); + return (bool) preg_match('/^([0-9a-fA-F]){8}(-([0-9a-fA-F]){4}){3}-([0-9a-fA-F]){12}$/', (string) $guid); } } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Auth/Guard.php b/data/web/inc/lib/vendor/illuminate/contracts/Auth/Guard.php index 2a27fb5f..2796f1ae 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Auth/Guard.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Auth/Guard.php @@ -40,6 +40,13 @@ interface Guard */ public function validate(array $credentials = []); + /** + * Determine if the guard has a user instance. + * + * @return bool + */ + public function hasUser(); + /** * Set the current user. * diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php b/data/web/inc/lib/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php index 47b1c089..683a9030 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php @@ -8,7 +8,7 @@ interface PasswordBrokerFactory * Get a password broker instance by name. * * @param string|null $name - * @return mixed + * @return \Illuminate\Contracts\Auth\PasswordBroker */ public function broker($name = null); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/Broadcaster.php b/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/Broadcaster.php index 1034e440..2d317d0a 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/Broadcaster.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/Broadcaster.php @@ -28,6 +28,8 @@ interface Broadcaster * @param string $event * @param array $payload * @return void + * + * @throws \Illuminate\Broadcasting\BroadcastException */ public function broadcast(array $channels, $event, array $payload = []); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php b/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php index a4802fe4..3dc4662c 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php @@ -7,7 +7,7 @@ interface ShouldBroadcast /** * Get the channels the event should broadcast on. * - * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[] + * @return \Illuminate\Broadcasting\Channel|\Illuminate\Broadcasting\Channel[]|string[]|string */ public function broadcastOn(); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php b/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php index 1b8bb640..7d7f2c96 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php @@ -81,6 +81,24 @@ interface Container extends ContainerInterface */ public function singletonIf($abstract, $concrete = null); + /** + * Register a scoped binding in the container. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function scoped($abstract, $concrete = null); + + /** + * Register a scoped binding if it hasn't already been registered. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function scopedIf($abstract, $concrete = null); + /** * "Extend" an abstract type in the container. * @@ -163,6 +181,15 @@ interface Container extends ContainerInterface */ public function resolved($abstract); + /** + * Register a new before resolving callback. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + */ + public function beforeResolving($abstract, Closure $callback = null); + /** * Register a new resolving callback. * diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php b/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php index 05e36253..1fc7fc15 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php @@ -15,7 +15,7 @@ interface ContextualBindingBuilder /** * Define the implementation for the contextual binding. * - * @param \Closure|string $implementation + * @param \Closure|string|array $implementation * @return void */ public function give($implementation); @@ -27,4 +27,13 @@ interface ContextualBindingBuilder * @return void */ public function giveTagged($tag); + + /** + * Specify the configuration item to bind as a primitive. + * + * @param string $key + * @param ?string $default + * @return void + */ + public function giveConfig($key, $default = null); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/Builder.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/Builder.php new file mode 100644 index 00000000..6fdf405c --- /dev/null +++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/Builder.php @@ -0,0 +1,14 @@ +<?php + +namespace Illuminate\Contracts\Database\Eloquent; + +use Illuminate\Contracts\Database\Query\Builder as BaseContract; + +/** + * This interface is intentionally empty and exists to improve IDE support. + * + * @mixin \Illuminate\Database\Eloquent\Builder + */ +interface Builder extends BaseContract +{ +} diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/Builder.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/Builder.php new file mode 100644 index 00000000..e116ebf4 --- /dev/null +++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/Builder.php @@ -0,0 +1,12 @@ +<?php + +namespace Illuminate\Contracts\Database\Query; + +/** + * This interface is intentionally empty and exists to improve IDE support. + * + * @mixin \Illuminate\Database\Query\Builder + */ +interface Builder +{ +} diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Debug/ExceptionHandler.php b/data/web/inc/lib/vendor/illuminate/contracts/Debug/ExceptionHandler.php index 54381a17..3b6594a2 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Debug/ExceptionHandler.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Debug/ExceptionHandler.php @@ -41,6 +41,8 @@ interface ExceptionHandler * @param \Symfony\Component\Console\Output\OutputInterface $output * @param \Throwable $e * @return void + * + * @internal This method is not meant to be used or overwritten outside the framework. */ public function renderForConsole($output, Throwable $e); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Encryption/Encrypter.php b/data/web/inc/lib/vendor/illuminate/contracts/Encryption/Encrypter.php index 4747b68a..5ac1102e 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Encryption/Encrypter.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Encryption/Encrypter.php @@ -25,4 +25,11 @@ interface Encrypter * @throws \Illuminate\Contracts\Encryption\DecryptException */ public function decrypt($payload, $unserialize = true); + + /** + * Get the encryption key that the encrypter is currently using. + * + * @return string + */ + public function getKey(); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/FileExistsException.php b/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/FileExistsException.php deleted file mode 100644 index 9027892f..00000000 --- a/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/FileExistsException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Filesystem; - -use Exception; - -class FileExistsException extends Exception -{ - // -} diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php b/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php index e8b0dd4e..6d2fd578 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php @@ -30,9 +30,7 @@ interface Filesystem * Get the contents of a file. * * @param string $path - * @return string - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @return string|null */ public function get($path); @@ -41,8 +39,6 @@ interface Filesystem * * @param string $path * @return resource|null The path resource or null on failure. - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function readStream($path); @@ -63,9 +59,6 @@ interface Filesystem * @param resource $resource * @param array $options * @return bool - * - * @throws \InvalidArgumentException If $resource is not a file handle. - * @throws \Illuminate\Contracts\Filesystem\FileExistsException */ public function writeStream($path, $resource, array $options = []); diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php index 8ae0a31f..b46c6de4 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php @@ -24,7 +24,7 @@ interface Application extends Container /** * Get the path to the bootstrap directory. * - * @param string $path Optionally, a path to append to the bootstrap path + * @param string $path * @return string */ public function bootstrapPath($path = ''); @@ -32,7 +32,7 @@ interface Application extends Container /** * Get the path to the application configuration files. * - * @param string $path Optionally, a path to append to the config path + * @param string $path * @return string */ public function configPath($path = ''); @@ -40,7 +40,7 @@ interface Application extends Container /** * Get the path to the database directory. * - * @param string $path Optionally, a path to append to the database path + * @param string $path * @return string */ public function databasePath($path = ''); @@ -56,9 +56,10 @@ interface Application extends Container /** * Get the path to the storage directory. * + * @param string $path * @return string */ - public function storagePath(); + public function storagePath($path = ''); /** * Get or check the current application environment. @@ -82,6 +83,13 @@ interface Application extends Container */ public function runningUnitTests(); + /** + * Get an instance of the maintenance mode manager implementation. + * + * @return \Illuminate\Contracts\Foundation\MaintenanceMode + */ + public function maintenanceMode(); + /** * Determine if the application is currently down for maintenance. * @@ -206,6 +214,14 @@ interface Application extends Container */ public function shouldSkipMiddleware(); + /** + * Register a terminating callback with the application. + * + * @param callable|string $callback + * @return \Illuminate\Contracts\Foundation\Application + */ + public function terminating($callback); + /** * Terminate the application. * diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Foundation/ExceptionRenderer.php b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/ExceptionRenderer.php new file mode 100644 index 00000000..24f4e4be --- /dev/null +++ b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/ExceptionRenderer.php @@ -0,0 +1,14 @@ +<?php + +namespace Illuminate\Contracts\Foundation; + +interface ExceptionRenderer +{ + /** + * Renders the given exception as HTML. + * + * @param \Throwable $throwable + * @return string + */ + public function render($throwable); +} diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Foundation/MaintenanceMode.php b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/MaintenanceMode.php new file mode 100644 index 00000000..4c948f70 --- /dev/null +++ b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/MaintenanceMode.php @@ -0,0 +1,35 @@ +<?php + +namespace Illuminate\Contracts\Foundation; + +interface MaintenanceMode +{ + /** + * Take the application down for maintenance. + * + * @param array $payload + * @return void + */ + public function activate(array $payload): void; + + /** + * Take the application out of maintenance. + * + * @return void + */ + public function deactivate(): void; + + /** + * Determine if the application is currently down for maintenance. + * + * @return bool + */ + public function active(): bool; + + /** + * Get the data array which was provided when the application was placed into maintenance. + * + * @return array + */ + public function data(): array; +} diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php index bfdf4ef8..c5df7e85 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php @@ -23,7 +23,7 @@ interface Mailable public function queue(Queue $queue); /** - * Deliver the queued message after the given delay. + * Deliver the queued message after (n) seconds. * * @param \DateTimeInterface|\DateInterval|int $delay * @param \Illuminate\Contracts\Queue\Factory $queue diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php index 255b6789..38f9e3b5 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php @@ -38,11 +38,4 @@ interface Mailer * @return void */ public function send($view, array $data = [], $callback = null); - - /** - * Get the array of failed recipients. - * - * @return array - */ - public function failures(); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Queue/Job.php b/data/web/inc/lib/vendor/illuminate/contracts/Queue/Job.php index c8562155..9efd17d1 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Queue/Job.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Queue/Job.php @@ -33,9 +33,7 @@ interface Job public function fire(); /** - * Release the job back into the queue. - * - * Accepts a delay specified in seconds. + * Release the job back into the queue after (n) seconds. * * @param int $delay * @return void diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Queue/Queue.php b/data/web/inc/lib/vendor/illuminate/contracts/Queue/Queue.php index 073b3c1d..1994cddf 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Queue/Queue.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Queue/Queue.php @@ -43,7 +43,7 @@ interface Queue public function pushRaw($payload, $queue = null, array $options = []); /** - * Push a new job onto the queue after a delay. + * Push a new job onto the queue after (n) seconds. * * @param \DateTimeInterface|\DateInterval|int $delay * @param string|object $job @@ -54,7 +54,7 @@ interface Queue public function later($delay, $job, $data = '', $queue = null); /** - * Push a new job onto the queue after a delay. + * Push a new job onto a specific queue after (n) seconds. * * @param string $queue * @param \DateTimeInterface|\DateInterval|int $delay diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Queue/QueueableCollection.php b/data/web/inc/lib/vendor/illuminate/contracts/Queue/QueueableCollection.php index 7f1ea19c..750d10d4 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Queue/QueueableCollection.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Queue/QueueableCollection.php @@ -14,14 +14,14 @@ interface QueueableCollection /** * Get the identifiers for all of the entities. * - * @return array + * @return array<int, mixed> */ public function getQueueableIds(); /** * Get the relationships of the entities being queued. * - * @return array + * @return array<int, string> */ public function getQueueableRelations(); diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php b/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php index 2cd928dc..86c16cab 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php @@ -7,7 +7,7 @@ interface ResponseFactory /** * Create a new response instance. * - * @param string $content + * @param array|string $content * @param int $status * @param array $headers * @return \Illuminate\Http\Response diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Routing/UrlGenerator.php b/data/web/inc/lib/vendor/illuminate/contracts/Routing/UrlGenerator.php index e576dda1..cca221cc 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/Routing/UrlGenerator.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Routing/UrlGenerator.php @@ -69,6 +69,13 @@ interface UrlGenerator */ public function action($action, $parameters = [], $absolute = true); + /** + * Get the root controller namespace. + * + * @return string + */ + public function getRootControllerNamespace(); + /** * Set the root controller namespace. * diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Support/Arrayable.php b/data/web/inc/lib/vendor/illuminate/contracts/Support/Arrayable.php index 5ad93b70..3194bd11 100755 --- a/data/web/inc/lib/vendor/illuminate/contracts/Support/Arrayable.php +++ b/data/web/inc/lib/vendor/illuminate/contracts/Support/Arrayable.php @@ -2,12 +2,16 @@ namespace Illuminate\Contracts\Support; +/** + * @template TKey of array-key + * @template TValue + */ interface Arrayable { /** * Get the instance as an array. * - * @return array + * @return array<TKey, TValue> */ public function toArray(); } diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php b/data/web/inc/lib/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php new file mode 100644 index 00000000..e1be6fef --- /dev/null +++ b/data/web/inc/lib/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php @@ -0,0 +1,14 @@ +<?php + +namespace Illuminate\Contracts\Support; + +interface CanBeEscapedWhenCastToString +{ + /** + * Indicate that the object's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true); +} diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Support/ValidatedData.php b/data/web/inc/lib/vendor/illuminate/contracts/Support/ValidatedData.php new file mode 100644 index 00000000..8e7a5207 --- /dev/null +++ b/data/web/inc/lib/vendor/illuminate/contracts/Support/ValidatedData.php @@ -0,0 +1,11 @@ +<?php + +namespace Illuminate\Contracts\Support; + +use ArrayAccess; +use IteratorAggregate; + +interface ValidatedData extends Arrayable, ArrayAccess, IteratorAggregate +{ + // +} diff --git a/data/web/inc/lib/vendor/illuminate/contracts/composer.json b/data/web/inc/lib/vendor/illuminate/contracts/composer.json index c9b46671..9296ba9e 100644 --- a/data/web/inc/lib/vendor/illuminate/contracts/composer.json +++ b/data/web/inc/lib/vendor/illuminate/contracts/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/data/web/inc/lib/vendor/nesbot/carbon/bin/carbon b/data/web/inc/lib/vendor/nesbot/carbon/bin/carbon index fdcbb5c2..b53ab738 100755 --- a/data/web/inc/lib/vendor/nesbot/carbon/bin/carbon +++ b/data/web/inc/lib/vendor/nesbot/carbon/bin/carbon @@ -1,6 +1,8 @@ #!/usr/bin/env php <?php +use Carbon\Cli\Invoker; + $dir = __DIR__.'/..'; if (!file_exists($dir.'/autoload.php')) { @@ -18,4 +20,4 @@ if (!file_exists($dir.'/autoload.php')) { require $dir.'/autoload.php'; -exit((new \Carbon\Cli\Invoker())(...$argv) ? 0 : 1); +exit((new Invoker())(...$argv) ? 0 : 1); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/composer.json b/data/web/inc/lib/vendor/nesbot/carbon/composer.json index d0cadc9c..84ec1361 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/composer.json +++ b/data/web/inc/lib/vendor/nesbot/carbon/composer.json @@ -25,21 +25,25 @@ "ext-json": "*", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0" + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", "doctrine/orm": "^2.7", - "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^0.12.54 || ^1.0", "phpunit/phpunit": "^7.5.20 || ^8.5.14", "squizlabs/php_codesniffer": "^3.4" }, "config": { "process-timeout": 0, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true + } }, "extra": { "branch-alias": { @@ -93,6 +97,7 @@ }, "support": { "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon" + "source": "https://github.com/briannesbitt/Carbon", + "docs": "https://carbon.nesbot.com/docs" } } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php new file mode 100644 index 00000000..eacd9c1e --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php @@ -0,0 +1,43 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +if (!class_exists(LazyMacro::class, false)) { + abstract class LazyMacro extends AbstractMacro + { + /** + * {@inheritdoc} + */ + public function getFileName(): ?string + { + return $this->reflectionFunction->getFileName(); + } + + /** + * {@inheritdoc} + */ + public function getStartLine(): ?int + { + return $this->reflectionFunction->getStartLine(); + } + + /** + * {@inheritdoc} + */ + public function getEndLine(): ?int + { + return $this->reflectionFunction->getEndLine(); + } + } +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php new file mode 100644 index 00000000..3e9fcf4f --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php @@ -0,0 +1,49 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +if (!class_exists(LazyMacro::class, false)) { + abstract class LazyMacro extends AbstractMacro + { + /** + * {@inheritdoc} + * + * @return string|false + */ + public function getFileName() + { + return $this->reflectionFunction->getFileName(); + } + + /** + * {@inheritdoc} + * + * @return int|false + */ + public function getStartLine() + { + return $this->reflectionFunction->getStartLine(); + } + + /** + * {@inheritdoc} + * + * @return int|false + */ + public function getEndLine() + { + return $this->reflectionFunction->getEndLine(); + } + } +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php new file mode 100644 index 00000000..d35308a6 --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php @@ -0,0 +1,52 @@ +<?php + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +if (!class_exists(LazyTranslator::class, false)) { + class LazyTranslator extends AbstractTranslator implements TranslatorStrongTypeInterface + { + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + return $this->translate($id, $parameters, $domain, $locale); + } + + public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages') + { + $messages = $this->getPrivateProperty($catalogue, 'messages'); + + if (isset($messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id])) { + return $messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id]; + } + + if (isset($messages[$domain][$id])) { + return $messages[$domain][$id]; + } + + $fallbackCatalogue = $this->getPrivateProperty($catalogue, 'fallbackCatalogue'); + + if ($fallbackCatalogue !== null) { + return $this->getFromCatalogue($fallbackCatalogue, $id, $domain); + } + + return $id; + } + + private function getPrivateProperty($instance, string $field) + { + return (function (string $field) { + return $this->$field; + })->call($instance, $field); + } + } +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php new file mode 100644 index 00000000..94dbdc30 --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php @@ -0,0 +1,32 @@ +<?php + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +if (!class_exists(LazyTranslator::class, false)) { + class LazyTranslator extends AbstractTranslator + { + /** + * Returns the translation. + * + * @param string|null $id + * @param array $parameters + * @param string|null $domain + * @param string|null $locale + * + * @return string + */ + public function trans($id, array $parameters = [], $domain = null, $locale = null) + { + return $this->translate($id, $parameters, $domain, $locale); + } + } +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/readme.md b/data/web/inc/lib/vendor/nesbot/carbon/readme.md index 70279c1e..5d827219 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/readme.md +++ b/data/web/inc/lib/vendor/nesbot/carbon/readme.md @@ -3,9 +3,7 @@ [](https://packagist.org/packages/nesbot/carbon) [](https://packagist.org/packages/nesbot/carbon) [](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto) -[](https://github.styleci.io/repos/5724990) [](https://codecov.io/github/briannesbitt/Carbon?branch=master) -[](https://github.com/phpstan/phpstan) [](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme) An international PHP extension for DateTime. [https://carbon.nesbot.com](https://carbon.nesbot.com) diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php new file mode 100644 index 00000000..48441e7c --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php @@ -0,0 +1,401 @@ +<?php + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Closure; +use ReflectionException; +use ReflectionFunction; +use Symfony\Component\Translation; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; +use Symfony\Component\Translation\Loader\ArrayLoader; + +abstract class AbstractTranslator extends Translation\Translator +{ + /** + * Translator singletons for each language. + * + * @var array + */ + protected static $singletons = []; + + /** + * List of custom localized messages. + * + * @var array + */ + protected $messages = []; + + /** + * List of custom directories that contain translation files. + * + * @var string[] + */ + protected $directories = []; + + /** + * Set to true while constructing. + * + * @var bool + */ + protected $initializing = false; + + /** + * List of locales aliases. + * + * @var string[] + */ + protected $aliases = [ + 'me' => 'sr_Latn_ME', + 'scr' => 'sh', + ]; + + /** + * Return a singleton instance of Translator. + * + * @param string|null $locale optional initial locale ("en" - english by default) + * + * @return static + */ + public static function get($locale = null) + { + $locale = $locale ?: 'en'; + $key = static::class === Translator::class ? $locale : static::class.'|'.$locale; + + if (!isset(static::$singletons[$key])) { + static::$singletons[$key] = new static($locale); + } + + return static::$singletons[$key]; + } + + public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) + { + parent::setLocale($locale); + $this->initializing = true; + $this->directories = [__DIR__.'/Lang']; + $this->addLoader('array', new ArrayLoader()); + parent::__construct($locale, $formatter, $cacheDir, $debug); + $this->initializing = false; + } + + /** + * Returns the list of directories translation files are searched in. + * + * @return array + */ + public function getDirectories(): array + { + return $this->directories; + } + + /** + * Set list of directories translation files are searched in. + * + * @param array $directories new directories list + * + * @return $this + */ + public function setDirectories(array $directories) + { + $this->directories = $directories; + + return $this; + } + + /** + * Add a directory to the list translation files are searched in. + * + * @param string $directory new directory + * + * @return $this + */ + public function addDirectory(string $directory) + { + $this->directories[] = $directory; + + return $this; + } + + /** + * Remove a directory from the list translation files are searched in. + * + * @param string $directory directory path + * + * @return $this + */ + public function removeDirectory(string $directory) + { + $search = rtrim(strtr($directory, '\\', '/'), '/'); + + return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) { + return rtrim(strtr($item, '\\', '/'), '/') !== $search; + })); + } + + /** + * Reset messages of a locale (all locale if no locale passed). + * Remove custom messages and reload initial messages from matching + * file in Lang directory. + * + * @param string|null $locale + * + * @return bool + */ + public function resetMessages($locale = null) + { + if ($locale === null) { + $this->messages = []; + + return true; + } + + foreach ($this->getDirectories() as $directory) { + $data = @include sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale); + + if ($data !== false) { + $this->messages[$locale] = $data; + $this->addResource('array', $this->messages[$locale], $locale); + + return true; + } + } + + return false; + } + + /** + * Returns the list of files matching a given locale prefix (or all if empty). + * + * @param string $prefix prefix required to filter result + * + * @return array + */ + public function getLocalesFiles($prefix = '') + { + $files = []; + + foreach ($this->getDirectories() as $directory) { + $directory = rtrim($directory, '\\/'); + + foreach (glob("$directory/$prefix*.php") as $file) { + $files[] = $file; + } + } + + return array_unique($files); + } + + /** + * Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * + * @param string $prefix prefix required to filter result + * + * @return array + */ + public function getAvailableLocales($prefix = '') + { + $locales = []; + foreach ($this->getLocalesFiles($prefix) as $file) { + $locales[] = substr($file, strrpos($file, '/') + 1, -4); + } + + return array_unique(array_merge($locales, array_keys($this->messages))); + } + + protected function translate(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + if ($domain === null) { + $domain = 'messages'; + } + + $catalogue = $this->getCatalogue($locale); + $format = $this instanceof TranslatorStrongTypeInterface + ? $this->getFromCatalogue($catalogue, (string) $id, $domain) // @codeCoverageIgnore + : $this->getCatalogue($locale)->get((string) $id, $domain); + + if ($format instanceof Closure) { + // @codeCoverageIgnoreStart + try { + $count = (new ReflectionFunction($format))->getNumberOfRequiredParameters(); + } catch (ReflectionException $exception) { + $count = 0; + } + // @codeCoverageIgnoreEnd + + return $format( + ...array_values($parameters), + ...array_fill(0, max(0, $count - \count($parameters)), null) + ); + } + + return parent::trans($id, $parameters, $domain, $locale); + } + + /** + * Init messages language from matching file in Lang directory. + * + * @param string $locale + * + * @return bool + */ + protected function loadMessagesFromFile($locale) + { + if (isset($this->messages[$locale])) { + return true; + } + + return $this->resetMessages($locale); + } + + /** + * Set messages of a locale and take file first if present. + * + * @param string $locale + * @param array $messages + * + * @return $this + */ + public function setMessages($locale, $messages) + { + $this->loadMessagesFromFile($locale); + $this->addResource('array', $messages, $locale); + $this->messages[$locale] = array_merge( + $this->messages[$locale] ?? [], + $messages + ); + + return $this; + } + + /** + * Set messages of the current locale and take file first if present. + * + * @param array $messages + * + * @return $this + */ + public function setTranslations($messages) + { + return $this->setMessages($this->getLocale(), $messages); + } + + /** + * Get messages of a locale, if none given, return all the + * languages. + * + * @param string|null $locale + * + * @return array + */ + public function getMessages($locale = null) + { + return $locale === null ? $this->messages : $this->messages[$locale]; + } + + /** + * Set the current translator locale and indicate if the source locale file exists + * + * @param string $locale locale ex. en + * + * @return bool + */ + public function setLocale($locale) + { + $locale = preg_replace_callback('/[-_]([a-z]{2,}|[0-9]{2,})/', function ($matches) { + // _2-letters or YUE is a region, _3+-letters is a variant + $upper = strtoupper($matches[1]); + + if ($upper === 'YUE' || $upper === 'ISO' || \strlen($upper) < 3) { + return "_$upper"; + } + + return '_'.ucfirst($matches[1]); + }, strtolower($locale)); + + $previousLocale = $this->getLocale(); + + if ($previousLocale === $locale && isset($this->messages[$locale])) { + return true; + } + + unset(static::$singletons[$previousLocale]); + + if ($locale === 'auto') { + $completeLocale = setlocale(LC_TIME, '0'); + $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale); + $locales = $this->getAvailableLocales($locale); + + $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); + + $getScore = function ($language) use ($completeLocaleChunks) { + return self::compareChunkLists($completeLocaleChunks, preg_split('/[_.-]+/', $language)); + }; + + usort($locales, function ($first, $second) use ($getScore) { + return $getScore($second) <=> $getScore($first); + }); + + $locale = $locales[0]; + } + + if (isset($this->aliases[$locale])) { + $locale = $this->aliases[$locale]; + } + + // If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback + if (str_contains($locale, '_') && + $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale)) + ) { + parent::setLocale($macroLocale); + } + + if ($this->loadMessagesFromFile($locale) || $this->initializing) { + parent::setLocale($locale); + + return true; + } + + return false; + } + + /** + * Show locale on var_dump(). + * + * @return array + */ + public function __debugInfo() + { + return [ + 'locale' => $this->getLocale(), + ]; + } + + private static function compareChunkLists($referenceChunks, $chunks) + { + $score = 0; + + foreach ($referenceChunks as $index => $chunk) { + if (!isset($chunks[$index])) { + $score++; + + continue; + } + + if (strtolower($chunks[$index]) === strtolower($chunk)) { + $score += 10; + } + } + + return $score; + } +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php index 3b687591..e327590e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php @@ -8,9 +8,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Traits\Date; +use Carbon\Traits\DeprecatedProperties; use DateTime; use DateTimeInterface; use DateTimeZone; @@ -18,6 +20,8 @@ use DateTimeZone; /** * A simple API extension for DateTime. * + * @mixin DeprecatedProperties + * * <autodoc generated by `composer phpdoc`> * * @property int $year @@ -34,10 +38,6 @@ use DateTimeZone; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php index eb0a7093..1ce967b2 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use DateTimeInterface; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php index cb1c4988..6d1194ee 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php @@ -8,9 +8,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Traits\Date; +use Carbon\Traits\DeprecatedProperties; use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; @@ -18,6 +20,8 @@ use DateTimeZone; /** * A simple API extension for DateTimeImmutable. * + * @mixin DeprecatedProperties + * * <autodoc generated by `composer phpdoc`> * * @property int $year @@ -34,10 +38,6 @@ use DateTimeZone; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php index 8f095072..15e2061c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use BadMethodCallException; @@ -27,6 +28,7 @@ use DateTimeZone; use JsonSerializable; use ReflectionException; use ReturnTypeWillChange; +use Symfony\Component\Translation\TranslatorInterface; use Throwable; /** @@ -48,10 +50,6 @@ use Throwable; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli @@ -1270,7 +1268,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable /** * Get the difference as a CarbonInterval instance. - * Return absolute interval (always positive) unless you pass false to the second argument. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference @@ -1312,6 +1311,10 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) + * - 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). + * - 'aUnit' entry, prefer "an hour" over "1 hour" if true * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string @@ -1320,6 +1323,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) + * - 'minimumUnit' entry determines the smallest unit of time to display can be long or + * ` short form of the units, e.g. 'hour' or 'h' (default value: s) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers @@ -1962,6 +1967,10 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * Format the instance with the current locale. You can set the current * locale using setlocale() https://php.net/setlocale. * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat() instead. + * Deprecated since 2.55.0 + * * @param string $format * * @return string @@ -2148,6 +2157,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable /** * {@inheritdoc} + * + * @return array */ #[ReturnTypeWillChange] public static function getLastErrors(); @@ -2259,6 +2270,13 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable */ public static function getTimeFormatByPrecision($unitPrecision); + /** + * Returns the timestamp with millisecond precision. + * + * @return int + */ + public function getTimestampMs(); + /** * Get the translation of the current week day name (with context for languages with multiple forms). * @@ -3332,6 +3350,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. * * @see https://php.net/manual/en/datetime.modify.php + * + * @return static|false */ #[ReturnTypeWillChange] public function modify($modify); @@ -3792,7 +3812,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * @return $this */ - public function setLocalTranslator(\Symfony\Component\Translation\TranslatorInterface $translator); + public function setLocalTranslator(TranslatorInterface $translator); /** * Set the current translator locale and indicate if the source locale file exists. @@ -3832,6 +3852,9 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * * To clear the test instance call this method using the default * parameter of null. * @@ -3841,6 +3864,27 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable */ public static function setTestNow($testNow = null); + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNowAndTimezone($testNow = null, $tz = null); + /** * Resets the current time of the DateTime object to a different time. * @@ -3917,7 +3961,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * @return void */ - public static function setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator); + public static function setTranslator(TranslatorInterface $translator); /** * Set specified unit to new given value. @@ -4772,14 +4816,15 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable /** * Translate using translation string or callback available. * - * @param string $key - * @param array $parameters - * @param string|int|float|null $number - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param string $key + * @param array $parameters + * @param string|int|float|null $number + * @param \Symfony\Component\Translation\TranslatorInterface|null $translator + * @param bool $altNumbers * * @return string */ - public function translate(string $key, array $parameters = [], $number = null, ?\Symfony\Component\Translation\TranslatorInterface $translator = null, bool $altNumbers = false): string; + public function translate(string $key, array $parameters = [], $number = null, ?TranslatorInterface $translator = null, bool $altNumbers = false): string; /** * Returns the alternative number for a given integer if available in the current locale. @@ -4828,7 +4873,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * @return string */ - public static function translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string; + public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string; /** * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) @@ -5012,8 +5057,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable * * /!\ Use this method for unit tests only. * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure|null $callback * * @return mixed */ diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php index 7168fa4b..d465beac 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\BadFluentConstructorException; @@ -25,6 +26,8 @@ use Carbon\Traits\Mixin; use Carbon\Traits\Options; use Closure; use DateInterval; +use DateTimeInterface; +use DateTimeZone; use Exception; use ReflectionException; use ReturnTypeWillChange; @@ -189,14 +192,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Interval spec period designators */ - const PERIOD_PREFIX = 'P'; - const PERIOD_YEARS = 'Y'; - const PERIOD_MONTHS = 'M'; - const PERIOD_DAYS = 'D'; - const PERIOD_TIME_PREFIX = 'T'; - const PERIOD_HOURS = 'H'; - const PERIOD_MINUTES = 'M'; - const PERIOD_SECONDS = 'S'; + public const PERIOD_PREFIX = 'P'; + public const PERIOD_YEARS = 'Y'; + public const PERIOD_MONTHS = 'M'; + public const PERIOD_DAYS = 'D'; + public const PERIOD_TIME_PREFIX = 'T'; + public const PERIOD_HOURS = 'H'; + public const PERIOD_MINUTES = 'M'; + public const PERIOD_SECONDS = 'S'; /** * A translator to ... er ... translate stuff @@ -253,6 +256,22 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface protected $tzName; /** + * Set the instance's timezone from a string or object. + * + * @param \DateTimeZone|string $tzName + * + * @return static + */ + public function setTimezone($tzName) + { + $this->tzName = $tzName; + + return $this; + } + + /** + * @internal + * * Set the instance's timezone from a string or object and add/subtract the offset difference. * * @param \DateTimeZone|string $tzName @@ -346,7 +365,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface if ($years instanceof DateInterval) { parent::__construct(static::getDateIntervalSpec($years)); $this->f = $years->f; - static::copyNegativeUnits($years, $this); + self::copyNegativeUnits($years, $this); return; } @@ -397,7 +416,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface { $source = self::standardizeUnit($source); $target = self::standardizeUnit($target); - $factors = static::getFlipCascadeFactors(); + $factors = self::getFlipCascadeFactors(); if (isset($factors[$source])) { [$to, $factor] = $factors[$source]; @@ -412,6 +431,37 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface return null; } + /** + * Returns the factor for a given source-to-target couple if set, + * else try to find the appropriate constant as the factor, such as Carbon::DAYS_PER_WEEK. + * + * @param string $source + * @param string $target + * + * @return int|null + */ + public static function getFactorWithDefault($source, $target) + { + $factor = self::getFactor($source, $target); + + if ($factor) { + return $factor; + } + + static $defaults = [ + 'month' => ['year' => Carbon::MONTHS_PER_YEAR], + 'week' => ['month' => Carbon::WEEKS_PER_MONTH], + 'day' => ['week' => Carbon::DAYS_PER_WEEK], + 'hour' => ['day' => Carbon::HOURS_PER_DAY], + 'minute' => ['hour' => Carbon::MINUTES_PER_HOUR], + 'second' => ['minute' => Carbon::SECONDS_PER_MINUTE], + 'millisecond' => ['second' => Carbon::MILLISECONDS_PER_SECOND], + 'microsecond' => ['millisecond' => Carbon::MICROSECONDS_PER_MILLISECOND], + ]; + + return $defaults[$source][$target] ?? null; + } + /** * Returns current config for days per week. * @@ -504,10 +554,10 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface * echo Carboninterval::createFromFormat('H:i', '1:30'); * ``` * - * @param string $format Format of the $interval input string - * @param string $interval Input string to convert into an interval + * @param string $format Format of the $interval input string + * @param string|null $interval Input string to convert into an interval * - * @throws Exception when the $interval cannot be parsed as an interval. + * @throws \Carbon\Exceptions\ParseErrorException when the $interval cannot be parsed as an interval. * * @return static */ @@ -848,10 +898,10 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface } if ($interval instanceof self && is_a($className, self::class, true)) { - static::copyStep($interval, $instance); + self::copyStep($interval, $instance); } - static::copyNegativeUnits($interval, $instance); + self::copyNegativeUnits($interval, $instance); return $instance; } @@ -1358,7 +1408,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface $altNumbers = false; $aUnit = false; $minimumUnit = 's'; + $skip = []; extract($this->getForHumansInitialVariables($syntax, $short)); + $skip = array_filter((array) $skip, static function ($value) { + return \is_string($value) && $value !== ''; + }); if ($syntax === null) { $syntax = CarbonInterface::DIFF_ABSOLUTE; @@ -1421,7 +1475,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface ':optional-space' => $optionalSpace, ]; - return [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit]; + return [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip]; } protected static function getRoundingMethodFromOptions(int $options): ?string @@ -1525,6 +1579,9 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) + * - 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). * - 'aUnit' entry, prefer "an hour" over "1 hour" if true * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue @@ -1551,11 +1608,12 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface */ public function forHumans($syntax = null, $short = false, $parts = -1, $options = null) { - [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit] = $this->getForHumansParameters($syntax, $short, $parts, $options); + [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip] = $this + ->getForHumansParameters($syntax, $short, $parts, $options); $interval = []; - $syntax = (int) ($syntax === null ? CarbonInterface::DIFF_ABSOLUTE : $syntax); + $syntax = (int) ($syntax ?? CarbonInterface::DIFF_ABSOLUTE); $absolute = $syntax === CarbonInterface::DIFF_ABSOLUTE; $relativeToNow = $syntax === CarbonInterface::DIFF_RELATIVE_TO_NOW; $count = 1; @@ -1596,8 +1654,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface \count($intervalValues->getNonZeroValues()) > $parts && ($count = \count($keys = array_keys($intervalValues->getValuesSequence()))) > 1 ) { + $index = min($count, $previousCount - 1) - 2; + + if ($index < 0) { + break; + } + $intervalValues = $this->copy()->roundUnit( - $keys[min($count, $previousCount - 1) - 2], + $keys[$index], 1, $method ); @@ -1617,6 +1681,21 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface ['value' => $intervalValues->microExcludeMilli, 'unit' => 'microsecond', 'unitShort' => 'µs'], ]; + if (!empty($skip)) { + foreach ($diffIntervalArray as $index => &$unitData) { + $nextIndex = $index + 1; + + if ($unitData['value'] && + isset($diffIntervalArray[$nextIndex]) && + \count(array_intersect([$unitData['unit'], $unitData['unit'].'s', $unitData['unitShort']], $skip)) + ) { + $diffIntervalArray[$nextIndex]['value'] += $unitData['value'] * + self::getFactorWithDefault($diffIntervalArray[$nextIndex]['unit'], $unitData['unit']); + $unitData['value'] = 0; + } + } + } + $transChoice = function ($short, $unitData) use ($absolute, $handleDeclensions, $translator, $aUnit, $altNumbers, $interpolations) { $count = $unitData['value']; @@ -1642,6 +1721,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface }; $fallbackUnit = ['second', 's']; + foreach ($diffIntervalArray as $diffIntervalData) { if ($diffIntervalData['value'] > 0) { $unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit']; @@ -1763,12 +1843,20 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Convert the interval to a CarbonPeriod. * - * @param array ...$params Start date, [end date or recurrences] and optional settings. + * @param DateTimeInterface|string|int ...$params Start date, [end date or recurrences] and optional settings. * * @return CarbonPeriod */ public function toPeriod(...$params) { + if ($this->tzName) { + $tz = \is_string($this->tzName) ? new DateTimeZone($this->tzName) : $this->tzName; + + if ($tz instanceof DateTimeZone) { + array_unshift($params, $tz); + } + } + return CarbonPeriod::create($this, ...$params); } @@ -1879,8 +1967,8 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Add given parameters to the current interval. * - * @param int $years - * @param int $months + * @param int $years + * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours @@ -1909,8 +1997,8 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface /** * Add given parameters to the current interval. * - * @param int $years - * @param int $months + * @param int $years + * @param int $months * @param int|float $weeks * @param int|float $days * @param int|float $hours @@ -2145,7 +2233,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface unset($originalData['days']); $newData = $originalData; - foreach (static::getFlipCascadeFactors() as $source => [$target, $factor]) { + foreach (self::getFlipCascadeFactors() as $source => [$target, $factor]) { foreach (['source', 'target'] as $key) { if ($$key === 'dayz') { $$key = 'daysExcludeWeeks'; @@ -2235,7 +2323,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface $result = 0; $cumulativeFactor = 0; $unitFound = false; - $factors = static::getFlipCascadeFactors(); + $factors = self::getFlipCascadeFactors(); $daysPerWeek = static::getDaysPerWeek(); $values = [ diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php index 70e6ba49..0e81e757 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\InvalidCastException; @@ -28,6 +29,7 @@ use DateInterval; use DatePeriod; use DateTime; use DateTimeInterface; +use DateTimeZone; use InvalidArgumentException; use Iterator; use JsonSerializable; @@ -161,6 +163,8 @@ use RuntimeException; * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CarbonPeriod implements Iterator, Countable, JsonSerializable { @@ -171,17 +175,23 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable use Options; /** - * Built-in filters. + * Built-in filter for limit by recurrences. * - * @var string + * @var callable */ public const RECURRENCES_FILTER = [self::class, 'filterRecurrences']; + + /** + * Built-in filter for limit to an end. + * + * @var callable + */ public const END_DATE_FILTER = [self::class, 'filterEndDate']; /** * Special value which can be returned by filters to end iteration. Also a filter. * - * @var string + * @var callable */ public const END_ITERATION = [self::class, 'endIteration']; @@ -474,8 +484,8 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable $end = null; foreach (explode('/', $iso) as $key => $part) { - if ($key === 0 && preg_match('/^R([0-9]*)$/', $part, $match)) { - $parsed = \strlen($match[1]) ? (int) $match[1] : null; + if ($key === 0 && preg_match('/^R([0-9]*|INF)$/', $part, $match)) { + $parsed = \strlen($match[1]) ? (($match[1] !== 'INF') ? (int) $match[1] : INF) : null; } elseif ($interval === null && $parsed = CarbonInterval::make($part)) { $interval = $part; } elseif ($start === null && $parsed = Carbon::make($part)) { @@ -639,7 +649,11 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable } foreach ($arguments as $argument) { - if ($this->dateInterval === null && + $parsedDate = null; + + if ($argument instanceof DateTimeZone) { + $this->setTimezone($argument); + } elseif ($this->dateInterval === null && ( \is_string($argument) && preg_match( '/^(-?\d(\d(?![\/-])|[^\d\/-]([\/-])?)*|P[T0-9].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i', @@ -648,13 +662,13 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable $argument instanceof DateInterval || $argument instanceof Closure ) && - $parsed = @CarbonInterval::make($argument) + $parsedInterval = @CarbonInterval::make($argument) ) { - $this->setDateInterval($parsed); - } elseif ($this->startDate === null && $parsed = Carbon::make($argument)) { - $this->setStartDate($parsed); - } elseif ($this->endDate === null && $parsed = Carbon::make($argument)) { - $this->setEndDate($parsed); + $this->setDateInterval($parsedInterval); + } elseif ($this->startDate === null && $parsedDate = $this->makeDateTime($argument)) { + $this->setStartDate($parsedDate); + } elseif ($this->endDate === null && ($parsedDate = $parsedDate ?? $this->makeDateTime($argument))) { + $this->setEndDate($parsedDate); } elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) { $this->setRecurrences($argument); } elseif ($this->options === null && (\is_int($argument) || $argument === null)) { @@ -1305,6 +1319,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return bool */ + #[ReturnTypeWillChange] public function valid() { return $this->validateCurrentDate() === true; @@ -1315,6 +1330,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return int|null */ + #[ReturnTypeWillChange] public function key() { return $this->valid() @@ -1327,6 +1343,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return CarbonInterface|null */ + #[ReturnTypeWillChange] public function current() { return $this->valid() @@ -1341,6 +1358,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return void */ + #[ReturnTypeWillChange] public function next() { if ($this->current === null) { @@ -1367,6 +1385,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return void */ + #[ReturnTypeWillChange] public function rewind() { $this->key = 0; @@ -1540,6 +1559,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable * * @return int */ + #[ReturnTypeWillChange] public function count() { return \count($this->toArray()); @@ -1615,14 +1635,14 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable return $this->setStartDate($first, $second); case 'sinceNow': - return $this->setStartDate(new Carbon, $first); + return $this->setStartDate(new Carbon(), $first); case 'end': case 'until': return $this->setEndDate($first, $second); case 'untilNow': - return $this->setEndDate(new Carbon, $first); + return $this->setEndDate(new Carbon(), $first); case 'dates': case 'between': @@ -1689,7 +1709,30 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable } /** - * Set the instance's timezone from a string or object and add/subtract the offset difference. + * Set the instance's timezone from a string or object and apply it to start/end. + * + * @param \DateTimeZone|string $timezone + * + * @return static + */ + public function setTimezone($timezone) + { + $this->tzName = $timezone; + $this->timezone = $timezone; + + if ($this->startDate) { + $this->setStartDate($this->startDate->setTimezone($timezone)); + } + + if ($this->endDate) { + $this->setEndDate($this->endDate->setTimezone($timezone)); + } + + return $this; + } + + /** + * Set the instance's timezone from a string or object and add/subtract the offset difference to start/end. * * @param \DateTimeZone|string $timezone * @@ -1700,6 +1743,14 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable $this->tzName = $timezone; $this->timezone = $timezone; + if ($this->startDate) { + $this->setStartDate($this->startDate->shiftTimezone($timezone)); + } + + if ($this->endDate) { + $this->setEndDate($this->endDate->shiftTimezone($timezone)); + } + return $this; } @@ -2130,7 +2181,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ public function round($precision = null, $function = 'round') { - return $this->roundWith($precision ?? (string) $this->getDateInterval(), $function); + return $this->roundWith( + $precision ?? $this->getDateInterval()->setLocalTranslator(TranslatorImmutable::get('en'))->forHumans(), + $function + ); } /** @@ -2362,11 +2416,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable } // Check after the first rewind to avoid repeating the initial validation. - if ($this->validationResult !== null) { - return $this->validationResult; - } - - return $this->validationResult = $this->checkFilters(); + return $this->validationResult ?? ($this->validationResult = $this->checkFilters()); } /** @@ -2495,4 +2545,24 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable { return $first > $second ? [$second, $first] : [$first, $second]; } + + private function makeDateTime($value): ?DateTimeInterface + { + if ($value instanceof DateTimeInterface) { + return $value; + } + + if (\is_string($value)) { + $value = trim($value); + + if (!preg_match('/^P[0-9T]/', $value) && + !preg_match('/^R[0-9]/', $value) && + preg_match('/[a-z0-9]/i', $value) + ) { + return Carbon::parse($value, $this->tzName); + } + } + + return null; + } } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php index 2bd36c43..b4d16ba9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php @@ -8,12 +8,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidTimeZoneException; use DateTimeInterface; use DateTimeZone; +use Throwable; class CarbonTimeZone extends DateTimeZone { @@ -198,7 +200,7 @@ class CarbonTimeZone extends DateTimeZone // @codeCoverageIgnoreStart try { $offset = @$this->getOffset($date) ?: 0; - } catch (\Throwable $e) { + } catch (Throwable $e) { $offset = 0; } // @codeCoverageIgnoreEnd diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php index d53b1f49..4f35d6c6 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php @@ -1,5 +1,14 @@ <?php +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Cli; class Invoker diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php index 35c5558a..ccc457fc 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php @@ -1,9 +1,14 @@ <?php /** - * Thanks to https://github.com/flaushi for his suggestion: - * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358 + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php index 32397434..bf476a77 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php @@ -1,9 +1,14 @@ <?php /** - * Thanks to https://github.com/flaushi for his suggestion: - * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358 + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -12,6 +17,8 @@ class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrin { /** * {@inheritdoc} + * + * @return string */ public function getName() { @@ -20,6 +27,8 @@ class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrin /** * {@inheritdoc} + * + * @return bool */ public function requiresSQLCommentHint(AbstractPlatform $platform) { diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php index e5f52c7d..9289d84d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php @@ -1,9 +1,14 @@ <?php /** - * Thanks to https://github.com/flaushi for his suggestion: - * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358 + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Doctrine\DBAL\Platforms\AbstractPlatform; @@ -12,6 +17,8 @@ class CarbonType extends DateTimeType implements CarbonDoctrineType { /** * {@inheritdoc} + * + * @return string */ public function getName() { @@ -20,6 +27,8 @@ class CarbonType extends DateTimeType implements CarbonDoctrineType /** * {@inheritdoc} + * + * @return bool */ public function requiresSQLCommentHint(AbstractPlatform $platform) { diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php index fa0d5b00..ecfe17e7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php @@ -1,9 +1,14 @@ <?php /** - * Thanks to https://github.com/flaushi for his suggestion: - * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358 + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; use Carbon\Carbon; @@ -26,11 +31,21 @@ trait CarbonTypeConverter return Carbon::class; } + /** + * @return string + */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { - $precision = ($fieldDeclaration['precision'] ?: 10) === 10 - ? DateTimeDefaultPrecision::get() - : $fieldDeclaration['precision']; + $precision = $fieldDeclaration['precision'] ?: 10; + + if ($fieldDeclaration['secondPrecision'] ?? false) { + $precision = 0; + } + + if ($precision === 10) { + $precision = DateTimeDefaultPrecision::get(); + } + $type = parent::getSQLDeclaration($fieldDeclaration, $platform); if (!$precision) { diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php index f9744b81..642fd413 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php @@ -1,9 +1,14 @@ <?php /** - * Thanks to https://github.com/flaushi for his suggestion: - * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358 + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ + namespace Carbon\Doctrine; class DateTimeDefaultPrecision diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php index bc2aa797..b3a08719 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php index a9f453eb..d5cd5564 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php index 7a28f39c..1d7ec542 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php index 307a4ee1..73c2dd86 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface BadMethodCallException extends Exception diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php index 86e8a15e..3bbbd77d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface Exception diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php index 5fb1c681..a48d4f93 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php index 60ed740d..9739f4d1 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface InvalidArgumentException extends Exception diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php index 77466c7d..d2f37019 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php index f5dbfe2f..99bb91c0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php index dd26a901..3341b49d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php index b4c76dc8..5f9f142e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php index abe1aef3..a37e3f5e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php index b061ef16..ede47712 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php index 03bd8ac4..892e16e8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php index bc124a65..3fbe3fc4 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php index 78ce9392..2b4c48e3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Carbon\CarbonInterface; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php index 8bdda85b..41bb6290 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php index 8aab1925..adbc36cd 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php index 33cd1b52..54822d95 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php index 3510b409..0314c5d8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php index 6ca5f5f5..24bf5a68 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; interface RuntimeException extends Exception diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php index 838847ba..8bd8653e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php index 7f8ec9eb..39ee12c5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php index 4591d35b..6c8c01b6 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php index 36468724..901db986 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use BadMethodCallException as BaseBadMethodCallException; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php index 5020369a..c9e9c9ff 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php index d2f76eee..d965c82a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php index b38ae12d..6f8b39f5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Exceptions; use Exception; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php index e1d747f2..f8c72890 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php @@ -8,9 +8,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Closure; +use DateTimeInterface; use ReflectionMethod; /** @@ -18,208 +20,222 @@ use ReflectionMethod; * * <autodoc generated by `composer phpdoc`> * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method Carbon|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method Carbon|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method Carbon|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method Carbon fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method Carbon getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method Carbon instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method Carbon|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method Carbon maxValue() Create a Carbon instance for the greatest supported date. - * @method Carbon minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method Carbon now($tz = null) Get a Carbon instance for the current date and time. - * @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method Carbon|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method Carbon rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method Carbon resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method Carbon setFallbackLocale($locale) Set the fallback locale. - * @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use. - * @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method Carbon today($tz = null) Create a Carbon instance for today. - * @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday. + * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method Carbon|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method Carbon createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method Carbon|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method Carbon|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method Carbon|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. + * @method Carbon|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method Carbon createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method Carbon createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method Carbon disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method Carbon enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method Carbon fromSerialized($value) Create an instance from a serialized string. + * @method void genericMacro($macro, $priority = 0) Register a custom macro. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week + * @method string|null getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. + * @method int getMidDayAt() get midday/noon hour + * @method Closure|Carbon getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. + * @method int getWeekEndsAt() Get the last day of week + * @method int getWeekStartsAt() Get the first day of week + * @method array getWeekendDays() Get weekend days + * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasMacro($name) Checks if macro is registered globally. + * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. + * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * @method Carbon instance($date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method void macro($name, $macro) Register a custom macro. + * @method Carbon|null make($var) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method Carbon maxValue() Create a Carbon instance for the greatest supported date. + * @method Carbon minValue() Create a Carbon instance for the lowest supported date. + * @method void mixin($mixin) Mix another object into the class. + * @method Carbon now($tz = null) Get a Carbon instance for the current date and time. + * @method Carbon parse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method Carbon parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method Carbon|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method Carbon rawParse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method Carbon resetMacros() Remove all macros and generic macros. + * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string + * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * JSON serialize all Carbon instances using the given callback. + * @method Carbon setFallbackLocale($locale) Set the fallback locale. + * @method Carbon setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use closest language from the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method Carbon setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method Carbon setTestNowAndTimezone($testNow = null, $tz = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump an other string + * format. + * Set the default format used when type juggling a Carbon instance to a string + * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. + * @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use UTF-8 language packages on every machine. + * Set if UTF8 will be used for localized date/time. + * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek + * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the + * start of week according to current locale selected and implicitly the end of week. + * Set the last day of week + * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the + * 'first_day_of_week' locale setting to change the start of week according to current locale + * selected and implicitly the end of week. + * Set the first day of week + * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * Set weekend days + * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). + * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method Carbon today($tz = null) Create a Carbon instance for today. + * @method Carbon tomorrow($tz = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method Carbon useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * /!\ Use this method for unit tests only. + * @method Carbon yesterday($tz = null) Create a Carbon instance for yesterday. * * </autodoc> */ @@ -289,7 +305,13 @@ class Factory return \in_array($parameter->getName(), ['tz', 'timezone'], true); }); - if (\count($tzParameters)) { + if (isset($arguments[0]) && \in_array($name, ['instance', 'make', 'create', 'parse'], true)) { + if ($arguments[0] instanceof DateTimeInterface) { + $settings['innerTimezone'] = $settings['timezone']; + } elseif (\is_string($arguments[0]) && date_parse($arguments[0])['is_localtime']) { + unset($settings['timezone'], $settings['innerTimezone']); + } + } elseif (\count($tzParameters)) { array_splice($arguments, key($tzParameters), 0, [$settings['timezone']]); unset($settings['timezone']); } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php index 3aa286c0..596ee806 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use Closure; @@ -17,208 +18,222 @@ use Closure; * * <autodoc generated by `composer phpdoc`> * - * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a - * new instance. - * @method CarbonImmutable|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. - * @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). - * @method CarbonImmutable|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. - * @method CarbonImmutable|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. - * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. - * @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. - * @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. - * Timestamp input can be given as int, float or a string containing one or more numbers. - * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. - * @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. - * If any of $year, $month or $day are set to null their now() values will - * be used. - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * If $hour is not null then the default values for $minute and $second - * will be 0. - * If one of the set values is not valid, an InvalidDateException - * will be thrown. - * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. - * @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. - * @method void genericMacro($macro, $priority = 0) Register a custom macro. - * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native - * name, region and variant of the locale. - * @method array getDays() Get the days of the week - * @method string|null getFallbackLocale() Get the fallback locale. - * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). - * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). - * @method array getIsoUnits() Returns list of locale units for ISO formatting. - * @method CarbonImmutable getLastErrors() {@inheritdoc} - * @method string getLocale() Get the current translator locale. - * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. - * @method int getMidDayAt() get midday/noon hour - * @method Closure|CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. - * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. - * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. - * @method int getWeekEndsAt() Get the last day of week - * @method int getWeekStartsAt() Get the first day of week - * @method array getWeekendDays() Get weekend days - * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. - * @method bool hasMacro($name) Checks if macro is registered globally. - * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. - * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one. - * @method bool isImmutable() Returns true if the current class/instance is immutable. - * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. - * @method bool isMutable() Returns true if the current class/instance is mutable. - * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. - * (It can be overridden in specific instances.) - * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * @method void macro($name, $macro) Register a custom macro. - * @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible. - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. - * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. - * @method void mixin($mixin) Mix another object into the class. - * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. - * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). - * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). - * @method CarbonImmutable|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. - * @method CarbonImmutable rawParse($time = null, $tz = null) Create a carbon instance from a string. - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * @method CarbonImmutable resetMacros() Remove all macros and generic macros. - * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string - * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather transform Carbon object before the serialization. - * JSON serialize all Carbon instances using the given callback. - * @method CarbonImmutable setFallbackLocale($locale) Set the fallback locale. - * @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. - * Pass 'auto' as locale to use closest language from the current LC_TIME locale. - * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider mid-day is always 12pm, then if you need to test if it's an other - * hour, test it explicitly: - * $date->format('G') == 13 - * or to set explicitly to a given hour: - * $date->setTime(13, 0, 0, 0) - * Set midday/noon hour - * @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * To clear the test instance call this method using the default - * parameter of null. - * /!\ Use this method for unit tests only. - * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and - * use other method or custom format passed to format() method if you need to dump an other string - * format. - * Set the default format used when type juggling a Carbon instance to a string - * @method void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) Set the default translator instance to use. - * @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use UTF-8 language packages on every machine. - * Set if UTF8 will be used for localized date/time. - * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek - * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the - * start of week according to current locale selected and implicitly the end of week. - * Set the last day of week - * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the - * 'first_day_of_week' locale setting to change the start of week according to current locale - * selected and implicitly the end of week. - * Set the first day of week - * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather consider week-end is always saturday and sunday, and if you have some custom - * week-end days to handle, give to those days an other name and create a macro for them: - * ``` - * Carbon::macro('isDayOff', function ($date) { - * return $date->isSunday() || $date->isMonday(); - * }); - * Carbon::macro('isNotDayOff', function ($date) { - * return !$date->isDayOff(); - * }); - * if ($someDate->isDayOff()) ... - * if ($someDate->isNotDayOff()) ... - * // Add 5 not-off days - * $count = 5; - * while ($someDate->isDayOff() || ($count-- > 0)) { - * $someDate->addDay(); - * } - * ``` - * Set weekend days - * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). - * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). - * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). - * @method CarbonImmutable today($tz = null) Create a Carbon instance for today. - * @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow. - * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. - * @method string translateWith(\Symfony\Component\Translation\TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. - * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. - * You should rather use the ->settings() method. - * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants - * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. - * Using setTestNow to set the date, executing the callback, then - * clearing the test instance. - * /!\ Use this method for unit tests only. - * @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday. + * @method bool canBeCreatedFromFormat($date, $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method CarbonImmutable|false create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method CarbonImmutable|false createFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method CarbonImmutable|false createFromIsoFormat($format, $time, $tz = null, $locale = 'en', $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method CarbonImmutable|false createFromLocaleFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific format and a string in a given language. + * @method CarbonImmutable|false createFromLocaleIsoFormat($format, $locale, $time, $tz = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method CarbonImmutable createFromTimeString($time, $tz = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method CarbonImmutable createFromTimestamp($timestamp, $tz = null) Create a Carbon instance from a timestamp and set the timezone (use default one if not specified). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMs($timestamp, $tz = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampUTC($timestamp) Create a Carbon instance from an timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $tz = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method CarbonImmutable|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method CarbonInterface createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $tz = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method CarbonImmutable disableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method CarbonImmutable enableHumanDiffOption($humanDiffOption) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method mixed executeWithLocale($locale, $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. + * @method void genericMacro($macro, $priority = 0) Register a custom macro. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week + * @method string|null getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method int getHumanDiffOptions() Return default humanDiff() options (merged flags as integer). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method callable|null getMacro($name) Get the raw callable macro registered globally for a given name. + * @method int getMidDayAt() get midday/noon hour + * @method Closure|CarbonImmutable getTestNow() Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * @method string getTimeFormatByPrecision($unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method \Symfony\Component\Translation\TranslatorInterface getTranslator() Get the default translator instance in use. + * @method int getWeekEndsAt() Get the last day of week + * @method int getWeekStartsAt() Get the first day of week + * @method array getWeekendDays() Get weekend days + * @method bool hasFormat($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasFormatWithModifiers($date, $format) Checks if the (date)time string is in a given format. + * @method bool hasMacro($name) Checks if macro is registered globally. + * @method bool hasRelativeKeywords($time) Determine if a time string will produce a relative date. + * @method bool hasTestNow() Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * @method CarbonImmutable instance($date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool isStrictModeEnabled() Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * @method bool localeHasDiffOneDayWords($locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax($locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords($locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits($locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method void macro($name, $macro) Register a custom macro. + * @method CarbonImmutable|null make($var) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. + * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. + * @method void mixin($mixin) Mix another object into the class. + * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. + * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method CarbonImmutable parseFromLocale($time, $locale = null, $tz = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method CarbonImmutable|false rawCreateFromFormat($format, $time, $tz = null) Create a Carbon instance from a specific format. + * @method CarbonImmutable rawParse($time = null, $tz = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method CarbonImmutable resetMacros() Remove all macros and generic macros. + * @method void resetMonthsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void resetToStringFormat() Reset the format used to the default when type juggling a Carbon instance to a string + * @method void resetYearsOverflow() @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method void serializeUsing($callback) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * JSON serialize all Carbon instances using the given callback. + * @method CarbonImmutable setFallbackLocale($locale) Set the fallback locale. + * @method CarbonImmutable setHumanDiffOptions($humanDiffOptions) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method bool setLocale($locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use closest language from the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method CarbonImmutable setTestNow($testNow = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method CarbonImmutable setTestNowAndTimezone($testNow = null, $tz = null) Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * To clear the test instance call this method using the default + * parameter of null. + * /!\ Use this method for unit tests only. + * @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump an other string + * format. + * Set the default format used when type juggling a Carbon instance to a string + * @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use. + * @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use UTF-8 language packages on every machine. + * Set if UTF8 will be used for localized date/time. + * @method void setWeekEndsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekStartsAt optional parameter instead when using startOfWeek, floorWeek, ceilWeek + * or roundWeek method. You can also use the 'first_day_of_week' locale setting to change the + * start of week according to current locale selected and implicitly the end of week. + * Set the last day of week + * @method void setWeekStartsAt($day) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * Use $weekEndsAt optional parameter instead when using endOfWeek method. You can also use the + * 'first_day_of_week' locale setting to change the start of week according to current locale + * selected and implicitly the end of week. + * Set the first day of week + * @method void setWeekendDays($days) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * Set weekend days + * @method bool shouldOverflowMonths() Get the month overflow global behavior (can be overridden in specific instances). + * @method bool shouldOverflowYears() Get the month overflow global behavior (can be overridden in specific instances). + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method CarbonImmutable today($tz = null) Create a Carbon instance for today. + * @method CarbonImmutable tomorrow($tz = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString($timeString, $from = null, $to = null, $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method void useMonthsOverflow($monthsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method CarbonImmutable useStrictMode($strictModeEnabled = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @method void useYearsOverflow($yearsOverflow = true) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * /!\ Use this method for unit tests only. + * @method CarbonImmutable yesterday($tz = null) Create a Carbon instance for yesterday. * * </autodoc> */ diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php index 40d8d86c..f2fcf053 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/af.php', [ 'meridiem' => ['v', 'n'], 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php index 93f4c839..27896bd0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/af.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/agq.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/agq.php index 58c7a110..70114649 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/agq.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/agq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a.g', 'a.k'], 'weekdays' => ['tsuʔntsɨ', 'tsuʔukpà', 'tsuʔughɔe', 'tsuʔutɔ̀mlò', 'tsuʔumè', 'tsuʔughɨ̂m', 'tsuʔndzɨkɔʔɔ'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php index 8d377adb..e790b99e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ar.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/asa.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/asa.php index 83897571..03bb4839 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/asa.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/asa.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['icheheavo', 'ichamthi'], 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php index d6979180..28fc62fe 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/az.php', [ 'weekdays' => ['базар', 'базар ертәси', 'чәршәнбә ахшамы', 'чәршәнбә', 'ҹүмә ахшамы', 'ҹүмә', 'шәнбә'], 'weekdays_short' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php index 8346a5dd..0be33914 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/az.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bas.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bas.php index 1b342bbc..41bfa1d8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bas.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bas.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['I bikɛ̂glà', 'I ɓugajɔp'], 'weekdays' => ['ŋgwà nɔ̂y', 'ŋgwà njaŋgumba', 'ŋgwà ûm', 'ŋgwà ŋgê', 'ŋgwà mbɔk', 'ŋgwà kɔɔ', 'ŋgwà jôn'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php index ce8dbe83..51b4d0cc 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php @@ -8,9 +8,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + // @codeCoverageIgnoreStart + +use Carbon\CarbonInterface; +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'be'); } @@ -113,7 +118,7 @@ return [ 'nextDay' => '[Заўтра ў] LT', 'nextWeek' => '[У] dddd [ў] LT', 'lastDay' => '[Учора ў] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 1: case 2: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bez.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bez.php index 1facc9dc..d59c5ef5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bez.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bez.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['pamilau', 'pamunyi'], 'weekdays' => ['pa mulungu', 'pa shahuviluha', 'pa hivili', 'pa hidatu', 'pa hitayi', 'pa hihanu', 'pa shahulembela'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg.php index 0e17673e..f7680740 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg.php @@ -17,6 +17,9 @@ * - JD Isaacks * - Glavić */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', @@ -63,7 +66,7 @@ return [ 'nextDay' => '[Утре в] LT', 'nextWeek' => 'dddd [в] LT', 'lastDay' => '[Вчера в] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: case 3: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php index 85c0783e..b53874d3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bg.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php index c3d9d8b1..380abb1e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bo.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php index a377fb54..ca50d049 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bo.php', [ 'meridiem' => ['སྔ་དྲོ་', 'ཕྱི་དྲོ་'], 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php index 9d939fd9..7f541858 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/br.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs.php index d2fc5aaa..e5d68083 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs.php @@ -18,6 +18,9 @@ * - Serhan Apaydın * - JD Isaacks */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count godina|:count godine|:count godina', @@ -55,7 +58,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: return '[u] [nedjelju] [u] LT'; @@ -68,7 +71,7 @@ return [ } }, 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 0: case 3: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php index 4dd21bab..0a591176 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/bs.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php index 09221e0a..e1a17447 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bs.php', [ 'meridiem' => ['пре подне', 'поподне'], 'weekdays' => ['недјеља', 'понедјељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php index 91ed1cc8..b4e363e7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/bs.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca.php index 5c914397..b8b19946 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca.php @@ -21,6 +21,9 @@ * - Xavi * - qcardona */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count any|:count anys', 'a_year' => 'un any|:count anys', @@ -69,19 +72,19 @@ return [ 'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; }, 'sameElse' => 'L', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php index f5718c39..861acd2a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php index 84236064..50049786 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ca.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php index f5718c39..861acd2a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php index f5718c39..861acd2a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php index f5718c39..861acd2a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ca.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php index ec616a77..99c1dcac 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['𑄢𑄧𑄝𑄨𑄝𑄢𑄴', '𑄥𑄧𑄟𑄴𑄝𑄢𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴', '𑄝𑄪𑄖𑄴𑄝𑄢𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴', '𑄥𑄧𑄚𑄨𑄝𑄢𑄴'], 'weekdays_short' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php index 18bd1224..c1fa8af0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ccp.php', [ 'weekend' => [0, 0], ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php index e4244082..09bcc1c7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php index a16a3467..ea2517e8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cs.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cu.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cu.php index 02c983aa..d6d13128 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cu.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv.php index cec1fc91..8aeb73aa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv.php @@ -32,7 +32,7 @@ return [ 'a_second' => '{1}пӗр-ик ҫеккунт|:count ҫеккунт', 'ago' => ':time каялла', 'from_now' => function ($time) { - return $time.(preg_match('/сехет$/', $time) ? 'рен' : (preg_match('/ҫул/', $time) ? 'тан' : 'ран')); + return $time.(preg_match('/сехет$/u', $time) ? 'рен' : (preg_match('/ҫул/u', $time) ? 'тан' : 'ран')); }, 'diff_yesterday' => 'Ӗнер', 'diff_today' => 'Паян', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php index ddff8931..197bd8d3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cv.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php index 541127c6..2c8148d0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/cy.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php index b3bac1a9..392c4841 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/da.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php index b2ba81f5..ea5698b9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/da.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dav.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dav.php index 79f021e1..e95ec4bb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dav.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dav.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Luma lwa K', 'luma lwa p'], 'weekdays' => ['Ituku ja jumwa', 'Kuramuka jimweri', 'Kuramuka kawi', 'Kuramuka kadadu', 'Kuramuka kana', 'Kuramuka kasanu', 'Kifula nguwo'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php index 82edfa1d..03e606a6 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/de.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dje.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dje.php index 08ddbf13..74b7ac12 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dje.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dje.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamisi', 'Alzuma', 'Asibti'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dua.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dua.php index 65d712f5..55e5c7c3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dua.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dua.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['idiɓa', 'ebyámu'], 'weekdays' => ['éti', 'mɔ́sú', 'kwasú', 'mukɔ́sú', 'ŋgisú', 'ɗónɛsú', 'esaɓasú'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv.php index a2b60dff..4b8d7e1a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'ޖެނުއަރީ', 'ފެބްރުއަރީ', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php index 208fb5a3..2668d5b0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php @@ -3,7 +3,7 @@ /** * This file is part of the Carbon package. * - * (c) Ahmed Ali <ajaaibu@gmail.com> + * (c) Brian Nesbitt <brian@nesbot.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php index ecb649b0..33082e67 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Dimas', 'Teneŋ', 'Talata', 'Alarbay', 'Aramisay', 'Arjuma', 'Sibiti'], 'weekdays_short' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php index 5aab48d9..f60bc6f2 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['KI', 'UT'], 'weekdays' => ['Kiumia', 'Njumatatu', 'Njumaine', 'Njumatano', 'Aramithi', 'Njumaa', 'NJumamothii'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee.php index 2fd9dcd8..f96c5c9d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ŋ', 'ɣ'], 'weekdays' => ['kɔsiɖa', 'dzoɖa', 'blaɖa', 'kuɖa', 'yawoɖa', 'fiɖa', 'memleɖa'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php index 02d77e6d..7a8b36c9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ee.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/el.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/el.php index 09cf7e89..7c40f9c1 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/el.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/el.php @@ -19,6 +19,9 @@ * - yiannisdesp * - Ilias Kasmeridis (iliaskasm) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count χρόνος|:count χρόνια', 'a_year' => 'ένας χρόνος|:count χρόνια', @@ -65,7 +68,7 @@ return [ 'nextDay' => '[Αύριο {}] LT', 'nextWeek' => 'dddd [{}] LT', 'lastDay' => '[Χθες {}] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { switch ($current->dayOfWeek) { case 6: return '[το προηγούμενο] dddd [{}] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php index 6ae11c9a..11457b0c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php index 1d0d34ff..67bceaad 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php index ce4780c6..c4e2557e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php index ed0b3f93..5ee95241 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'from_now' => 'in :time', 'formats' => [ diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php index 9f2a3f74..e2dd81db 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php index 31f60e19..f086dc63 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/en.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php index daaf2570..f77ec39c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php @@ -27,6 +27,9 @@ * - Daniel Commesse Liévanos (danielcommesse) * - Pete Scopes (pdscopes) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count año|:count años', 'a_year' => 'un año|:count años', @@ -77,19 +80,19 @@ return [ 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT'; }, 'sameElse' => 'L', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php index e9dbe2b9..378d0547 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php index e9dbe2b9..378d0547 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php index 96391d47..f02e1a66 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php index 96391d47..f02e1a66 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php index 96391d47..f02e1a66 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php index 96391d47..f02e1a66 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php index ea345b21..deae06a1 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es.php', [ 'first_day_of_week' => 0, 'formats' => [ diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php index 3588f627..0f112b34 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/et.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php index 442cca79..0d1e82a9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/eu.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php index f5ae8cf9..7808ab50 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kíkíríg', 'ngəgógəle'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndi', 'sɔ́ndɔ məlú mə́bɛ̌', 'sɔ́ndɔ məlú mə́lɛ́', 'sɔ́ndɔ məlú mə́nyi', 'fúladé', 'séradé'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php index 06566fa4..69471004 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'meridiem' => ['ق', 'ب'], 'weekend' => [4, 5], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php index 6d1832c2..08d01825 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fa.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php index dafa98e3..b797ac09 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ff.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php index dafa98e3..b797ac09 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ff.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php index 65276d3f..2f4c29f6 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ff.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php index 3597fa22..920f1caa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fi.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php index e0f45378..657f2c5b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fo.php', [ 'formats' => [ 'L' => 'DD.MM.yy', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php index 6a4bc313..6d736167 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fo.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php index 52b951cd..67d37878 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'meridiem' => ['mat.', 'soir'], ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php index 40579a46..2f060869 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'formats' => [ diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php index 2c1ab853..ae8db5fa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php index 7d2b1dbe..1bf034dc 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php index d177a7d7..37cf83f0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php index 2c1ab853..ae8db5fa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'first_day_of_week' => 6, 'weekend' => [5, 6], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php index d177a7d7..37cf83f0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php index d3e26568..6905e7a8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'weekend' => [5, 6], 'formats' => [ diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php index d177a7d7..37cf83f0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fr.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php index f9801e87..ec3ee359 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/fr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php index d50630cf..57b0c4fb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ga.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php index 80da9c65..4fc26b3d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gd.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl.php index 58c1db15..088b0f28 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl.php @@ -17,6 +17,9 @@ * - Diego Vilariño * - Sebastian Thierer */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count ano|:count anos', 'a_year' => 'un ano|:count anos', @@ -65,19 +68,19 @@ return [ 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $current) { + 'sameDay' => function (CarbonInterface $current) { return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'nextDay' => function (\Carbon\CarbonInterface $current) { + 'nextDay' => function (CarbonInterface $current) { return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'nextWeek' => function (\Carbon\CarbonInterface $current) { + 'nextWeek' => function (CarbonInterface $current) { return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, - 'lastDay' => function (\Carbon\CarbonInterface $current) { + 'lastDay' => function (CarbonInterface $current) { return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT'; }, - 'lastWeek' => function (\Carbon\CarbonInterface $current) { + 'lastWeek' => function (CarbonInterface $current) { return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; }, 'sameElse' => 'L', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php index 12a565ff..9d6c1d96 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gl.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php index 5e54a368..612bb886 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return [ 'year' => ':count voros|:count vorsam', 'y' => ':countv', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php index 0dba9c54..594eb25d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gsw.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php index e0e7b234..3581dcfb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php index e0e7b234..3581dcfb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/gsw.php', [ 'meridiem' => ['vorm.', 'nam.'], 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu.php index 7c7872bc..8bc43114 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu.php @@ -18,7 +18,7 @@ return [ 'year' => 'એક વર્ષ|:count વર્ષ', 'y' => ':countવર્ષ|:countવર્ષો', - 'month' => 'એક મહિનો|:count મહિનો', + 'month' => 'એક મહિનો|:count મહિના', 'm' => ':countમહિનો|:countમહિના', 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', 'w' => ':countઅઠ.|:countઅઠ.', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php index c5784408..02654b1f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/gu.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/guz.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/guz.php index aa9769ce..6230165c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/guz.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/guz.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ma', 'Mo'], 'weekdays' => ['Chumapiri', 'Chumatato', 'Chumaine', 'Chumatano', 'Aramisi', 'Ichuma', 'Esabato'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php index bce5e415..f9f99a73 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php index bce5e415..f9f99a73 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php index bce5e415..f9f99a73 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ha.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/haw.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/haw.php index 51715d8e..cdd36861 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/haw.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/haw.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['Ianuali', 'Pepeluali', 'Malaki', 'ʻApelila', 'Mei', 'Iune', 'Iulai', 'ʻAukake', 'Kepakemapa', 'ʻOkakopa', 'Nowemapa', 'Kekemapa'], 'months_short' => ['Ian.', 'Pep.', 'Mal.', 'ʻAp.', 'Mei', 'Iun.', 'Iul.', 'ʻAu.', 'Kep.', 'ʻOk.', 'Now.', 'Kek.'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php index 57c4fec8..14fab3e9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/he.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php index ac302995..749dd97c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hi.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr.php index acb7e92c..cfd85fd4 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr.php @@ -27,6 +27,9 @@ * - Stjepan Majdak * - Vanja Retkovac (vr00) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godinu|:count godine|:count godina', 'y' => ':count god.|:count god.|:count god.', @@ -67,7 +70,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u] [nedjelju] [u] LT'; @@ -80,7 +83,7 @@ return [ } }, 'lastDay' => '[jučer u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 3: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php index 2ae141dc..db74d8c7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php index 673f9dc4..b2d2ac11 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php @@ -15,6 +15,9 @@ * - Brett Johnson * - balping */ + +use Carbon\CarbonInterface; + $huWeekEndings = ['vasárnap', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton']; return [ @@ -99,11 +102,11 @@ return [ 'calendar' => [ 'sameDay' => '[ma] LT[-kor]', 'nextDay' => '[holnap] LT[-kor]', - 'nextWeek' => function (\Carbon\CarbonInterface $date) use ($huWeekEndings) { + 'nextWeek' => function (CarbonInterface $date) use ($huWeekEndings) { return '['.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'lastDay' => '[tegnap] LT[-kor]', - 'lastWeek' => function (\Carbon\CarbonInterface $date) use ($huWeekEndings) { + 'lastWeek' => function (CarbonInterface $date) use ($huWeekEndings) { return '[múlt '.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; }, 'sameElse' => 'L', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php index b33a6319..b1c48541 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/hu.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php index d19e4f40..e65449b8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'YYYY-MM-DD', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php index 406112af..d5953a14 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/id.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ii.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ii.php index 30f83740..a4246c27 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ii.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ii.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ꎸꄑ', 'ꁯꋒ'], 'weekdays' => ['ꑭꆏꑍ', 'ꆏꊂꋍ', 'ꆏꊂꑍ', 'ꆏꊂꌕ', 'ꆏꊂꇖ', 'ꆏꊂꉬ', 'ꆏꊂꃘ'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/in.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/in.php index 406112af..d5953a14 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/in.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/in.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/id.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php index 8b91bb23..4d35c448 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/is.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php index c23d8db1..605bcbb5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php @@ -22,6 +22,9 @@ * - Davide Casiraghi (davide-casiraghi) * - Pete Scopes (pdscopes) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count anno|:count anni', 'a_year' => 'un anno|:count anni', @@ -81,7 +84,7 @@ return [ 'nextDay' => '[Domani alle] LT', 'nextWeek' => 'dddd [alle] LT', 'lastDay' => '[Ieri alle] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[la scorsa] dddd [alle] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php index 57fab39a..5e8fc92f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/it.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php index 57fab39a..5e8fc92f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/it.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/iw.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/iw.php index a8034e83..a26e3506 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/iw.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/iw.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja.php index fa4cb367..1ca67519 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja.php @@ -21,6 +21,9 @@ * - toyama satoshi * - atakigawa */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count年', 'y' => ':count年', @@ -56,7 +59,7 @@ return [ 'calendar' => [ 'sameDay' => '[今日] LT', 'nextDay' => '[明日] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($other->week !== $current->week) { return '[来週]dddd LT'; } @@ -64,7 +67,7 @@ return [ return 'dddd LT'; }, 'lastDay' => '[昨日] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($other->week !== $current->week) { return '[先週]dddd LT'; } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php index 9e035fdb..c2836253 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ja.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php index bad6beb7..6a1e77a8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php index f8cc72c1..ed92e8e7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka.php index 5ddb957d..a5d563d3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka.php @@ -24,6 +24,9 @@ * - Avtandil Kikabidze (akalongman) * - Levan Velijanashvili (Stichoza) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count წელი', 'y' => ':count წელი', @@ -149,7 +152,7 @@ return [ 'calendar' => [ 'sameDay' => '[დღეს], LT[-ზე]', 'nextDay' => '[ხვალ], LT[-ზე]', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { return ($current->isSameWeek($other) ? '' : '[შემდეგ] ').'dddd, LT[-ზე]'; }, 'lastDay' => '[გუშინ], LT[-ზე]', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php index dd77fa3e..a26d9305 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ka.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kam.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kam.php index 0fb6b2ea..0fc70d70 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kam.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kam.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ĩyakwakya', 'Ĩyawĩoo'], 'weekdays' => ['Wa kyumwa', 'Wa kwambĩlĩlya', 'Wa kelĩ', 'Wa katatũ', 'Wa kana', 'Wa katano', 'Wa thanthatũ'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kde.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kde.php index 8acdaba3..fbcc9f3d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kde.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kde.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Muhi', 'Chilo'], 'weekdays' => ['Liduva lyapili', 'Liduva lyatatu', 'Liduva lyanchechi', 'Liduva lyannyano', 'Liduva lyannyano na linji', 'Liduva lyannyano na mavili', 'Liduva litandi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kea.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kea.php index 8a334e24..8b6c21b9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kea.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kea.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sabadu'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/khq.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/khq.php index f0649e7c..7a834cf0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/khq.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/khq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atini', 'Atalata', 'Alarba', 'Alhamiisa', 'Aljuma', 'Assabdu'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ki.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ki.php index 5754ffc1..d86afc50 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ki.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ki.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Kiroko', 'Hwaĩ-inĩ'], 'weekdays' => ['Kiumia', 'Njumatatũ', 'Njumaine', 'Njumatana', 'Aramithi', 'Njumaa', 'Njumamothi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php index af4a5b2b..7dc5ebcc 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/kk.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php index bad6beb7..6a1e77a8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kln.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kln.php index b034ba50..b9c39968 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kln.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kln.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['krn', 'koosk'], 'weekdays' => ['Kotisap', 'Kotaai', 'Koaeng’', 'Kosomok', 'Koang’wan', 'Komuut', 'Kolo'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php index ef3b415e..92e5fdbd 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/km.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php index 7c6c9096..30e3d886 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/kn.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php index 55b40fa2..4ba802b3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ko.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php index d8eba2cb..9d873a27 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ko.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php index 424099dc..aaa00614 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['makeo', 'nyiaghuo'], 'weekdays' => ['Jumaapii', 'Jumaatatu', 'Jumaane', 'Jumaatano', 'Alhamisi', 'Ijumaa', 'Jumaamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php index 8fb55989..84a59672 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['sárúwá', 'cɛɛ́nko'], 'weekdays' => ['sɔ́ndǝ', 'lǝndí', 'maadí', 'mɛkrɛdí', 'jǝǝdí', 'júmbá', 'samdí'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php index 44c60a4d..95457e24 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['v.M.', 'n.M.'], 'weekdays' => ['Sunndaach', 'Mohndaach', 'Dinnsdaach', 'Metwoch', 'Dunnersdaach', 'Friidaach', 'Samsdaach'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php index 11fce2d8..4243a82f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ku.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php index 4426bea4..9923a31e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ky.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lag.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lag.php index dc959c96..f3f57f6a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lag.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lag.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['TOO', 'MUU'], 'weekdays' => ['Jumapíiri', 'Jumatátu', 'Jumaíne', 'Jumatáano', 'Alamíisi', 'Ijumáa', 'Jumamóosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb.php index db048342..7636655e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb.php @@ -16,6 +16,9 @@ * - dan-nl * - Simon Lelorrain (slelorrain) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count Joer', 'y' => ':countJ', @@ -57,7 +60,7 @@ return [ 'nextDay' => '[Muer um] LT', 'nextWeek' => 'dddd [um] LT', 'lastDay' => '[Gëschter um] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule switch ($date->dayOfWeek) { case 2: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php index c8625fe9..414bd4d0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lb.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php index 968b0588..ae73a97b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'month' => ':count haŋwí', // less reliable diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php index e244096c..7fdb7f1b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php index e244096c..7fdb7f1b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php index e244096c..7fdb7f1b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ln.php', [ 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php index c0a1d6b4..9b7fd9bf 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lo.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php index 10661bb0..546e6791 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'minute' => ':count هنر', // less reliable diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php index 449d8632..d42f5e97 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php @@ -8,5 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/lrc.php', [ ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php index c3087f4e..f772d38b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lu.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lu.php index 8dab5417..c8cd83af 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lu.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Dinda', 'Dilolo'], 'weekdays' => ['Lumingu', 'Nkodya', 'Ndàayà', 'Ndangù', 'Njòwa', 'Ngòvya', 'Lubingu'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luo.php index 201ca969..b55af731 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['OD', 'OT'], 'weekdays' => ['Jumapil', 'Wuok Tich', 'Tich Ariyo', 'Tich Adek', 'Tich Ang’wen', 'Tich Abich', 'Ngeso'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luy.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luy.php index 52191253..2b37e3e3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luy.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/luy.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Jumapiri', 'Jumatatu', 'Jumanne', 'Jumatano', 'Murwa wa Kanne', 'Murwa wa Katano', 'Jumamosi'], 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php index 724b58df..693eceb5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php @@ -1,5 +1,14 @@ <?php +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Carbon\CarbonInterface; /** @@ -168,6 +177,6 @@ return [ 'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], 'months' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], - 'months_short' => ['Janv', 'Feb', 'Mar', 'Apr', 'Mai', 'Jūn', 'Jūl', 'Aug', 'Sept', 'Okt', 'Nov', 'Dec'], + 'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], 'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], ]; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php index 46c0f430..ee91c369 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/lv.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas.php index 723ae67e..cbd610c2 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Ɛnkakɛnyá', 'Ɛndámâ'], 'weekdays' => ['Jumapílí', 'Jumatátu', 'Jumane', 'Jumatánɔ', 'Alaámisi', 'Jumáa', 'Jumamósi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php index aa382b72..56e29053 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/mas.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mer.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mer.php index cb7ba8d7..2e14597f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mer.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mer.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['RŨ', 'ŨG'], 'weekdays' => ['Kiumia', 'Muramuko', 'Wairi', 'Wethatu', 'Wena', 'Wetano', 'Jumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php index 65798a80..2a80960d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['wichishu', 'mchochil’l'], 'weekdays' => ['Sabato', 'Jumatatu', 'Jumanne', 'Jumatano', 'Arahamisi', 'Ijumaa', 'Jumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php index a5a07543..a126c9ff 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], 'weekdays_short' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php index 123d2292..6b964e3a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mi.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php index b56783ee..57faa318 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'formats' => [ 'L' => 'DD/MM/YY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk.php index 853bc96d..d822de09 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk.php @@ -19,6 +19,9 @@ * - JD Isaacks * - Tomi Atanasoski */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count година|:count години', 'a_year' => 'година|:count години', @@ -65,7 +68,7 @@ return [ 'nextDay' => '[Утре во] LT', 'nextWeek' => '[Во] dddd [во] LT', 'lastDay' => '[Вчера во] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 3: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php index 06ff7d9d..95e2ff9c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mk.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php index 20878dce..000e7958 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ml.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php index 25f65b33..717d199b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php @@ -5,11 +5,8 @@ * * (c) Brian Nesbitt <brian@nesbot.com> * - * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. - * - * @translator Batmandakh Erdenebileg <batmandakh.e@icloud.com> */ /* diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php index b8fef24c..e5ce426c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mn.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mo.php index dd7c8f09..102afcde 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mo.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ro.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php index 556cefa2..7bca919f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php index ed7d48f8..36934eeb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php @@ -75,12 +75,18 @@ return [ 'sameElse' => 'L', ], 'meridiem' => function ($hour) { + if ($hour < 1) { + return 'tengah malam'; + } + if ($hour < 12) { return 'pagi'; } - if ($hour < 15) { + + if ($hour < 13) { return 'tengah hari'; } + if ($hour < 19) { return 'petang'; } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php index ea2b453b..ef837a2d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php index 097a168f..77cb83d2 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ms.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php index 6ec2b339..9534f687 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/mt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mua.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mua.php index 8f1f9dcb..a3a3c6fd 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mua.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mua.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['comme', 'lilli'], 'weekdays' => ['Com’yakke', 'Comlaaɗii', 'Comzyiiɗii', 'Comkolle', 'Comkaldǝɓlii', 'Comgaisuu', 'Comzyeɓsuu'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php index 1f27ccae..a0108dd4 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/my.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php index 6ad36042..70f5f23c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/naq.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/naq.php index 614ced43..fbd9be91 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/naq.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/naq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ǁgoagas', 'ǃuias'], 'weekdays' => ['Sontaxtsees', 'Mantaxtsees', 'Denstaxtsees', 'Wunstaxtsees', 'Dondertaxtsees', 'Fraitaxtsees', 'Satertaxtsees'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php index bd643a8e..31678c53 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nb.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php index 93cbaef1..ce0210bc 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/nb.php', [ 'formats' => [ 'LL' => 'D. MMM YYYY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nd.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nd.php index d6fdaad3..f75d9a71 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nd.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nd.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sonto', 'Mvulo', 'Sibili', 'Sithathu', 'Sine', 'Sihlanu', 'Mgqibelo'], 'weekdays_short' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php index eb6e77e6..a6c57a91 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php @@ -20,36 +20,41 @@ return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['Jannuaar', 'Feberwaar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], 'weekdays' => ['Sünndag', 'Maandag', 'Dingsdag', 'Middeweek', 'Dunnersdag', 'Freedag', 'Sünnavend'], - 'weekdays_short' => ['Sdag', 'Maan', 'Ding', 'Migg', 'Dunn', 'Free', 'Svd.'], - 'weekdays_min' => ['Sdag', 'Maan', 'Ding', 'Migg', 'Dunn', 'Free', 'Svd.'], + 'weekdays_short' => ['Sdag', 'Maan', 'Ding', 'Midd', 'Dunn', 'Free', 'Svd.'], + 'weekdays_min' => ['Sd', 'Ma', 'Di', 'Mi', 'Du', 'Fr', 'Sa'], 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'year' => ':count Johr', - 'y' => ':count Johr', - 'a_year' => ':count Johr', + 'y' => ':countJ', + 'a_year' => '{1}een Johr|:count Johr', 'month' => ':count Maand', - 'm' => ':count Maand', - 'a_month' => ':count Maand', + 'm' => ':countM', + 'a_month' => '{1}een Maand|:count Maand', - 'week' => ':count Week', - 'w' => ':count Week', - 'a_week' => ':count Week', + 'week' => ':count Week|:count Weken', + 'w' => ':countW', + 'a_week' => '{1}een Week|:count Week|:count Weken', - 'day' => ':count Dag', - 'd' => ':count Dag', - 'a_day' => ':count Dag', + 'day' => ':count Dag|:count Daag', + 'd' => ':countD', + 'a_day' => '{1}een Dag|:count Dag|:count Daag', - 'hour' => ':count Stünn', - 'h' => ':count Stünn', - 'a_hour' => ':count Stünn', + 'hour' => ':count Stünn|:count Stünnen', + 'h' => ':countSt', + 'a_hour' => '{1}een Stünn|:count Stünn|:count Stünnen', - 'minute' => ':count Minuut', - 'min' => ':count Minuut', - 'a_minute' => ':count Minuut', + 'minute' => ':count Minuut|:count Minuten', + 'min' => ':countm', + 'a_minute' => '{1}een Minuut|:count Minuut|:count Minuten', - 'second' => ':count sekunn', - 's' => ':count sekunn', - 'a_second' => ':count sekunn', + 'second' => ':count Sekunn|:count Sekunnen', + 's' => ':counts', + 'a_second' => 'en poor Sekunnen|:count Sekunn|:count Sekunnen', + + 'ago' => 'vör :time', + 'from_now' => 'in :time', + 'before' => ':time vörher', + 'after' => ':time later', ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php index 2583bcf8..f68d00e3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ne.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php index 38caa1e5..27840c0f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ne.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl.php index fc8b5d9a..2d737703 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl.php @@ -71,9 +71,9 @@ return [ 'period_recurrences' => ':count keer', 'period_interval' => function (string $interval = '') { /** @var string $output */ - $output = preg_replace('/^(een|één|1)\s+/', '', $interval); + $output = preg_replace('/^(een|één|1)\s+/u', '', $interval); - if (preg_match('/^(een|één|1)( jaar|j| uur|u)/', $interval)) { + if (preg_match('/^(een|één|1)( jaar|j| uur|u)/u', $interval)) { return "elk $output"; } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php index 521d2d69..c269197b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php index 521d2d69..c269197b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php index 521d2d69..c269197b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php index 521d2d69..c269197b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nl.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php index f8850e29..4d1df6e5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['maná', 'kugú'], 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndɔ', 'sɔ́ndɔ mafú mába', 'sɔ́ndɔ mafú málal', 'sɔ́ndɔ mafú mána', 'mabágá má sukul', 'sásadi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php index ebbe0b78..8e168711 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/nn.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php index fa6a448e..007d2399 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['mbaʼámbaʼ', 'ncwònzém'], 'weekdays' => null, diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nus.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nus.php index 033e9756..789bc391 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nus.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nus.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['RW', 'TŊ'], 'weekdays' => ['Cäŋ kuɔth', 'Jiec la̱t', 'Rɛw lätni', 'Diɔ̱k lätni', 'Ŋuaan lätni', 'Dhieec lätni', 'Bäkɛl lätni'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php index fdc2ff46..8660ea42 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php index 94c3e04c..89693e67 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php @@ -14,8 +14,10 @@ * - Quentí */ // @codeCoverageIgnoreStart +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return $number == 1 ? 0 : 1; }, 'oc'); } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php index fde859fd..01eb5c14 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/oc.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php index 46483439..044760e3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/om.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php index b29a40fb..f5a4d1c9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/om.php', [ 'day_of_first_week_of_year' => 0, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php index 8b04dee2..39b06532 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ur.php', [ 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php index c0d35ecb..7adff5c3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pa.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php index ca10fe4a..f0196c0d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php @@ -25,7 +25,11 @@ * - Peter (UnrulyNatives) * - Qrzysio * - Jan (aso824) + * - diverpl */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count rok|:count lata|:count lat', 'a_year' => 'rok|:count lata|:count lat', @@ -44,12 +48,18 @@ return [ 'h' => ':count godz.', 'minute' => ':count minuta|:count minuty|:count minut', 'a_minute' => 'minuta|:count minuty|:count minut', - 'min' => ':count min.', + 'min' => ':count min', 'second' => ':count sekunda|:count sekundy|:count sekund', 'a_second' => '{1}kilka sekund|:count sekunda|:count sekundy|:count sekund', 's' => ':count sek.', 'ago' => ':time temu', - 'from_now' => 'za :time', + 'from_now' => static function ($time) { + return 'za '.strtr($time, [ + 'godzina' => 'godzinę', + 'minuta' => 'minutę', + 'sekunda' => 'sekundę', + ]); + }, 'after' => ':time po', 'before' => ':time przed', 'diff_now' => 'przed chwilą', @@ -72,7 +82,7 @@ return [ 'calendar' => [ 'sameDay' => '[Dziś o] LT', 'nextDay' => '[Jutro o] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[W niedzielę o] LT'; @@ -87,7 +97,7 @@ return [ } }, 'lastDay' => '[Wczoraj o] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[W zeszłą niedzielę o] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php index 69cd6976..222bcdb4 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pl.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/prg.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/prg.php index d0fd2f0d..6e63f4ad 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/prg.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/prg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php index e63121e3..6ec51804 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ps.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php index e36ca4c3..0af89499 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php @@ -23,6 +23,9 @@ * - Sebastian Thierer * - Claudson Martins (claudsonm) */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count ano|:count anos', 'a_year' => 'um ano|:count anos', @@ -81,7 +84,7 @@ return [ 'nextDay' => '[Amanhã às] LT', 'nextWeek' => 'dddd [às] LT', 'lastDay' => '[Ontem às] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: case 6: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php index 331fa5cc..f2b5eab7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pt.php', [ 'formats' => [ 'LT' => 'h:mm a', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php index 93bac23d..fbc0c97b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/pt.php', [ 'first_day_of_week' => 0, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php index 3d13bca6..22c01ec5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/pt.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu.php index 5f3a3924..65278cd1 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/es_UY.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php index 91635d59..d5db6bf5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php index 91635d59..d5db6bf5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/qu.php', [ 'first_day_of_week' => 1, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rn.php index 637d4e5e..8ab958eb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Z.MU.', 'Z.MW.'], 'weekdays' => ['Ku w’indwi', 'Ku wa mbere', 'Ku wa kabiri', 'Ku wa gatatu', 'Ku wa kane', 'Ku wa gatanu', 'Ku wa gatandatu'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php index 0ba6f68a..ad1d2fa8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ro.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php index dd7c8f09..102afcde 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ro.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rof.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rof.php index 80ab454f..205fc266 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rof.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rof.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kang’ama', 'kingoto'], 'weekdays' => ['Ijumapili', 'Ijumatatu', 'Ijumanne', 'Ijumatano', 'Alhamisi', 'Ijumaa', 'Ijumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru.php index 93e0e01b..673b043b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru.php @@ -35,6 +35,9 @@ * - Vladislav UnsealedOne * - dima-bzz */ + +use Carbon\CarbonInterface; + $transformDiff = function ($input) { return strtr($input, [ 'неделя' => 'неделю', @@ -97,7 +100,7 @@ return [ 'calendar' => [ 'sameDay' => '[Сегодня, в] LT', 'nextDay' => '[Завтра, в] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: @@ -120,7 +123,7 @@ return [ return '[В] dddd, [в] LT'; }, 'lastDay' => '[Вчера, в] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $current, \Carbon\CarbonInterface $other) { + 'lastWeek' => function (CarbonInterface $current, CarbonInterface $other) { if ($current->week !== $other->week) { switch ($current->dayOfWeek) { case 0: diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php index 2c8d78f8..8ca7df34 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php index 2c8d78f8..8ca7df34 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php index 2c8d78f8..8ca7df34 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php index 2c8d78f8..8ca7df34 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php index 2c8d78f8..8ca7df34 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ru.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php index f8cc72c1..ed92e8e7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/saq.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/saq.php index eebfac99..ff8bf604 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/saq.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/saq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Tesiran', 'Teipa'], 'weekdays' => ['Mderot ee are', 'Mderot ee kuni', 'Mderot ee ong’wan', 'Mderot ee inet', 'Mderot ee ile', 'Mderot ee sapa', 'Mderot ee kwe'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php index 9b737837..e29ca379 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Lwamilawu', 'Pashamihe'], 'weekdays' => ['Mulungu', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alahamisi', 'Ijumaa', 'Jumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sd.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sd.php index ad8c0009..0022c5a9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sd.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sd.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'جنوري', 'فيبروري', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php index b2b967ea..cf01805d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/se.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php index 83bbf78b..177c7e94 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/se.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php index 83bbf78b..177c7e94 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/se.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/seh.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/seh.php index 3ad889ab..babf9afb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/seh.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/seh.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['Dimingu', 'Chiposi', 'Chipiri', 'Chitatu', 'Chinai', 'Chishanu', 'Sabudu'], 'weekdays_short' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ses.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ses.php index 9355184f..e1099e65 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ses.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ses.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Adduha', 'Aluula'], 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamiisa', 'Alzuma', 'Asibti'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sg.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sg.php index 7f8e9daf..9264e893 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sg.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sg.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ND', 'LK'], 'weekdays' => ['Bikua-ôko', 'Bïkua-ûse', 'Bïkua-ptâ', 'Bïkua-usïö', 'Bïkua-okü', 'Lâpôsö', 'Lâyenga'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php index a953df42..e4aa5a1c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php @@ -8,9 +8,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + // @codeCoverageIgnoreStart +use Symfony\Component\Translation\PluralizationRules; + if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { - \Symfony\Component\Translation\PluralizationRules::set(function ($number) { + PluralizationRules::set(function ($number) { return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); }, 'sh'); } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi.php index ee5aa0bc..78151869 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵕⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php index a5580c30..cddfb242 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/shi.php', [ 'meridiem' => ['tifawt', 'tadggʷat'], 'weekdays' => ['asamas', 'aynas', 'asinas', 'akṛas', 'akwas', 'asimwas', 'asiḍyas'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php index e51ed130..f3df1f2c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/shi.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si.php index 289d4d57..636bf691 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si.php @@ -33,7 +33,7 @@ return [ 'a_second' => '{1}තත්පර කිහිපයකට|තත්පර :count', 'ago' => ':time කට පෙර', 'from_now' => function ($time) { - if (preg_match('/දින \d+/', $time)) { + if (preg_match('/දින \d/u', $time)) { return $time.' න්'; } @@ -41,7 +41,7 @@ return [ }, 'before' => ':time කට පෙර', 'after' => function ($time) { - if (preg_match('/දින \d+/', $time)) { + if (preg_match('/දින \d/u', $time)) { return $time.' න්'; } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php index 6c5be974..81c44e0e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/si.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php index be3d1f24..0515601a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sk.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php index 56d0f1bf..2e197212 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php @@ -29,6 +29,9 @@ * - Lovro Tramšek (Lovro1107) * - burut13 */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count leto|:count leti|:count leta|:count let', 'y' => ':count leto|:count leti|:count leta|:count let', @@ -96,7 +99,7 @@ return [ 'nextDay' => '[jutri ob] LT', 'nextWeek' => 'dddd [ob] LT', 'lastDay' => '[včeraj ob] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[preteklo] [nedeljo] [ob] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php index da9fef05..5dad8c81 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sl.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/smn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/smn.php index b252ebbd..20add023 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/smn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/smn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['ip.', 'ep.'], 'weekdays' => ['pasepeeivi', 'vuossaargâ', 'majebaargâ', 'koskoho', 'tuorâstuv', 'vástuppeeivi', 'lávurduv'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sn.php index 62c82b10..4f25028a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['a', 'p'], 'weekdays' => ['Svondo', 'Muvhuro', 'Chipiri', 'Chitatu', 'China', 'Chishanu', 'Mugovera'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php index 0bfbdf3a..ea5df3f2 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sq.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php index c844fe0d..62f752c4 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php index c844fe0d..62f752c4 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sq.php', [ 'formats' => [ 'L' => 'D.M.YYYY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr.php index 6ecf2d02..68ba663a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr.php @@ -19,6 +19,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => ':count godina|:count godine|:count godina', 'y' => ':count g.', @@ -64,7 +67,7 @@ return [ 'calendar' => [ 'sameDay' => '[danas u] LT', 'nextDay' => '[sutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u nedelju u] LT'; @@ -77,7 +80,7 @@ return [ } }, 'lastDay' => '[juče u] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[prošle nedelje u] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php index 85407423..c09df19c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php @@ -20,6 +20,9 @@ * - Nikola Zeravcic * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', 'y' => ':count г.', @@ -63,7 +66,7 @@ return [ 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[у недељу у] LT'; @@ -76,7 +79,7 @@ return [ } }, 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[прошле недеље у] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php index 36405d38..0fb63d76 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php index fb6179ee..d13229ab 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php @@ -14,6 +14,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return [ 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година', 'y' => ':count г.', @@ -60,7 +63,7 @@ return [ 'calendar' => [ 'sameDay' => '[данас у] LT', 'nextDay' => '[сутра у] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[у недељу у] LT'; @@ -73,7 +76,7 @@ return [ } }, 'lastDay' => '[јуче у] LT', - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[прошле недеље у] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php index 0643a414..492baf0c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [ 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php index 8ae8c41a..99716747 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php index c25a5072..897c674a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Latn.php', [ 'formats' => [ 'LT' => 'HH:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php index de20f21c..e2133ef1 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php @@ -14,6 +14,9 @@ * - Glavić * - Milos Sakovic */ + +use Carbon\CarbonInterface; + return array_replace_recursive(require __DIR__.'/sr.php', [ 'month' => ':count mjesec|:count mjeseca|:count mjeseci', 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', @@ -27,7 +30,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [ 'diff_tomorrow' => 'sjutra', 'calendar' => [ 'nextDay' => '[sjutra u] LT', - 'nextWeek' => function (\Carbon\CarbonInterface $date) { + 'nextWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[u nedjelju u] LT'; @@ -39,7 +42,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [ return '[u] dddd [u] LT'; } }, - 'lastWeek' => function (\Carbon\CarbonInterface $date) { + 'lastWeek' => function (CarbonInterface $date) { switch ($date->dayOfWeek) { case 0: return '[prošle nedjelje u] LT'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php index ba7cc097..d0b9d10b 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [ 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php index b668ee1b..d7c65b91 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr_Latn_ME.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php index 8ae8c41a..99716747 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php index 48d970ae..ba89527c 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/ss.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php index 56425b4e..70cc5585 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sv.php', [ 'formats' => [ 'L' => 'YYYY-MM-dd', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php index 1b73ecb2..d7182c83 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sv.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php index 1b73ecb2..d7182c83 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/sv.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php index f6927f47..ec9117b5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php index f6927f47..ec9117b5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/sw.php', [ 'formats' => [ 'L' => 'DD/MM/YYYY', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php index 4b0b5410..9adddcf8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php @@ -33,9 +33,9 @@ return array_replace_recursive(require __DIR__.'/en.php', [ 'm' => ':count mjeśůnc', 'a_month' => ':count mjeśůnc', - 'week' => ':count Tydźyń', - 'w' => ':count Tydźyń', - 'a_week' => ':count Tydźyń', + 'week' => ':count tydźyń', + 'w' => ':count tydźyń', + 'a_week' => ':count tydźyń', 'day' => ':count dźyń', 'd' => ':count dźyń', @@ -45,11 +45,11 @@ return array_replace_recursive(require __DIR__.'/en.php', [ 'h' => ':count godzina', 'a_hour' => ':count godzina', - 'minute' => ':count Minuta', - 'min' => ':count Minuta', - 'a_minute' => ':count Minuta', + 'minute' => ':count minuta', + 'min' => ':count minuta', + 'a_minute' => ':count minuta', - 'second' => ':count Sekůnda', - 's' => ':count Sekůnda', - 'a_second' => ':count Sekůnda', + 'second' => ':count sekůnda', + 's' => ':count sekůnda', + 'a_second' => ':count sekůnda', ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php index 291d6c81..a6cd8b51 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php index fe1cc062..7dbedeee 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'formats' => [ 'LT' => 'a h:mm', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php index 6f81c405..3963f8d5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/te.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo.php index 950235ea..ca30c37d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ta.php', [ 'meridiem' => ['Taparachu', 'Ebongi'], 'weekdays' => ['Nakaejuma', 'Nakaebarasa', 'Nakaare', 'Nakauni', 'Nakaung’on', 'Nakakany', 'Nakasabiti'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php index 024d2729..010a04f5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/teo.php', [ 'first_day_of_week' => 0, ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php index c6591e34..badc7d1f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/tg.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php index f11dc1b6..b9f94b2d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/th.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php index 1937fec9..23f11449 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/tr.php', [ 'weekdays_short' => ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'], 'weekdays_min' => ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php index dc8e9358..9e994824 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/tr.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/twq.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/twq.php index e8ff278c..5cbb46e0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/twq.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/twq.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/ses.php', [ 'meridiem' => ['Subbaahi', 'Zaarikay b'], ]); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php index ab2d8678..b267b000 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php @@ -8,7 +8,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -$processHoursFunction = function (\Carbon\CarbonInterface $date, string $format) { + +use Carbon\CarbonInterface; + +$processHoursFunction = function (CarbonInterface $date, string $format) { return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT'; }; @@ -127,19 +130,19 @@ return [ 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', ], 'calendar' => [ - 'sameDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'sameDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Сьогодні '); }, - 'nextDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'nextDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Завтра '); }, - 'nextWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'nextWeek' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[У] dddd ['); }, - 'lastDay' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'lastDay' => function (CarbonInterface $date) use ($processHoursFunction) { return $processHoursFunction($date, '[Вчора '); }, - 'lastWeek' => function (\Carbon\CarbonInterface $date) use ($processHoursFunction) { + 'lastWeek' => function (CarbonInterface $date) use ($processHoursFunction) { switch ($date->dayOfWeek) { case 0: case 3: @@ -183,17 +186,17 @@ return [ 'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'], 'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'], 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', - 'weekdays' => function (\Carbon\CarbonInterface $date, $format, $index) { + 'weekdays' => function (CarbonInterface $date, $format, $index) { static $words = [ 'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'], 'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'], 'genitive' => ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'], ]; - $nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/', $format) + $nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/u', $format) ? 'accusative' : ( - preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/', $format) + preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/u', $format) ? 'genitive' : 'nominative' ); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php index 5fc43171..bd11d86e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/uk.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ur.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ur.php index e55aff28..dc16c2c3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ur.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ur.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + $months = [ 'جنوری', 'فروری', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php index 68719114..ffb51319 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/fa.php', [ 'weekdays' => ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], 'weekdays_short' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php index e8754699..89e99718 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/uz.php', [ 'formats' => [ 'L' => 'DD/MM/yy', diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai.php index 3e6fce2b..3c378dfb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], 'weekdays_short' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php index b76c4bcf..51e83cc5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], 'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php index 7b029a8a..b4bb533f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/vai.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php index 77b2dce5..18d89876 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/vi.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vo.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vo.php index a956a783..e273033f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vo.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vo.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vun.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vun.php index f8cc72c1..ed92e8e7 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vun.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/vun.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['utuko', 'kyiukonyi'], 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/xog.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/xog.php index 063977c0..eb55b4ab 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/xog.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/xog.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['Munkyo', 'Eigulo'], 'weekdays' => ['Sabiiti', 'Balaza', 'Owokubili', 'Owokusatu', 'Olokuna', 'Olokutaanu', 'Olomukaaga'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yav.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yav.php index e44cde62..225a20d8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yav.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yav.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/en.php', [ 'meridiem' => ['kiɛmɛ́ɛm', 'kisɛ́ndɛ'], 'weekdays' => ['sɔ́ndiɛ', 'móndie', 'muányáŋmóndie', 'metúkpíápɛ', 'kúpélimetúkpiapɛ', 'feléte', 'séselé'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php index f06bb99f..12b9e815 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return array_replace_recursive(require __DIR__.'/yo.php', [ 'meridiem' => ['Àárɔ̀', 'Ɔ̀sán'], 'weekdays' => ['Ɔjɔ́ Àìkú', 'Ɔjɔ́ Ajé', 'Ɔjɔ́ Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɔjɔ́ Ɛtì', 'Ɔjɔ́ Àbámɛ́ta'], diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php index 92934bcb..6860bc1a 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/yo.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php index 007d0716..db913caa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php index 24797f96..e2526f13 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php index 007d0716..db913caa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php index 007d0716..db913caa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php index 007d0716..db913caa 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hans.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php index 24797f96..e2526f13 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php index 24797f96..e2526f13 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php index 24797f96..e2526f13 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php @@ -8,4 +8,5 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + return require __DIR__.'/zh_Hant.php'; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Language.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Language.php index 37902854..1fb5bafd 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Language.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Language.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; use JsonSerializable; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php index d71c888b..8be0569e 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php @@ -1,5 +1,14 @@ <?php +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Laravel; use Carbon\Carbon; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php new file mode 100644 index 00000000..fc6fd2a7 --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php @@ -0,0 +1,222 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +use Closure; +use PHPStan\Reflection\Php\BuiltinMethodReflection; +use PHPStan\TrinaryLogic; +use ReflectionClass; +use ReflectionFunction; +use ReflectionMethod; +use ReflectionParameter; +use ReflectionType; +use stdClass; +use Throwable; + +abstract class AbstractMacro implements BuiltinMethodReflection +{ + /** + * The reflection function/method. + * + * @var ReflectionFunction|ReflectionMethod + */ + protected $reflectionFunction; + + /** + * The class name. + * + * @var class-string + */ + private $className; + + /** + * The method name. + * + * @var string + */ + private $methodName; + + /** + * The parameters. + * + * @var ReflectionParameter[] + */ + private $parameters; + + /** + * The is static. + * + * @var bool + */ + private $static = false; + + /** + * Macro constructor. + * + * @param string $className + * @phpstan-param class-string $className + * + * @param string $methodName + * @param callable $macro + */ + public function __construct(string $className, string $methodName, $macro) + { + $this->className = $className; + $this->methodName = $methodName; + $this->reflectionFunction = \is_array($macro) + ? new ReflectionMethod($macro[0], $macro[1]) + : new ReflectionFunction($macro); + $this->parameters = $this->reflectionFunction->getParameters(); + + if ($this->reflectionFunction->isClosure()) { + try { + $closure = $this->reflectionFunction->getClosure(); + $boundClosure = Closure::bind($closure, new stdClass()); + $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); + } catch (Throwable $e) { + $this->static = true; + } + } + } + + /** + * {@inheritdoc} + */ + public function getDeclaringClass(): ReflectionClass + { + return new ReflectionClass($this->className); + } + + /** + * {@inheritdoc} + */ + public function isPrivate(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isPublic(): bool + { + return true; + } + + /** + * {@inheritdoc} + */ + public function isFinal(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isInternal(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isAbstract(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isStatic(): bool + { + return $this->static; + } + + /** + * {@inheritdoc} + */ + public function getDocComment(): ?string + { + return $this->reflectionFunction->getDocComment() ?: null; + } + + /** + * {@inheritdoc} + */ + public function getName(): string + { + return $this->methodName; + } + + /** + * {@inheritdoc} + */ + public function getParameters(): array + { + return $this->parameters; + } + + /** + * {@inheritdoc} + */ + public function getReturnType(): ?ReflectionType + { + return $this->reflectionFunction->getReturnType(); + } + + /** + * {@inheritdoc} + */ + public function isDeprecated(): TrinaryLogic + { + return TrinaryLogic::createFromBoolean( + $this->reflectionFunction->isDeprecated() || + preg_match('/@deprecated/i', $this->getDocComment() ?: '') + ); + } + + /** + * {@inheritdoc} + */ + public function isVariadic(): bool + { + return $this->reflectionFunction->isVariadic(); + } + + /** + * {@inheritdoc} + */ + public function getPrototype(): BuiltinMethodReflection + { + return $this; + } + + /** + * {@inheritdoc} + */ + public function getReflection(): ?ReflectionMethod + { + return $this->reflectionFunction instanceof ReflectionMethod + ? $this->reflectionFunction + : null; + } + + public function getTentativeReturnType(): ?ReflectionType + { + return null; + } +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php index 7dab190c..83925873 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php @@ -2,232 +2,26 @@ declare(strict_types=1); +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; -use Closure; use PHPStan\Reflection\Php\BuiltinMethodReflection; -use PHPStan\TrinaryLogic; -use ReflectionClass; -use ReflectionFunction; use ReflectionMethod; -use ReflectionParameter; -use ReflectionType; -use stdClass; -use Throwable; -final class Macro implements BuiltinMethodReflection +$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getFileName'); + +require $method->hasReturnType() + ? __DIR__.'/../../../lazy/Carbon/PHPStan/MacroStrongType.php' + : __DIR__.'/../../../lazy/Carbon/PHPStan/MacroWeakType.php'; + +final class Macro extends LazyMacro { - /** - * The class name. - * - * @var class-string - */ - private $className; - - /** - * The method name. - * - * @var string - */ - private $methodName; - - /** - * The reflection function/method. - * - * @var ReflectionFunction|ReflectionMethod - */ - private $reflectionFunction; - - /** - * The parameters. - * - * @var ReflectionParameter[] - */ - private $parameters; - - /** - * The is static. - * - * @var bool - */ - private $static = false; - - /** - * Macro constructor. - * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName - * @param callable $macro - */ - public function __construct(string $className, string $methodName, $macro) - { - $this->className = $className; - $this->methodName = $methodName; - $this->reflectionFunction = \is_array($macro) - ? new ReflectionMethod($macro[0], $macro[1]) - : new ReflectionFunction($macro); - $this->parameters = $this->reflectionFunction->getParameters(); - - if ($this->reflectionFunction->isClosure()) { - try { - /** @var Closure $closure */ - $closure = $this->reflectionFunction->getClosure(); - $boundClosure = Closure::bind($closure, new stdClass); - $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); - } catch (Throwable $e) { - $this->static = true; - } - } - } - - /** - * {@inheritdoc} - */ - public function getDeclaringClass(): ReflectionClass - { - return new ReflectionClass($this->className); - } - - /** - * {@inheritdoc} - */ - public function isPrivate(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isPublic(): bool - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isFinal(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isInternal(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isAbstract(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isStatic(): bool - { - return $this->static; - } - - /** - * {@inheritdoc} - */ - public function getDocComment(): ?string - { - return $this->reflectionFunction->getDocComment() ?: null; - } - - /** - * {@inheritdoc} - */ - public function getFileName() - { - return $this->reflectionFunction->getFileName(); - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return $this->methodName; - } - - /** - * {@inheritdoc} - */ - public function getParameters(): array - { - return $this->parameters; - } - - /** - * {@inheritdoc} - */ - public function getReturnType(): ?ReflectionType - { - return $this->reflectionFunction->getReturnType(); - } - - /** - * {@inheritdoc} - */ - public function getStartLine() - { - return $this->reflectionFunction->getStartLine(); - } - - /** - * {@inheritdoc} - */ - public function getEndLine() - { - return $this->reflectionFunction->getEndLine(); - } - - /** - * {@inheritdoc} - */ - public function isDeprecated(): TrinaryLogic - { - return TrinaryLogic::createFromBoolean( - $this->reflectionFunction->isDeprecated() || - preg_match('/@deprecated/i', $this->getDocComment() ?: '') - ); - } - - /** - * {@inheritdoc} - */ - public function isVariadic(): bool - { - return $this->reflectionFunction->isVariadic(); - } - - /** - * {@inheritdoc} - */ - public function getPrototype(): BuiltinMethodReflection - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function getReflection(): ?ReflectionMethod - { - return $this->reflectionFunction instanceof ReflectionMethod - ? $this->reflectionFunction - : null; - } } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php index 5a3d6941..8e2524c0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php @@ -1,5 +1,14 @@ <?php +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; use PHPStan\Reflection\ClassReflection; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php index 97cf0b8e..d169939d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php @@ -1,5 +1,14 @@ <?php +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\PHPStan; use Carbon\CarbonInterface; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php index 7fbb1a3f..71bbb723 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Exceptions\UnknownUnitException; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php index 44caf0b3..5f7c7c01 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php @@ -1,5 +1,14 @@ <?php +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Carbon\Traits; use Carbon\Exceptions\InvalidCastException; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php index ee00666c..a23e6ed0 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use BadMethodCallException; @@ -74,7 +75,7 @@ trait Comparison */ public function equalTo($date): bool { - return $this == $date; + return $this == $this->resolveCarbon($date); } /** @@ -154,7 +155,7 @@ trait Comparison */ public function greaterThan($date): bool { - return $this > $date; + return $this > $this->resolveCarbon($date); } /** @@ -255,7 +256,7 @@ trait Comparison */ public function lessThan($date): bool { - return $this < $date; + return $this < $this->resolveCarbon($date); } /** diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php index 7ba62256..8fe008a5 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php index fa7cfc7b..f2adee5f 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; @@ -94,7 +95,7 @@ trait Creator setlocale(LC_NUMERIC, $locale); } - static::setLastErrors(parent::getLastErrors()); + self::setLastErrors(parent::getLastErrors()); } /** @@ -338,7 +339,7 @@ trait Creator return $now(static::now($tz)); } - return $now; + return $now->avoidMutation()->tz($tz); } /** @@ -367,7 +368,7 @@ trait Creator */ public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null) { - if (\is_string($year) && !is_numeric($year)) { + if (\is_string($year) && !is_numeric($year) || $year instanceof DateTimeInterface) { return static::parse($year, $tz ?: (\is_string($month) || $month instanceof DateTimeZone ? $month : null)); } @@ -389,12 +390,12 @@ trait Creator return $defaults[$unit]; }; - $year = $year === null ? $getDefault('year') : $year; - $month = $month === null ? $getDefault('month') : $month; - $day = $day === null ? $getDefault('day') : $day; - $hour = $hour === null ? $getDefault('hour') : $hour; - $minute = $minute === null ? $getDefault('minute') : $minute; - $second = (float) ($second === null ? $getDefault('second') : $second); + $year = $year ?? $getDefault('year'); + $month = $month ?? $getDefault('month'); + $day = $day ?? $getDefault('day'); + $hour = $hour ?? $getDefault('hour'); + $minute = $minute ?? $getDefault('minute'); + $second = (float) ($second ?? $getDefault('second')); self::assertBetween('month', $month, 0, 99); self::assertBetween('day', $day, 0, 99); @@ -931,6 +932,8 @@ trait Creator /** * {@inheritdoc} + * + * @return array */ #[ReturnTypeWillChange] public static function getLastErrors() diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php index 07ac0dde..8c8af6fb 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use BadMethodCallException; @@ -38,6 +39,8 @@ use Throwable; /** * A simple API extension for DateTime. * + * @mixin DeprecatedProperties + * * <autodoc generated by `composer phpdoc`> * * @property int $year @@ -54,10 +57,6 @@ use Throwable; * @property string $shortEnglishDayOfWeek the abbreviated day of week in English * @property string $englishMonth the month in English * @property string $shortEnglishMonth the abbreviated month in English - * @property string $localeDayOfWeek the day of week in current locale LC_TIME - * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property string $localeMonth the month in current locale LC_TIME - * @property string $shortLocaleMonth the abbreviated month in current locale LC_TIME * @property int $milliseconds * @property int $millisecond * @property int $milli @@ -874,12 +873,28 @@ trait Date // @property string the abbreviated month in English 'shortEnglishMonth' => 'M', // @property string the day of week in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('MMM') instead. + // since: 2.55.0 'localeDayOfWeek' => '%A', // @property string the abbreviated day of week in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('dddd') instead. + // since: 2.55.0 'shortLocaleDayOfWeek' => '%a', // @property string the month in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('ddd') instead. + // since: 2.55.0 'localeMonth' => '%B', // @property string the abbreviated month in current locale LC_TIME + // @deprecated + // reason: It uses OS language package and strftime() which is deprecated since PHP 8.1. + // replacement: Use ->isoFormat('MMMM') instead. + // since: 2.55.0 'shortLocaleMonth' => '%b', // @property-read string $timezoneAbbreviatedName the current timezone abbreviated name 'timezoneAbbreviatedName' => 'T', @@ -1572,7 +1587,13 @@ trait Date #[ReturnTypeWillChange] public function setTimezone($value) { - return parent::setTimezone(static::safeCreateDateTimeZone($value)); + $tz = static::safeCreateDateTimeZone($value); + + if ($tz === false && !self::isStrictModeEnabled()) { + $tz = new CarbonTimeZone(); + } + + return parent::setTimezone($tz); } /** @@ -1584,10 +1605,11 @@ trait Date */ public function shiftTimezone($value) { - $offset = $this->offset; - $date = $this->setTimezone($value); + $dateTimeString = $this->format('Y-m-d H:i:s.u'); - return $date->addRealMicroseconds(($offset - $date->offset) * static::MICROSECONDS_PER_SECOND); + return $this + ->setTimezone($value) + ->modify($dateTimeString); } /** @@ -1672,7 +1694,7 @@ trait Date public static function getWeekStartsAt() { if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return static::getFirstDayOfWeek(); + return self::getFirstDayOfWeek(); } return static::$weekStartsAt; @@ -1703,7 +1725,7 @@ trait Date public static function getWeekEndsAt() { if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return (int) (static::DAYS_PER_WEEK - 1 + static::getFirstDayOfWeek()) % static::DAYS_PER_WEEK; + return (int) (static::DAYS_PER_WEEK - 1 + self::getFirstDayOfWeek()) % static::DAYS_PER_WEEK; } return static::$weekEndsAt; @@ -1811,6 +1833,10 @@ trait Date * Format the instance with the current locale. You can set the current * locale using setlocale() https://php.net/setlocale. * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat() instead. + * Deprecated since 2.55.0 + * * @param string $format * * @return string diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php new file mode 100644 index 00000000..5acc6f5c --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedProperties.php @@ -0,0 +1,61 @@ +<?php + +declare(strict_types=1); + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +trait DeprecatedProperties +{ + /** + * the day of week in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('MMM') instead. + * Deprecated since 2.55.0 + */ + public $localeDayOfWeek; + + /** + * the abbreviated day of week in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('dddd') instead. + * Deprecated since 2.55.0 + */ + public $shortLocaleDayOfWeek; + + /** + * the month in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('ddd') instead. + * Deprecated since 2.55.0 + */ + public $localeMonth; + + /** + * the abbreviated month in current locale LC_TIME + * + * @var string + * + * @deprecated It uses OS language package and strftime() which is deprecated since PHP 8.1. + * Use ->isoFormat('MMMM') instead. + * Deprecated since 2.55.0 + */ + public $shortLocaleMonth; +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php index b1cdd6e3..cce1d2c3 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; @@ -111,7 +112,8 @@ trait Difference /** * Get the difference as a DateInterval instance. - * Return relative interval (negative if + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference @@ -123,8 +125,10 @@ trait Difference { $other = $this->resolveCarbon($date); - // Can be removed if https://github.com/derickr/timelib/pull/110 - // is merged + // Work-around for https://bugs.php.net/bug.php?id=81458 + // It was initially introduced for https://bugs.php.net/bug.php?id=80998 + // The very specific case of 80998 was fixed in PHP 8.1beta3, but it introduced 81458 + // So we still need to keep this for now // @codeCoverageIgnoreStart if (version_compare(PHP_VERSION, '8.1.0-dev', '>=') && $other->tz !== $this->tz) { $other = $other->avoidMutation()->tz($this->tz); @@ -136,7 +140,8 @@ trait Difference /** * Get the difference as a CarbonInterval instance. - * Return absolute interval (always positive) unless you pass false to the second argument. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). * * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date * @param bool $absolute Get the absolute of the difference @@ -212,7 +217,7 @@ trait Difference */ public function diffInDays($date = null, $absolute = true) { - return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%a'); + return $this->getIntervalDayDiff($this->diff($this->resolveCarbon($date), $absolute)); } /** @@ -513,7 +518,7 @@ trait Difference return $hoursDiff / static::HOURS_PER_DAY; } - $daysDiff = (int) $interval->format('%r%a'); + $daysDiff = $this->getIntervalDayDiff($interval); return $daysDiff + fmod($hoursDiff, static::HOURS_PER_DAY) / static::HOURS_PER_DAY; } @@ -781,6 +786,10 @@ trait Difference * - 'short' entry (see below) * - 'parts' entry (see below) * - 'options' entry (see below) + * - 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). + * - 'aUnit' entry, prefer "an hour" over "1 hour" if true * - 'join' entry determines how to join multiple parts of the string * ` - if $join is a string, it's used as a joiner glue * ` - if $join is a callable/closure, it get the list of string and should return a string @@ -789,6 +798,8 @@ trait Difference * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) * ` - if $join is missing, a space will be used as glue * - 'other' entry (see above) + * - 'minimumUnit' entry determines the smallest unit of time to display can be long or + * ` short form of the units, e.g. 'hour' or 'h' (default value: s) * if int passed, it add modifiers: * Possible values: * - CarbonInterface::DIFF_ABSOLUTE no modifiers @@ -815,7 +826,7 @@ trait Difference $syntax['syntax'] = $syntax['syntax'] ?? null; $intSyntax = &$syntax['syntax']; } - $intSyntax = (int) ($intSyntax === null ? static::DIFF_RELATIVE_AUTO : $intSyntax); + $intSyntax = (int) ($intSyntax ?? static::DIFF_RELATIVE_AUTO); $intSyntax = $intSyntax === static::DIFF_RELATIVE_AUTO && $other === null ? static::DIFF_RELATIVE_TO_NOW : $intSyntax; $parts = min(7, max(1, (int) $parts)); @@ -1138,4 +1149,21 @@ trait Difference return $this->isoFormat((string) $format); } + + private function getIntervalDayDiff(DateInterval $interval): int + { + $daysDiff = (int) $interval->format('%a'); + $sign = $interval->format('%r') === '-' ? -1 : 1; + + if (\is_int($interval->days) && + $interval->y === 0 && + $interval->m === 0 && + version_compare(PHP_VERSION, '8.1.0-dev', '<') && + abs($interval->d - $daysDiff) === 1 + ) { + $daysDiff = abs($interval->d); + } + + return $daysDiff * $sign; + } } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php index 6f6c9d1d..4cd66b67 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterval; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php index 4882eef6..82d7c326 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php index 9162dc94..ddd2b4e9 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; @@ -15,6 +16,7 @@ use Carbon\Exceptions\InvalidTypeException; use Carbon\Exceptions\NotLocaleAwareException; use Carbon\Language; use Carbon\Translator; +use Carbon\TranslatorStrongTypeInterface; use Closure; use Symfony\Component\Translation\TranslatorBagInterface; use Symfony\Component\Translation\TranslatorInterface; @@ -181,7 +183,7 @@ trait Localization $locale = $translator->getLocale(); } - $result = $translator->getCatalogue($locale)->get($key); + $result = self::getFromCatalogue($translator, $translator->getCatalogue($locale), $key); return $result === $key ? $default : $result; } @@ -237,10 +239,11 @@ trait Localization /** * Translate using translation string or callback available. * - * @param string $key - * @param array $parameters - * @param string|int|float|null $number - * @param \Symfony\Component\Translation\TranslatorInterface $translator + * @param string $key + * @param array $parameters + * @param string|int|float|null $number + * @param \Symfony\Component\Translation\TranslatorInterface|null $translator + * @param bool $altNumbers * * @return string */ @@ -582,7 +585,9 @@ trait Localization } foreach (['ago', 'from_now', 'before', 'after'] as $key) { - if ($translator instanceof TranslatorBagInterface && $translator->getCatalogue($newLocale)->get($key) instanceof Closure) { + if ($translator instanceof TranslatorBagInterface && + self::getFromCatalogue($translator, $translator->getCatalogue($newLocale), $key) instanceof Closure + ) { continue; } @@ -735,6 +740,19 @@ trait Localization return $translator; } + /** + * @param mixed $translator + * @param \Symfony\Component\Translation\MessageCatalogueInterface $catalogue + * + * @return mixed + */ + private static function getFromCatalogue($translator, $catalogue, string $id, string $domain = 'messages') + { + return $translator instanceof TranslatorStrongTypeInterface + ? $translator->getFromCatalogue($catalogue, $id, $domain) // @codeCoverageIgnore + : $catalogue->get($id, $domain); + } + /** * Return the word cleaned from its translation codes. * @@ -774,7 +792,7 @@ trait Localization $parts = explode('|', $message); return $key === 'to' - ? static::cleanWordFromTranslationString(end($parts)) + ? self::cleanWordFromTranslationString(end($parts)) : '(?:'.implode('|', array_map([static::class, 'cleanWordFromTranslationString'], $parts)).')'; }, $keys); } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php index d4135264..92b6c9d8 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php index b9c868df..88b251df 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Closure; @@ -65,8 +66,8 @@ trait Mixin public static function mixin($mixin) { \is_string($mixin) && trait_exists($mixin) - ? static::loadMixinTrait($mixin) - : static::loadMixinClass($mixin); + ? self::loadMixinTrait($mixin) + : self::loadMixinClass($mixin); } /** @@ -114,7 +115,7 @@ trait Mixin } // in case of errors not converted into exceptions - $closure = $closure ?? $closureBase; + $closure = $closure ?: $closureBase; return $closure(...\func_get_args()); }); diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php index 2fd64264..164dbbd1 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; @@ -429,6 +430,8 @@ trait Modifiers * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. * * @see https://php.net/manual/en/datetime.modify.php + * + * @return static|false */ #[ReturnTypeWillChange] public function modify($modify) diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php index 66eaa124..561c867d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Carbon; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php index 252df3a5..c77a1024 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; trait ObjectInitialisation diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php index 0a49372c..0ddee8dd 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; @@ -385,6 +386,10 @@ trait Options $this->locale(...$locales); } + if (isset($settings['innerTimezone'])) { + return $this->setTimezone($settings['innerTimezone']); + } + if (isset($settings['timezone'])) { return $this->shiftTimezone($settings['timezone']); } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php index 03d3fe69..33062397 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonInterface; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php index a27e4e35..eebc69bd 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\Exceptions\InvalidFormatException; @@ -135,6 +136,8 @@ trait Serialization /** * Set locale if specified on unserialize() called. + * + * @return void */ #[ReturnTypeWillChange] public function __wakeup() diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php index d9989749..c86faa74 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php @@ -8,10 +8,16 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; +use Carbon\CarbonInterface; +use Carbon\CarbonTimeZone; use Closure; use DateTimeImmutable; +use DateTimeInterface; +use InvalidArgumentException; +use Throwable; trait Test { @@ -26,6 +32,13 @@ trait Test */ protected static $testNow; + /** + * The timezone to resto to when clearing the time mock. + * + * @var string|null + */ + protected static $testDefaultTimezone; + /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned @@ -38,6 +51,9 @@ trait Test * Note the timezone parameter was left out of the examples above and * has no affect as the mock value will be returned regardless of its value. * + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * * To clear the test instance call this method using the default * parameter of null. * @@ -54,6 +70,50 @@ trait Test static::$testNow = \is_string($testNow) ? static::parse($testNow) : $testNow; } + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNowAndTimezone($testNow = null, $tz = null) + { + if ($testNow) { + self::$testDefaultTimezone = self::$testDefaultTimezone ?? date_default_timezone_get(); + } + + $useDateInstanceTimezone = $testNow instanceof DateTimeInterface; + + if ($useDateInstanceTimezone) { + self::setDefaultTimezone($testNow->getTimezone()->getName(), $testNow); + } + + static::setTestNow($testNow); + + if (!$useDateInstanceTimezone) { + $now = static::getMockedTestNow(\func_num_args() === 1 ? null : $tz); + $tzName = $now ? $now->tzName : null; + self::setDefaultTimezone($tzName ?? self::$testDefaultTimezone ?? 'UTC', $now); + } + + if (!$testNow) { + self::$testDefaultTimezone = null; + } + } + /** * Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then @@ -61,8 +121,8 @@ trait Test * * /!\ Use this method for unit tests only. * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure|null $callback * * @return mixed */ @@ -97,27 +157,6 @@ trait Test return static::getTestNow() !== null; } - /** - * Return the given timezone and set it to the test instance if not null. - * If null, get the timezone from the test instance and return it. - * - * @param string|\DateTimeZone $tz - * @param \Carbon\CarbonInterface $testInstance - * - * @return string|\DateTimeZone - */ - protected static function handleMockTimezone($tz, &$testInstance) - { - //shift the time according to the given time zone - if ($tz !== null && $tz !== static::getMockedTestNow($tz)->getTimezone()) { - $testInstance = $testInstance->setTimezone($tz); - - return $tz; - } - - return $testInstance->getTimezone(); - } - /** * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. * @@ -138,20 +177,48 @@ trait Test } /* @var \Carbon\CarbonImmutable|\Carbon\Carbon|null $testNow */ - return $testNow; + return $testNow instanceof CarbonInterface + ? $testNow->avoidMutation()->tz($tz) + : $testNow; } - protected static function mockConstructorParameters(&$time, &$tz) + protected static function mockConstructorParameters(&$time, $tz) { /** @var \Carbon\CarbonImmutable|\Carbon\Carbon $testInstance */ $testInstance = clone static::getMockedTestNow($tz); - $tz = static::handleMockTimezone($tz, $testInstance); - if (static::hasRelativeKeywords($time)) { $testInstance = $testInstance->modify($time); } - $time = $testInstance instanceof self ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) : $testInstance->format(static::MOCK_DATETIME_FORMAT); + $time = $testInstance instanceof self + ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) + : $testInstance->format(static::MOCK_DATETIME_FORMAT); + } + + private static function setDefaultTimezone($timezone, DateTimeInterface $date = null) + { + $previous = null; + $success = false; + + try { + $success = date_default_timezone_set($timezone); + } catch (Throwable $exception) { + $previous = $exception; + } + + if (!$success) { + $suggestion = @CarbonTimeZone::create($timezone)->toRegionName($date); + + throw new InvalidArgumentException( + "Timezone ID '$timezone' is invalid". + ($suggestion && $suggestion !== $timezone ? ", did you mean '$suggestion'?" : '.')."\n". + "It must be one of the IDs from DateTimeZone::listIdentifiers(),\n". + 'For the record, hours/minutes offset are relevant only for a particular moment, '. + 'but not as a default timezone.', + 0, + $previous + ); + } } } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php index 35d45aa5..2cb5c48d 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php index aec85ab2..2902a8b1 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; use Carbon\CarbonConverterInterface; @@ -201,21 +202,6 @@ trait Units $unit = CarbonInterval::make($unit); } - // Can be removed if https://bugs.php.net/bug.php?id=81106 - // is fixed - // @codeCoverageIgnoreStart - if ( - $unit instanceof DateInterval && - version_compare(PHP_VERSION, '8.1.0-dev', '>=') && - ($unit->f < 0 || $unit->f >= 1) - ) { - $unit = clone $unit; - $seconds = floor($unit->f); - $unit->f -= $seconds; - $unit->s += (int) $seconds; - } - // @codeCoverageIgnoreEnd - if ($unit instanceof CarbonConverterInterface) { return $this->resolveCarbon($unit->convertDate($this, false)); } @@ -252,6 +238,7 @@ trait Units return $date->isMutable() ? $date : $date->avoidMutation(); } + $unit = self::singularUnit($unit); $metaUnits = [ 'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'], 'century' => [static::YEARS_PER_CENTURY, 'year'], @@ -320,11 +307,13 @@ trait Units $date = $date->modify("$value $unit"); if (isset($timeString)) { - return $date->setTimeFromTimeString($timeString); + $date = $date->setTimeFromTimeString($timeString); + } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { + $date = $date->modify('last day of previous month'); } - if (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { - $date = $date->modify('last day of previous month'); + if (!$date) { + throw new UnitException('Unable to add unit '.var_export(\func_get_args(), true)); } return $date; diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Week.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Week.php index 64cece7a..6f148145 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Week.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Week.php @@ -8,6 +8,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon\Traits; /** diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Translator.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Translator.php index 9af48ebe..491c9e72 100644 --- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Translator.php +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Translator.php @@ -8,396 +8,25 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + namespace Carbon; -use Closure; -use ReflectionException; -use ReflectionFunction; +use ReflectionMethod; use Symfony\Component\Translation; +use Symfony\Contracts\Translation\TranslatorInterface; -class Translator extends Translation\Translator +$transMethod = new ReflectionMethod( + class_exists(TranslatorInterface::class) + ? TranslatorInterface::class + : Translation\Translator::class, + 'trans' +); + +require $transMethod->hasReturnType() + ? __DIR__.'/../../lazy/Carbon/TranslatorStrongType.php' + : __DIR__.'/../../lazy/Carbon/TranslatorWeakType.php'; + +class Translator extends LazyTranslator { - /** - * Translator singletons for each language. - * - * @var array - */ - protected static $singletons = []; - - /** - * List of custom localized messages. - * - * @var array - */ - protected $messages = []; - - /** - * List of custom directories that contain translation files. - * - * @var string[] - */ - protected $directories = []; - - /** - * Set to true while constructing. - * - * @var bool - */ - protected $initializing = false; - - /** - * List of locales aliases. - * - * @var string[] - */ - protected $aliases = [ - 'me' => 'sr_Latn_ME', - 'scr' => 'sh', - ]; - - /** - * Return a singleton instance of Translator. - * - * @param string|null $locale optional initial locale ("en" - english by default) - * - * @return static - */ - public static function get($locale = null) - { - $locale = $locale ?: 'en'; - - if (!isset(static::$singletons[$locale])) { - static::$singletons[$locale] = new static($locale ?: 'en'); - } - - return static::$singletons[$locale]; - } - - public function __construct($locale, Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) - { - $this->initializing = true; - $this->directories = [__DIR__.'/Lang']; - $this->addLoader('array', new Translation\Loader\ArrayLoader()); - parent::__construct($locale, $formatter, $cacheDir, $debug); - $this->initializing = false; - } - - /** - * Returns the list of directories translation files are searched in. - * - * @return array - */ - public function getDirectories(): array - { - return $this->directories; - } - - /** - * Set list of directories translation files are searched in. - * - * @param array $directories new directories list - * - * @return $this - */ - public function setDirectories(array $directories) - { - $this->directories = $directories; - - return $this; - } - - /** - * Add a directory to the list translation files are searched in. - * - * @param string $directory new directory - * - * @return $this - */ - public function addDirectory(string $directory) - { - $this->directories[] = $directory; - - return $this; - } - - /** - * Remove a directory from the list translation files are searched in. - * - * @param string $directory directory path - * - * @return $this - */ - public function removeDirectory(string $directory) - { - $search = rtrim(strtr($directory, '\\', '/'), '/'); - - return $this->setDirectories(array_filter($this->getDirectories(), function ($item) use ($search) { - return rtrim(strtr($item, '\\', '/'), '/') !== $search; - })); - } - - /** - * Returns the translation. - * - * @param string $id - * @param array $parameters - * @param string $domain - * @param string $locale - * - * @return string - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null) - { - if ($domain === null) { - $domain = 'messages'; - } - - $format = $this->getCatalogue($locale)->get((string) $id, $domain); - - if ($format instanceof Closure) { - // @codeCoverageIgnoreStart - try { - $count = (new ReflectionFunction($format))->getNumberOfRequiredParameters(); - } catch (ReflectionException $exception) { - $count = 0; - } - // @codeCoverageIgnoreEnd - - return $format( - ...array_values($parameters), - ...array_fill(0, max(0, $count - \count($parameters)), null) - ); - } - - return parent::trans($id, $parameters, $domain, $locale); - } - - /** - * Reset messages of a locale (all locale if no locale passed). - * Remove custom messages and reload initial messages from matching - * file in Lang directory. - * - * @param string|null $locale - * - * @return bool - */ - public function resetMessages($locale = null) - { - if ($locale === null) { - $this->messages = []; - - return true; - } - - foreach ($this->getDirectories() as $directory) { - $data = @include sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale); - - if ($data !== false) { - $this->messages[$locale] = $data; - $this->addResource('array', $this->messages[$locale], $locale); - - return true; - } - } - - return false; - } - - /** - * Returns the list of files matching a given locale prefix (or all if empty). - * - * @param string $prefix prefix required to filter result - * - * @return array - */ - public function getLocalesFiles($prefix = '') - { - $files = []; - - foreach ($this->getDirectories() as $directory) { - $directory = rtrim($directory, '\\/'); - - foreach (glob("$directory/$prefix*.php") as $file) { - $files[] = $file; - } - } - - return array_unique($files); - } - - /** - * Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * - * @param string $prefix prefix required to filter result - * - * @return array - */ - public function getAvailableLocales($prefix = '') - { - $locales = []; - foreach ($this->getLocalesFiles($prefix) as $file) { - $locales[] = substr($file, strrpos($file, '/') + 1, -4); - } - - return array_unique(array_merge($locales, array_keys($this->messages))); - } - - /** - * Init messages language from matching file in Lang directory. - * - * @param string $locale - * - * @return bool - */ - protected function loadMessagesFromFile($locale) - { - if (isset($this->messages[$locale])) { - return true; - } - - return $this->resetMessages($locale); - } - - /** - * Set messages of a locale and take file first if present. - * - * @param string $locale - * @param array $messages - * - * @return $this - */ - public function setMessages($locale, $messages) - { - $this->loadMessagesFromFile($locale); - $this->addResource('array', $messages, $locale); - $this->messages[$locale] = array_merge( - isset($this->messages[$locale]) ? $this->messages[$locale] : [], - $messages - ); - - return $this; - } - - /** - * Set messages of the current locale and take file first if present. - * - * @param array $messages - * - * @return $this - */ - public function setTranslations($messages) - { - return $this->setMessages($this->getLocale(), $messages); - } - - /** - * Get messages of a locale, if none given, return all the - * languages. - * - * @param string|null $locale - * - * @return array - */ - public function getMessages($locale = null) - { - return $locale === null ? $this->messages : $this->messages[$locale]; - } - - /** - * Set the current translator locale and indicate if the source locale file exists - * - * @param string $locale locale ex. en - * - * @return bool - */ - public function setLocale($locale) - { - $locale = preg_replace_callback('/[-_]([a-z]{2,}|[0-9]{2,})/', function ($matches) { - // _2-letters or YUE is a region, _3+-letters is a variant - $upper = strtoupper($matches[1]); - - if ($upper === 'YUE' || $upper === 'ISO' || \strlen($upper) < 3) { - return "_$upper"; - } - - return '_'.ucfirst($matches[1]); - }, strtolower($locale)); - - $previousLocale = $this->getLocale(); - - if ($previousLocale === $locale && isset($this->messages[$locale])) { - return true; - } - - unset(static::$singletons[$previousLocale]); - - if ($locale === 'auto') { - $completeLocale = setlocale(LC_TIME, '0'); - $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale); - $locales = $this->getAvailableLocales($locale); - - $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); - - $getScore = function ($language) use ($completeLocaleChunks) { - return static::compareChunkLists($completeLocaleChunks, preg_split('/[_.-]+/', $language)); - }; - - usort($locales, function ($first, $second) use ($getScore) { - return $getScore($second) <=> $getScore($first); - }); - - $locale = $locales[0]; - } - - if (isset($this->aliases[$locale])) { - $locale = $this->aliases[$locale]; - } - - // If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback - if (str_contains($locale, '_') && - $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale)) - ) { - parent::setLocale($macroLocale); - } - - if ($this->loadMessagesFromFile($locale) || $this->initializing) { - parent::setLocale($locale); - - return true; - } - - return false; - } - - /** - * Show locale on var_dump(). - * - * @return array - */ - public function __debugInfo() - { - return [ - 'locale' => $this->getLocale(), - ]; - } - - private static function compareChunkLists($referenceChunks, $chunks) - { - $score = 0; - - foreach ($referenceChunks as $index => $chunk) { - if (!isset($chunks[$index])) { - $score++; - - continue; - } - - if (strtolower($chunks[$index]) === strtolower($chunk)) { - $score += 10; - } - } - - return $score; - } + // Proxy dynamically loaded LazyTranslator in a static way } diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php new file mode 100644 index 00000000..ad36c670 --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php @@ -0,0 +1,99 @@ +<?php + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\ImmutableException; +use Symfony\Component\Config\ConfigCacheFactoryInterface; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; + +class TranslatorImmutable extends Translator +{ + /** @var bool */ + private $constructed = false; + + public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) + { + parent::__construct($locale, $formatter, $cacheDir, $debug); + $this->constructed = true; + } + + /** + * @codeCoverageIgnore + */ + public function setDirectories(array $directories) + { + $this->disallowMutation(__METHOD__); + + return parent::setDirectories($directories); + } + + public function setLocale($locale) + { + $this->disallowMutation(__METHOD__); + + return parent::setLocale($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setMessages($locale, $messages) + { + $this->disallowMutation(__METHOD__); + + return parent::setMessages($locale, $messages); + } + + /** + * @codeCoverageIgnore + */ + public function setTranslations($messages) + { + $this->disallowMutation(__METHOD__); + + return parent::setTranslations($messages); + } + + /** + * @codeCoverageIgnore + */ + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) + { + $this->disallowMutation(__METHOD__); + + parent::setConfigCacheFactory($configCacheFactory); + } + + public function resetMessages($locale = null) + { + $this->disallowMutation(__METHOD__); + + return parent::resetMessages($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setFallbackLocales(array $locales) + { + $this->disallowMutation(__METHOD__); + + parent::setFallbackLocales($locales); + } + + private function disallowMutation($method) + { + if ($this->constructed) { + throw new ImmutableException($method.' not allowed on '.static::class); + } + } +} diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php new file mode 100644 index 00000000..ef4dee8e --- /dev/null +++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php @@ -0,0 +1,22 @@ +<?php + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt <brian@nesbot.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Mark translator using strong type from symfony/translation >= 6. + */ +interface TranslatorStrongTypeInterface +{ + public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages'); +} diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/README.md b/data/web/inc/lib/vendor/phpmailer/phpmailer/README.md index fa27d2f6..81b08976 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/README.md +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/README.md @@ -2,7 +2,12 @@ # PHPMailer – A full-featured email creation and transfer class for PHP -[](https://github.com/PHPMailer/PHPMailer/actions) [](https://packagist.org/packages/phpmailer/phpmailer) [](https://packagist.org/packages/phpmailer/phpmailer) [](https://packagist.org/packages/phpmailer/phpmailer) [](https://phpmailer.github.io/PHPMailer/) +[](https://github.com/PHPMailer/PHPMailer/actions) +[](https://codecov.io/gh/PHPMailer/PHPMailer) +[](https://packagist.org/packages/phpmailer/phpmailer) +[](https://packagist.org/packages/phpmailer/phpmailer) +[](https://packagist.org/packages/phpmailer/phpmailer) +[](https://phpmailer.github.io/PHPMailer/) ## Features - Probably the world's most popular code for sending email from PHP! @@ -17,7 +22,7 @@ - Protects against header injection attacks - Error messages in over 50 languages! - DKIM and S/MIME signing support -- Compatible with PHP 5.5 and later, including PHP 8.0 +- Compatible with PHP 5.5 and later, including PHP 8.1 - Namespaced to prevent name clashes - Much more! @@ -39,7 +44,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "^6.2" +"phpmailer/phpmailer": "^6.5" ``` or run @@ -89,7 +94,7 @@ use PHPMailer\PHPMailer\Exception; //Load Composer's autoloader require 'vendor/autoload.php'; -//Instantiation and passing `true` enables exceptions +//Create an instance; passing `true` enables exceptions $mail = new PHPMailer(true); try { @@ -100,8 +105,8 @@ try { $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'user@example.com'; //SMTP username $mail->Password = 'secret'; //SMTP password - $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged - $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above + $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption + $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('from@example.com', 'Mailer'); diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/VERSION b/data/web/inc/lib/vendor/phpmailer/phpmailer/VERSION index 4be2c727..cd802a1e 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/VERSION +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.5.0 \ No newline at end of file +6.6.0 \ No newline at end of file diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/composer.json b/data/web/inc/lib/vendor/phpmailer/phpmailer/composer.json index 58393b2c..b13732be 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/composer.json +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/composer.json @@ -25,6 +25,11 @@ "type": "github" } ], + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, "require": { "php": ">=5.5.0", "ext-ctype": "*", @@ -34,10 +39,12 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" + "squizlabs/php_codesniffer": "^3.6.2", + "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", @@ -60,6 +67,10 @@ "license": "LGPL-2.1-only", "scripts": { "check": "./vendor/bin/phpcs", - "test": "./vendor/bin/phpunit" + "test": "./vendor/bin/phpunit --no-coverage", + "coverage": "./vendor/bin/phpunit", + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php,phps --exclude vendor --exclude .git --exclude build" + ] } } diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php index b57f0ec6..38a7a8e7 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -9,24 +9,30 @@ * @see http://unicode.org/udhr/n/notes_fra.html */ -$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l\'authentification.'; +$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.'; +$PHPMAILER_LANG['buggy_php'] = 'Votre version de PHP est affectée par un bug qui peut entraîner des messages corrompus. Pour résoudre ce problème, passez à l’envoi par SMTP, désactivez l’option mail.add_x_header dans le fichier php.ini, passez à MacOS ou Linux, ou passez PHP à la version 7.0.17+ ou 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : impossible de se connecter au serveur SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : données incorrectes.'; $PHPMAILER_LANG['empty_message'] = 'Corps du message vide.'; $PHPMAILER_LANG['encoding'] = 'Encodage inconnu : '; -$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : '; -$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : '; +$PHPMAILER_LANG['execute'] = 'Impossible de lancer l’exécution : '; +$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : '; +$PHPMAILER_LANG['file_access'] = 'Impossible d’accéder au fichier : '; $PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible : '; -$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué : '; -$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.'; -$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide : '; -$PHPMAILER_LANG['invalid_hostentry'] = 'L\'entrée hôte n\'est pas valide : '; -$PHPMAILER_LANG['invalid_host'] = 'L\'hôte n\'est pas valide : '; +$PHPMAILER_LANG['from_failed'] = 'L’adresse d’expéditeur suivante a échoué : '; +$PHPMAILER_LANG['instantiate'] = 'Impossible d’instancier la fonction mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Adresse courriel non valide : '; +$PHPMAILER_LANG['invalid_header'] = 'Nom ou valeur de l’en-tête non valide'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Entrée d’hôte non valide : '; +$PHPMAILER_LANG['invalid_host'] = 'Hôte non valide : '; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; $PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants sont en erreur : '; +$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants ont échoué : '; $PHPMAILER_LANG['signing'] = 'Erreur de signature : '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Échec de la connexion SMTP.'; +$PHPMAILER_LANG['smtp_code'] = 'Code SMTP : '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échouée.'; +$PHPMAILER_LANG['smtp_detail'] = 'Détails : '; $PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : '; -$PHPMAILER_LANG['variable_set'] = 'Impossible d\'initialiser ou de réinitialiser une variable : '; +$PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : '; $PHPMAILER_LANG['extension_missing'] = 'Extension manquante : '; diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php index eee79898..c76f5264 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -5,24 +5,25 @@ * @package PHPMailer * @author Mitsuhiro Yoshida <http://mitstek.com/> * @author Yoshi Sakai <http://bluemooninc.jp/> + * @author Arisophy <https://github.com/arisophy/> */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; $PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['signing'] = '署名エラー: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; +$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php index bf41ade8..8229d5e2 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php @@ -7,23 +7,28 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; $PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; $PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; $PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; $PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; $PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; $PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; $PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; $PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; $PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; $PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; $PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; $PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; $PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php index d8638098..5239865a 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php @@ -7,24 +7,32 @@ * @author Lucas Guimarães <lucas@lucasguimaraes.com> * @author Phelipe Alves <phelipealvesdesouza@gmail.com> * @author Fabio Beneditto <fabiobeneditto@gmail.com> + * @author Geidson Benício Coelho <geidsonc@gmail.com> */ $PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; +$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ '; $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; $PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; $PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; $PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; $PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; $PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; $PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; $PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor de cabeçalho inválido'; +$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: '; +$PHPMAILER_LANG['invalid_host'] = 'host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; $PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; $PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; $PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: '; +$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php index 292ec1e4..45bef915 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php @@ -3,25 +3,31 @@ /** * Romanian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer - * @author Alex Florea <alecz.fia@gmail.com> */ $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.'; +$PHPMAILER_LANG['buggy_php'] = 'Versiunea instalată de PHP este afectată de o problemă care poate duce la coruperea mesajelor Pentru a preveni această problemă, folosiți SMTP, dezactivați opțiunea mail.add_x_header din php.ini, folosiți MacOS/Linux sau actualizați versiunea de PHP la 7.0.17+ sau 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.'; $PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; $PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; $PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; $PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; +$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; $PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: '; $PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: '; $PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; $PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.'; $PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; +$PHPMAILER_LANG['invalid_header'] = 'Numele sau valoarea header-ului nu este validă: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry invalid: '; +$PHPMAILER_LANG['invalid_host'] = 'Host invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; $PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.'; $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: '; $PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; +$PHPMAILER_LANG['smtp_code'] = 'Cod SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informații SMTP adiționale: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalii SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; -$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php index c437a886..3e00c259 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php @@ -9,23 +9,28 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; +$PHPMAILER_LANG['buggy_php'] = 'Na vašo PHP različico vpliva napaka, ki lahko povzroči poškodovana sporočila. Če želite težavo odpraviti, preklopite na pošiljanje prek SMTP, onemogočite možnost mail.add_x_header v vaši php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vašo PHP zaličico na 7.0.17+ ali 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; $PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; $PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; $PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; +$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; $PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; $PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; $PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; $PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; $PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; +$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave'; $PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; $PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; $PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; $PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; +$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: '; $PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; $PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; -$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/phpunit.xml.dist b/data/web/inc/lib/vendor/phpmailer/phpmailer/phpunit.xml.dist deleted file mode 100644 index c68df965..00000000 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/phpunit.xml.dist +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<phpunit - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd" - backupGlobals="true" - bootstrap="vendor/autoload.php" - verbose="true" - colors="true" - forceCoversAnnotation="false" - > - <testsuites> - <testsuite name="PHPMailerTests"> - <directory>./test/</directory> - </testsuite> - </testsuites> - <listeners> - <listener class="PHPMailer\Test\DebugLogTestListener" /> - </listeners> - <groups> - <exclude> - <group>languages</group> - <group>pop3</group> - </exclude> - </groups> - <filter> - <whitelist addUncoveredFilesFromWhitelist="true"> - <directory suffix=".php">./src</directory> - </whitelist> - </filter> - <logging> - <log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/> - <log type="coverage-clover" target="build/logs/clover.xml"/> - <log type="junit" target="build/logs/junit.xml"/> - </logging> -</phpunit> diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/Exception.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/Exception.php index a50a8991..52eaf951 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/Exception.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/Exception.php @@ -35,6 +35,6 @@ class Exception extends \Exception */ public function errorMessage() { - return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n"; + return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n"; } } diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuth.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuth.php index c93d0be1..c1d5b776 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuth.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuth.php @@ -33,7 +33,7 @@ use League\OAuth2\Client\Token\AccessToken; * * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> */ -class OAuth +class OAuth implements OAuthTokenProvider { /** * An instance of the League OAuth Client Provider. diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php new file mode 100644 index 00000000..11555074 --- /dev/null +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php @@ -0,0 +1,44 @@ +<?php + +/** + * PHPMailer - PHP email creation and transport class. + * PHP Version 5.5. + * + * @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * + * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> + * @author Jim Jagielski (jimjag) <jimjag@gmail.com> + * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * OAuthTokenProvider - OAuth2 token provider interface. + * Provides base64 encoded OAuth2 auth strings for SMTP authentication. + * + * @see OAuth + * @see SMTP::authenticate() + * + * @author Peter Scopes (pdscopes) + * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> + */ +interface OAuthTokenProvider +{ + /** + * Generate a base64-encoded OAuth token ensuring that the access token has not expired. + * The string to be base 64 encoded should be in the form: + * "user=<user_email_address>\001auth=Bearer <access_token>\001\001" + * + * @return string + */ + public function getOauth64(); +} diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php index eb4b742b..718216b5 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -103,14 +103,14 @@ class PHPMailer * * @var string */ - public $From = 'root@localhost'; + public $From = ''; /** * The From name of the message. * * @var string */ - public $FromName = 'Root User'; + public $FromName = ''; /** * The envelope sender of the message. @@ -358,9 +358,9 @@ class PHPMailer public $AuthType = ''; /** - * An instance of the PHPMailer OAuth class. + * An implementation of the PHPMailer OAuthTokenProvider interface. * - * @var OAuth + * @var OAuthTokenProvider */ protected $oauth; @@ -689,7 +689,7 @@ class PHPMailer protected $boundary = []; /** - * The array of available languages. + * The array of available text strings for the current language. * * @var array */ @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.5.0'; + const VERSION = '6.6.0'; /** * Error severity: message only, continue processing. @@ -1185,28 +1185,37 @@ class PHPMailer * * @param string $addrstr The address list string * @param bool $useimap Whether to use the IMAP extension to parse the list + * @param string $charset The charset to use when decoding the address list string. * * @return array */ - public static function parseAddresses($addrstr, $useimap = true) + public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) { $addresses = []; if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { //Use this built-in parser if it's available $list = imap_rfc822_parse_adrlist($addrstr, ''); + // Clear any potential IMAP errors to get rid of notices being thrown at end of script. + imap_errors(); foreach ($list as $address) { if ( - ('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( - $address->mailbox . '@' . $address->host - ) + '.SYNTAX-ERROR.' !== $address->host && + static::validateAddress($address->mailbox . '@' . $address->host) ) { //Decode the name part if it's present and encoded if ( property_exists($address, 'personal') && - extension_loaded('mbstring') && - preg_match('/^=\?.*\?=$/', $address->personal) + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + defined('MB_CASE_UPPER') && + preg_match('/^=\?.*\?=$/s', $address->personal) ) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $address->personal = str_replace('_', '=20', $address->personal); + //Decode the name $address->personal = mb_decode_mimeheader($address->personal); + mb_internal_encoding($origCharset); } $addresses[] = [ @@ -1234,9 +1243,16 @@ class PHPMailer $email = trim(str_replace('>', '', $email)); $name = trim($name); if (static::validateAddress($email)) { + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled //If this name is encoded, decode it - if (preg_match('/^=\?.*\?=$/', $name)) { + if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $name = str_replace('_', '=20', $name); + //Decode the name $name = mb_decode_mimeheader($name); + mb_internal_encoding($origCharset); } $addresses[] = [ //Remove any surrounding quotes and spaces from the name @@ -1436,7 +1452,12 @@ class PHPMailer $errorcode = 0; if (defined('INTL_IDNA_VARIANT_UTS46')) { //Use the current punycode standard (appeared in PHP 7.2) - $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46); + $punycode = idn_to_ascii( + $domain, + \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | + \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, + \INTL_IDNA_VARIANT_UTS46 + ); } elseif (defined('INTL_IDNA_VARIANT_2003')) { //Fall back to this old, deprecated/removed encoding $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); @@ -1508,12 +1529,7 @@ class PHPMailer && ini_get('mail.add_x_header') === '1' && stripos(PHP_OS, 'WIN') === 0 ) { - trigger_error( - 'Your version of PHP is affected by a bug that may result in corrupted messages.' . - ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . - ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', - E_USER_WARNING - ); + trigger_error($this->lang('buggy_php'), E_USER_WARNING); } try { @@ -1687,7 +1703,10 @@ class PHPMailer //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html //Example problem: https://www.drupal.org/node/1057954 - if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { + + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { //PHP config has a sender address we can use $this->Sender = ini_get('sendmail_from'); } @@ -1724,7 +1743,7 @@ class PHPMailer fwrite($mail, $header); fwrite($mail, $body); $result = pclose($mail); - $addrinfo = static::parseAddresses($toAddr); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); $this->doCallback( ($result === 0), [[$addrinfo['address'], $addrinfo['name']]], @@ -1779,7 +1798,13 @@ class PHPMailer */ protected static function isShellSafe($string) { - //Future-proof + //It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg, + //but some hosting providers disable it, creating a security problem that we don't want to have to deal with, + //so we don't. + if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) { + return false; + } + if ( escapeshellcmd($string) !== $string || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) @@ -1869,7 +1894,10 @@ class PHPMailer //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html //Example problem: https://www.drupal.org/node/1057954 //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { + + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { //PHP config has a sender address we can use $this->Sender = ini_get('sendmail_from'); } @@ -1884,7 +1912,7 @@ class PHPMailer if ($this->SingleTo && count($toArr) > 1) { foreach ($toArr as $toAddr) { $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $addrinfo = static::parseAddresses($toAddr); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); $this->doCallback( $result, [[$addrinfo['address'], $addrinfo['name']]], @@ -2133,7 +2161,8 @@ class PHPMailer } if ($tls) { if (!$this->smtp->startTLS()) { - throw new Exception($this->lang('connect_host')); + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); } //We must resend EHLO after TLS negotiation $this->smtp->hello($hello); @@ -2163,6 +2192,10 @@ class PHPMailer //As we've caught all exceptions, just report whatever the last one was if ($this->exceptions && null !== $lastexception) { throw $lastexception; + } elseif ($this->exceptions) { + // no exception was thrown, likely $this->smtp->connect() failed + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); } return false; @@ -2181,14 +2214,15 @@ class PHPMailer /** * Set the language for error messages. - * Returns false if it cannot load the language file. * The default language is English. * * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") - * @param string $lang_path Path to the language file directory, with trailing separator (slash).D + * Optionally, the language code can be enhanced with a 4-character + * script annotation and/or a 2-character country annotation. + * @param string $lang_path Path to the language file directory, with trailing separator (slash) * Do not set this from user input! * - * @return bool + * @return bool Returns true if the requested language was loaded, false otherwise. */ public function setLanguage($langcode = 'en', $lang_path = '') { @@ -2211,44 +2245,77 @@ class PHPMailer //Define full set of translatable strings in English $PHPMAILER_LANG = [ 'authenticate' => 'SMTP Error: Could not authenticate.', + 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'data_not_accepted' => 'SMTP Error: data not accepted.', 'empty_message' => 'Message body empty', 'encoding' => 'Unknown encoding: ', 'execute' => 'Could not execute: ', + 'extension_missing' => 'Extension missing: ', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'from_failed' => 'The following From address failed: ', 'instantiate' => 'Could not instantiate mail function.', 'invalid_address' => 'Invalid address: ', + 'invalid_header' => 'Invalid header name or value', 'invalid_hostentry' => 'Invalid hostentry: ', 'invalid_host' => 'Invalid host: ', 'mailer_not_supported' => ' mailer is not supported.', 'provide_address' => 'You must provide at least one recipient email address.', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'signing' => 'Signing Error: ', + 'smtp_code' => 'SMTP code: ', + 'smtp_code_ex' => 'Additional SMTP info: ', 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_detail' => 'Detail: ', 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ', - 'extension_missing' => 'Extension missing: ', ]; if (empty($lang_path)) { //Calculate an absolute path so it can work if CWD is not here $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; } + //Validate $langcode - if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { + $foundlang = true; + $langcode = strtolower($langcode); + if ( + !preg_match('/^(?P<lang>[a-z]{2})(?P<script>_[a-z]{4})?(?P<country>_[a-z]{2})?$/', $langcode, $matches) + && $langcode !== 'en' + ) { + $foundlang = false; $langcode = 'en'; } - $foundlang = true; - $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; + //There is no English translation file if ('en' !== $langcode) { - //Make sure language file path is readable - if (!static::fileIsAccessible($lang_file)) { + $langcodes = []; + if (!empty($matches['script']) && !empty($matches['country'])) { + $langcodes[] = $matches['lang'] . $matches['script'] . $matches['country']; + } + if (!empty($matches['country'])) { + $langcodes[] = $matches['lang'] . $matches['country']; + } + if (!empty($matches['script'])) { + $langcodes[] = $matches['lang'] . $matches['script']; + } + $langcodes[] = $matches['lang']; + + //Try and find a readable language file for the requested language. + $foundFile = false; + foreach ($langcodes as $code) { + $lang_file = $lang_path . 'phpmailer.lang-' . $code . '.php'; + if (static::fileIsAccessible($lang_file)) { + $foundFile = true; + break; + } + } + + if ($foundFile === false) { $foundlang = false; } else { - //$foundlang = include $lang_file; $lines = file($lang_file); foreach ($lines as $line) { //Translation file lines look like this: @@ -2283,6 +2350,10 @@ class PHPMailer */ public function getTranslations() { + if (empty($this->language)) { + $this->setLanguage(); // Set the default language. + } + return $this->language; } @@ -2551,7 +2622,17 @@ class PHPMailer //Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 //https://tools.ietf.org/html/rfc5322#section-3.6.4 - if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) { + if ( + '' !== $this->MessageID && + preg_match( + '/^<((([a-z\d!#$%&\'*+\/=?^_`{|}~-]+(\.[a-z\d!#$%&\'*+\/=?^_`{|}~-]+)*)' . + '|("(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]|[\x21\x23-\x5B\x5D-\x7E])' . + '|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*"))@(([a-z\d!#$%&\'*+\/=?^_`{|}~-]+' . + '(\.[a-z\d!#$%&\'*+\/=?^_`{|}~-]+)*)|(\[(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]' . + '|[\x21-\x5A\x5E-\x7E])|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*\])))>$/Di', + $this->MessageID + ) + ) { $this->lastMessageID = $this->MessageID; } else { $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); @@ -2561,16 +2642,15 @@ class PHPMailer $result .= $this->headerLine('X-Priority', $this->Priority); } if ('' === $this->XMailer) { + //Empty string for default X-Mailer header $result .= $this->headerLine( 'X-Mailer', 'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)' ); - } else { - $myXmailer = trim($this->XMailer); - if ($myXmailer) { - $result .= $this->headerLine('X-Mailer', $myXmailer); - } - } + } elseif (is_string($this->XMailer) && trim($this->XMailer) !== '') { + //Some string + $result .= $this->headerLine('X-Mailer', trim($this->XMailer)); + } //Other values result in no X-Mailer header if ('' !== $this->ConfirmReadingTo) { $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); @@ -3935,13 +4015,13 @@ class PHPMailer if (!empty($lasterror['error'])) { $msg .= $this->lang('smtp_error') . $lasterror['error']; if (!empty($lasterror['detail'])) { - $msg .= ' Detail: ' . $lasterror['detail']; + $msg .= ' ' . $this->lang('smtp_detail') . $lasterror['detail']; } if (!empty($lasterror['smtp_code'])) { - $msg .= ' SMTP code: ' . $lasterror['smtp_code']; + $msg .= ' ' . $this->lang('smtp_code') . $lasterror['smtp_code']; } if (!empty($lasterror['smtp_code_ex'])) { - $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; + $msg .= ' ' . $this->lang('smtp_code_ex') . $lasterror['smtp_code_ex']; } } } @@ -4002,7 +4082,7 @@ class PHPMailer empty($host) || !is_string($host) || strlen($host) > 256 - || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+])$/', $host) + || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+\])$/', $host) ) { return false; } @@ -4052,6 +4132,26 @@ class PHPMailer return $key; } + /** + * Build an error message starting with a generic one and adding details if possible. + * + * @param string $base_key + * @return string + */ + private function getSmtpErrorMessage($base_key) + { + $message = $this->lang($base_key); + $error = $this->smtp->getError(); + if (!empty($error['error'])) { + $message .= ' ' . $error['error']; + if (!empty($error['detail'])) { + $message .= ' ' . $error['detail']; + } + } + + return $message; + } + /** * Check if an error occurred. * @@ -4079,11 +4179,11 @@ class PHPMailer list($name, $value) = explode(':', $name, 2); } $name = trim($name); - $value = trim($value); + $value = (null === $value) ? '' : trim($value); //Ensure name is not empty, and that neither name nor value contain line breaks if (empty($name) || strpbrk($name . $value, "\r\n") !== false) { if ($this->exceptions) { - throw new Exception('Invalid header name or value'); + throw new Exception($this->lang('invalid_header')); } return false; @@ -4237,7 +4337,8 @@ class PHPMailer * * @param string $html The HTML text to convert * @param bool|callable $advanced Any boolean value to use the internal converter, - * or provide your own callable for custom conversion + * or provide your own callable for custom conversion. + * *Never* pass user-supplied data into this parameter * * @return string */ @@ -4951,9 +5052,9 @@ class PHPMailer } /** - * Get the OAuth instance. + * Get the OAuthTokenProvider instance. * - * @return OAuth + * @return OAuthTokenProvider */ public function getOAuth() { @@ -4961,9 +5062,9 @@ class PHPMailer } /** - * Set an OAuth instance. + * Set an OAuthTokenProvider instance. */ - public function setOAuth(OAuth $oauth) + public function setOAuth(OAuthTokenProvider $oauth) { $this->oauth = $oauth; } diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/POP3.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/POP3.php index b38964b1..86cfebd2 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/POP3.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.5.0'; + const VERSION = '6.6.0'; /** * Default POP3 port number. @@ -308,6 +308,7 @@ class POP3 { if (!$this->connected) { $this->setError('Not connected to POP3 server'); + return false; } if (empty($username)) { $username = $this->username; @@ -337,6 +338,15 @@ class POP3 public function disconnect() { $this->sendString('QUIT'); + + // RFC 1939 shows POP3 server sending a +OK response to the QUIT command. + // Try to get it. Ignore any failures here. + try { + $this->getResponse(); + } catch (Exception $e) { + //Do nothing + } + //The QUIT command may cause the daemon to exit, which will kill our connection //So ignore errors here try { @@ -344,6 +354,10 @@ class POP3 } catch (Exception $e) { //Do nothing } + + // Clean up attributes. + $this->connected = false; + $this->pop_conn = false; } /** diff --git a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/SMTP.php b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/SMTP.php index a4a91ed0..5ecad21d 100644 --- a/data/web/inc/lib/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/data/web/inc/lib/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.5.0'; + const VERSION = '6.6.0'; /** * SMTP line break constant. @@ -187,6 +187,7 @@ class SMTP 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', + 'Mailjet' => '/[\d]{3} OK queued as (.*)/', ]; /** @@ -392,7 +393,6 @@ class SMTP STREAM_CLIENT_CONNECT, $socket_context ); - restore_error_handler(); } else { //Fall back to fsockopen which should work in more places, but is missing some features $this->edebug( @@ -407,8 +407,8 @@ class SMTP $errstr, $timeout ); - restore_error_handler(); } + restore_error_handler(); //Verify we connected properly if (!is_resource($connection)) { @@ -483,7 +483,7 @@ class SMTP * @param string $username The user name * @param string $password The password * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) - * @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication + * @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication * * @return bool True if successfully authenticated */ @@ -696,7 +696,7 @@ class SMTP /** * Send an SMTP DATA command. * Issues a data command and sends the msg_data to the server, - * finializing the mail transaction. $msg_data is the message + * finalizing the mail transaction. $msg_data is the message * that is to be send with the headers. Each header needs to be * on a single line followed by a <CRLF> with the message headers * and the message body being separated by an additional <CRLF>. @@ -1170,7 +1170,7 @@ class SMTP if (!$this->server_caps) { $this->setError('No HELO/EHLO was sent'); - return; + return null; } if (!array_key_exists($name, $this->server_caps)) { @@ -1182,7 +1182,7 @@ class SMTP } $this->setError('HELO handshake was used; No information about server extensions available'); - return; + return null; } return $this->server_caps[$name]; diff --git a/data/web/inc/lib/vendor/psr/container/composer.json b/data/web/inc/lib/vendor/psr/container/composer.json index 3797a253..baf6cd1a 100644 --- a/data/web/inc/lib/vendor/psr/container/composer.json +++ b/data/web/inc/lib/vendor/psr/container/composer.json @@ -12,11 +12,16 @@ } ], "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } } } diff --git a/data/web/inc/lib/vendor/psr/container/src/ContainerExceptionInterface.php b/data/web/inc/lib/vendor/psr/container/src/ContainerExceptionInterface.php index cf10b8b4..0f213f2f 100644 --- a/data/web/inc/lib/vendor/psr/container/src/ContainerExceptionInterface.php +++ b/data/web/inc/lib/vendor/psr/container/src/ContainerExceptionInterface.php @@ -2,9 +2,11 @@ namespace Psr\Container; +use Throwable; + /** * Base interface representing a generic exception in a container. */ -interface ContainerExceptionInterface +interface ContainerExceptionInterface extends Throwable { } diff --git a/data/web/inc/lib/vendor/psr/container/src/ContainerInterface.php b/data/web/inc/lib/vendor/psr/container/src/ContainerInterface.php index cf8e7fd3..b2cad401 100644 --- a/data/web/inc/lib/vendor/psr/container/src/ContainerInterface.php +++ b/data/web/inc/lib/vendor/psr/container/src/ContainerInterface.php @@ -32,5 +32,5 @@ interface ContainerInterface * * @return bool */ - public function has(string $id); + public function has(string $id): bool; } diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/AbstractLogger.php b/data/web/inc/lib/vendor/psr/log/Psr/Log/AbstractLogger.php deleted file mode 100644 index e02f9daf..00000000 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/AbstractLogger.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php - -namespace Psr\Log; - -/** - * This is a simple Logger implementation that other Loggers can inherit from. - * - * It simply delegates all log-level-specific methods to the `log` method to - * reduce boilerplate code that a simple Logger that does the same thing with - * messages regardless of the error level has to implement. - */ -abstract class AbstractLogger implements LoggerInterface -{ - /** - * System is unusable. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function emergency($message, array $context = array()) - { - $this->log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } -} diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/DummyTest.php b/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/DummyTest.php deleted file mode 100644 index 9638c110..00000000 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/DummyTest.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -namespace Psr\Log\Test; - -/** - * This class is internal and does not follow the BC promise. - * - * Do NOT use this class in any way. - * - * @internal - */ -class DummyTest -{ - public function __toString() - { - return 'DummyTest'; - } -} diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php deleted file mode 100644 index e1e5354d..00000000 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php - -namespace Psr\Log\Test; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; -use PHPUnit\Framework\TestCase; - -/** - * Provides a base test class for ensuring compliance with the LoggerInterface. - * - * Implementors can extend the class and implement abstract methods to run this - * as part of their test suite. - */ -abstract class LoggerInterfaceTest extends TestCase -{ - /** - * @return LoggerInterface - */ - abstract public function getLogger(); - - /** - * This must return the log messages in order. - * - * The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>". - * - * Example ->error('Foo') would yield "error Foo". - * - * @return string[] - */ - abstract public function getLogs(); - - public function testImplements() - { - $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); - } - - /** - * @dataProvider provideLevelsAndMessages - */ - public function testLogsAtAllLevels($level, $message) - { - $logger = $this->getLogger(); - $logger->{$level}($message, array('user' => 'Bob')); - $logger->log($level, $message, array('user' => 'Bob')); - - $expected = array( - $level.' message of level '.$level.' with context: Bob', - $level.' message of level '.$level.' with context: Bob', - ); - $this->assertEquals($expected, $this->getLogs()); - } - - public function provideLevelsAndMessages() - { - return array( - LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), - LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), - LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), - LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), - LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), - LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), - LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), - LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), - ); - } - - /** - * @expectedException \Psr\Log\InvalidArgumentException - */ - public function testThrowsOnInvalidLevel() - { - $logger = $this->getLogger(); - $logger->log('invalid level', 'Foo'); - } - - public function testContextReplacement() - { - $logger = $this->getLogger(); - $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); - - $expected = array('info {Message {nothing} Bob Bar a}'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testObjectCastToString() - { - if (method_exists($this, 'createPartialMock')) { - $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); - } else { - $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); - } - $dummy->expects($this->once()) - ->method('__toString') - ->will($this->returnValue('DUMMY')); - - $this->getLogger()->warning($dummy); - - $expected = array('warning DUMMY'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextCanContainAnything() - { - $closed = fopen('php://memory', 'r'); - fclose($closed); - - $context = array( - 'bool' => true, - 'null' => null, - 'string' => 'Foo', - 'int' => 0, - 'float' => 0.5, - 'nested' => array('with object' => new DummyTest), - 'object' => new \DateTime, - 'resource' => fopen('php://memory', 'r'), - 'closed' => $closed, - ); - - $this->getLogger()->warning('Crazy context data', $context); - - $expected = array('warning Crazy context data'); - $this->assertEquals($expected, $this->getLogs()); - } - - public function testContextExceptionKeyCanBeExceptionOrOtherValues() - { - $logger = $this->getLogger(); - $logger->warning('Random message', array('exception' => 'oops')); - $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); - - $expected = array( - 'warning Random message', - 'critical Uncaught Exception!' - ); - $this->assertEquals($expected, $this->getLogs()); - } -} diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/TestLogger.php b/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/TestLogger.php deleted file mode 100644 index 1be32304..00000000 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/Test/TestLogger.php +++ /dev/null @@ -1,147 +0,0 @@ -<?php - -namespace Psr\Log\Test; - -use Psr\Log\AbstractLogger; - -/** - * Used for testing purposes. - * - * It records all records and gives you access to them for verification. - * - * @method bool hasEmergency($record) - * @method bool hasAlert($record) - * @method bool hasCritical($record) - * @method bool hasError($record) - * @method bool hasWarning($record) - * @method bool hasNotice($record) - * @method bool hasInfo($record) - * @method bool hasDebug($record) - * - * @method bool hasEmergencyRecords() - * @method bool hasAlertRecords() - * @method bool hasCriticalRecords() - * @method bool hasErrorRecords() - * @method bool hasWarningRecords() - * @method bool hasNoticeRecords() - * @method bool hasInfoRecords() - * @method bool hasDebugRecords() - * - * @method bool hasEmergencyThatContains($message) - * @method bool hasAlertThatContains($message) - * @method bool hasCriticalThatContains($message) - * @method bool hasErrorThatContains($message) - * @method bool hasWarningThatContains($message) - * @method bool hasNoticeThatContains($message) - * @method bool hasInfoThatContains($message) - * @method bool hasDebugThatContains($message) - * - * @method bool hasEmergencyThatMatches($message) - * @method bool hasAlertThatMatches($message) - * @method bool hasCriticalThatMatches($message) - * @method bool hasErrorThatMatches($message) - * @method bool hasWarningThatMatches($message) - * @method bool hasNoticeThatMatches($message) - * @method bool hasInfoThatMatches($message) - * @method bool hasDebugThatMatches($message) - * - * @method bool hasEmergencyThatPasses($message) - * @method bool hasAlertThatPasses($message) - * @method bool hasCriticalThatPasses($message) - * @method bool hasErrorThatPasses($message) - * @method bool hasWarningThatPasses($message) - * @method bool hasNoticeThatPasses($message) - * @method bool hasInfoThatPasses($message) - * @method bool hasDebugThatPasses($message) - */ -class TestLogger extends AbstractLogger -{ - /** - * @var array - */ - public $records = []; - - public $recordsByLevel = []; - - /** - * @inheritdoc - */ - public function log($level, $message, array $context = []) - { - $record = [ - 'level' => $level, - 'message' => $message, - 'context' => $context, - ]; - - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } - - public function hasRecords($level) - { - return isset($this->recordsByLevel[$level]); - } - - public function hasRecord($record, $level) - { - if (is_string($record)) { - $record = ['message' => $record]; - } - return $this->hasRecordThatPasses(function ($rec) use ($record) { - if ($rec['message'] !== $record['message']) { - return false; - } - if (isset($record['context']) && $rec['context'] !== $record['context']) { - return false; - } - return true; - }, $level); - } - - public function hasRecordThatContains($message, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== false; - }, $level); - } - - public function hasRecordThatMatches($regex, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($regex) { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - - public function hasRecordThatPasses(callable $predicate, $level) - { - if (!isset($this->recordsByLevel[$level])) { - return false; - } - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if (call_user_func($predicate, $rec, $i)) { - return true; - } - } - return false; - } - - public function __call($method, $args) - { - if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = strtolower($matches[2]); - if (method_exists($this, $genericMethod)) { - $args[] = $level; - return call_user_func_array([$this, $genericMethod], $args); - } - } - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); - } - - public function reset() - { - $this->records = []; - $this->recordsByLevel = []; - } -} diff --git a/data/web/inc/lib/vendor/psr/log/composer.json b/data/web/inc/lib/vendor/psr/log/composer.json index ca056953..879fc6f5 100644 --- a/data/web/inc/lib/vendor/psr/log/composer.json +++ b/data/web/inc/lib/vendor/psr/log/composer.json @@ -11,16 +11,16 @@ } ], "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } } } diff --git a/data/web/inc/lib/vendor/psr/log/src/AbstractLogger.php b/data/web/inc/lib/vendor/psr/log/src/AbstractLogger.php new file mode 100644 index 00000000..d60a091a --- /dev/null +++ b/data/web/inc/lib/vendor/psr/log/src/AbstractLogger.php @@ -0,0 +1,15 @@ +<?php + +namespace Psr\Log; + +/** + * This is a simple Logger implementation that other Loggers can inherit from. + * + * It simply delegates all log-level-specific methods to the `log` method to + * reduce boilerplate code that a simple Logger that does the same thing with + * messages regardless of the error level has to implement. + */ +abstract class AbstractLogger implements LoggerInterface +{ + use LoggerTrait; +} diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/data/web/inc/lib/vendor/psr/log/src/InvalidArgumentException.php similarity index 100% rename from data/web/inc/lib/vendor/psr/log/Psr/Log/InvalidArgumentException.php rename to data/web/inc/lib/vendor/psr/log/src/InvalidArgumentException.php diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/LogLevel.php b/data/web/inc/lib/vendor/psr/log/src/LogLevel.php similarity index 100% rename from data/web/inc/lib/vendor/psr/log/Psr/Log/LogLevel.php rename to data/web/inc/lib/vendor/psr/log/src/LogLevel.php diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerAwareInterface.php b/data/web/inc/lib/vendor/psr/log/src/LoggerAwareInterface.php similarity index 79% rename from data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerAwareInterface.php rename to data/web/inc/lib/vendor/psr/log/src/LoggerAwareInterface.php index 4d64f478..cc46a951 100644 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerAwareInterface.php +++ b/data/web/inc/lib/vendor/psr/log/src/LoggerAwareInterface.php @@ -14,5 +14,5 @@ interface LoggerAwareInterface * * @return void */ - public function setLogger(LoggerInterface $logger); + public function setLogger(LoggerInterface $logger): void; } diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerAwareTrait.php b/data/web/inc/lib/vendor/psr/log/src/LoggerAwareTrait.php similarity index 75% rename from data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerAwareTrait.php rename to data/web/inc/lib/vendor/psr/log/src/LoggerAwareTrait.php index 82bf45c8..4fb57a29 100644 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerAwareTrait.php +++ b/data/web/inc/lib/vendor/psr/log/src/LoggerAwareTrait.php @@ -12,14 +12,14 @@ trait LoggerAwareTrait * * @var LoggerInterface|null */ - protected $logger; + protected ?LoggerInterface $logger = null; /** * Sets a logger. * * @param LoggerInterface $logger */ - public function setLogger(LoggerInterface $logger) + public function setLogger(LoggerInterface $logger): void { $this->logger = $logger; } diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerInterface.php b/data/web/inc/lib/vendor/psr/log/src/LoggerInterface.php similarity index 66% rename from data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerInterface.php rename to data/web/inc/lib/vendor/psr/log/src/LoggerInterface.php index 2206cfde..b3a24b5f 100644 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerInterface.php +++ b/data/web/inc/lib/vendor/psr/log/src/LoggerInterface.php @@ -22,12 +22,12 @@ interface LoggerInterface /** * System is unusable. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function emergency($message, array $context = array()); + public function emergency(string|\Stringable $message, array $context = []): void; /** * Action must be taken immediately. @@ -35,35 +35,35 @@ interface LoggerInterface * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function alert($message, array $context = array()); + public function alert(string|\Stringable $message, array $context = []): void; /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function critical($message, array $context = array()); + public function critical(string|\Stringable $message, array $context = []): void; /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function error($message, array $context = array()); + public function error(string|\Stringable $message, array $context = []): void; /** * Exceptional occurrences that are not errors. @@ -71,55 +71,55 @@ interface LoggerInterface * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function warning($message, array $context = array()); + public function warning(string|\Stringable $message, array $context = []): void; /** * Normal but significant events. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function notice($message, array $context = array()); + public function notice(string|\Stringable $message, array $context = []): void; /** * Interesting events. * * Example: User logs in, SQL logs. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function info($message, array $context = array()); + public function info(string|\Stringable $message, array $context = []): void; /** * Detailed debug information. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function debug($message, array $context = array()); + public function debug(string|\Stringable $message, array $context = []): void; /** * Logs with an arbitrary level. * * @param mixed $level - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void * * @throws \Psr\Log\InvalidArgumentException */ - public function log($level, $message, array $context = array()); + public function log($level, string|\Stringable $message, array $context = []): void; } diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerTrait.php b/data/web/inc/lib/vendor/psr/log/src/LoggerTrait.php similarity index 69% rename from data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerTrait.php rename to data/web/inc/lib/vendor/psr/log/src/LoggerTrait.php index e392fef0..9c8733f9 100644 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/LoggerTrait.php +++ b/data/web/inc/lib/vendor/psr/log/src/LoggerTrait.php @@ -15,12 +15,12 @@ trait LoggerTrait /** * System is unusable. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function emergency($message, array $context = array()) + public function emergency(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::EMERGENCY, $message, $context); } @@ -31,12 +31,12 @@ trait LoggerTrait * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function alert($message, array $context = array()) + public function alert(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::ALERT, $message, $context); } @@ -46,12 +46,12 @@ trait LoggerTrait * * Example: Application component unavailable, unexpected exception. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function critical($message, array $context = array()) + public function critical(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::CRITICAL, $message, $context); } @@ -60,12 +60,12 @@ trait LoggerTrait * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function error($message, array $context = array()) + public function error(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::ERROR, $message, $context); } @@ -76,12 +76,12 @@ trait LoggerTrait * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function warning($message, array $context = array()) + public function warning(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::WARNING, $message, $context); } @@ -89,12 +89,12 @@ trait LoggerTrait /** * Normal but significant events. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function notice($message, array $context = array()) + public function notice(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::NOTICE, $message, $context); } @@ -104,12 +104,12 @@ trait LoggerTrait * * Example: User logs in, SQL logs. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function info($message, array $context = array()) + public function info(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::INFO, $message, $context); } @@ -117,12 +117,12 @@ trait LoggerTrait /** * Detailed debug information. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function debug($message, array $context = array()) + public function debug(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::DEBUG, $message, $context); } @@ -131,12 +131,12 @@ trait LoggerTrait * Logs with an arbitrary level. * * @param mixed $level - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void * * @throws \Psr\Log\InvalidArgumentException */ - abstract public function log($level, $message, array $context = array()); + abstract public function log($level, string|\Stringable $message, array $context = []): void; } diff --git a/data/web/inc/lib/vendor/psr/log/Psr/Log/NullLogger.php b/data/web/inc/lib/vendor/psr/log/src/NullLogger.php similarity index 78% rename from data/web/inc/lib/vendor/psr/log/Psr/Log/NullLogger.php rename to data/web/inc/lib/vendor/psr/log/src/NullLogger.php index c8f7293b..c1cc3c06 100644 --- a/data/web/inc/lib/vendor/psr/log/Psr/Log/NullLogger.php +++ b/data/web/inc/lib/vendor/psr/log/src/NullLogger.php @@ -16,14 +16,14 @@ class NullLogger extends AbstractLogger * Logs with an arbitrary level. * * @param mixed $level - * @param string $message - * @param array $context + * @param string|\Stringable $message + * @param array $context * * @return void * * @throws \Psr\Log\InvalidArgumentException */ - public function log($level, $message, array $context = array()) + public function log($level, string|\Stringable $message, array $context = []): void { // noop } diff --git a/data/web/inc/lib/vendor/psr/simple-cache/composer.json b/data/web/inc/lib/vendor/psr/simple-cache/composer.json index 2978fa55..a520e7d5 100644 --- a/data/web/inc/lib/vendor/psr/simple-cache/composer.json +++ b/data/web/inc/lib/vendor/psr/simple-cache/composer.json @@ -6,11 +6,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "autoload": { "psr-4": { @@ -19,7 +19,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } } } diff --git a/data/web/inc/lib/vendor/psr/simple-cache/src/CacheException.php b/data/web/inc/lib/vendor/psr/simple-cache/src/CacheException.php index eba53815..f61b24c2 100644 --- a/data/web/inc/lib/vendor/psr/simple-cache/src/CacheException.php +++ b/data/web/inc/lib/vendor/psr/simple-cache/src/CacheException.php @@ -5,6 +5,6 @@ namespace Psr\SimpleCache; /** * Interface used for all types of exceptions thrown by the implementing library. */ -interface CacheException +interface CacheException extends \Throwable { } diff --git a/data/web/inc/lib/vendor/psr/simple-cache/src/CacheInterface.php b/data/web/inc/lib/vendor/psr/simple-cache/src/CacheInterface.php index 99e8d957..cb05d2f1 100644 --- a/data/web/inc/lib/vendor/psr/simple-cache/src/CacheInterface.php +++ b/data/web/inc/lib/vendor/psr/simple-cache/src/CacheInterface.php @@ -15,7 +15,7 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function get($key, $default = null); + public function get(string $key, mixed $default = null); /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. @@ -31,7 +31,7 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set($key, $value, $ttl = null); + public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null); /** * Delete an item from the cache by its unique key. @@ -43,7 +43,7 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete($key); + public function delete(string $key); /** * Wipes clean the entire cache's keys. @@ -55,16 +55,16 @@ interface CacheInterface /** * Obtains multiple cache items by their unique keys. * - * @param iterable $keys A list of keys that can obtained in a single operation. - * @param mixed $default Default value to return for keys that do not exist. + * @param iterable<string> $keys A list of keys that can be obtained in a single operation. + * @param mixed $default Default value to return for keys that do not exist. * - * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. + * @return iterable<string, mixed> A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. * * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. */ - public function getMultiple($keys, $default = null); + public function getMultiple(iterable $keys, mixed $default = null); /** * Persists a set of key => value pairs in the cache, with an optional TTL. @@ -80,12 +80,12 @@ interface CacheInterface * MUST be thrown if $values is neither an array nor a Traversable, * or if any of the $values are not a legal value. */ - public function setMultiple($values, $ttl = null); + public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null); /** * Deletes multiple cache items in a single operation. * - * @param iterable $keys A list of string-based keys to be deleted. + * @param iterable<string> $keys A list of string-based keys to be deleted. * * @return bool True if the items were successfully removed. False if there was an error. * @@ -93,7 +93,7 @@ interface CacheInterface * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. */ - public function deleteMultiple($keys); + public function deleteMultiple(iterable $keys); /** * Determines whether an item is present in the cache. @@ -110,5 +110,5 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function has($key); + public function has(string $key); } diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/README.md b/data/web/inc/lib/vendor/robthree/twofactorauth/README.md index b8fcc75c..dd1ac30d 100644 --- a/data/web/inc/lib/vendor/robthree/twofactorauth/README.md +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/README.md @@ -16,187 +16,21 @@ PHP library for [two-factor (or multi-factor) authentication](http://en.wikipedi Optionally, you may need: +* [sockets](https://www.php.net/manual/en/book.sockets.php) if you are using `NTPTimeProvider` * [endroid/qr-code](https://github.com/endroid/qr-code) if using `EndroidQrCodeProvider` or `EndroidQrCodeWithLogoProvider`. * [bacon/bacon-qr-code](https://github.com/Bacon/BaconQrCode) if using `BaconQrCodeProvider`. ## Installation -Run the following command: +The best way of installing this library is with composer: `php composer.phar require robthree/twofactorauth` -## Quick start - -If you want to hit the ground running then have a look at the [demo](demo/demo.php). It's very simple and easy! - ## Usage -Here are some code snippets that should help you get started... +For a quick start, have a look at the [getting started](https://robthree.github.io/TwoFactorAuth/getting-started.html) page or try out the [demo](demo/demo.php). -````php -// Create a TwoFactorAuth instance -$tfa = new RobThree\Auth\TwoFactorAuth('My Company'); -```` - -The TwoFactorAuth class constructor accepts 7 arguments (all optional): - -Argument | Default value | Use -------------------|---------------|-------------------------------------------------- -`$issuer` | `null` | Will be displayed in the app as issuer name -`$digits` | `6` | The number of digits the resulting codes will be -`$period` | `30` | The number of seconds a code will be valid -`$algorithm` | `sha1` | The algorithm used (one of `sha1`, `sha256`, `sha512`, `md5`) -`$qrcodeprovider` | `null` | QR-code provider (more on this later) -`$rngprovider` | `null` | Random Number Generator provider (more on this later) -`$timeprovider` | `null` | Time provider (more on this later) - -These arguments are all '`write once`'; the class will, for it's lifetime, use these values when generating / calculating codes. The number of digits, the period and algorithm are all set to values Google's Authenticator app uses (and supports). You may specify `8` digits, a period of `45` seconds and the `sha256` algorithm but the authenticator app (be it Google's implementation, Authy or any other app) may or may not support these values. Your mileage may vary; keep it on the safe side if you don't control which app your audience uses. - -### Step 1: Set up secret shared key - -When a user wants to setup two-factor auth (or, more correctly, multi-factor auth) you need to create a secret. This will be your **shared secret**. This secret will need to be entered by the user in their app. This can be done manually, in which case you simply display the secret and have the user type it in the app: - -````php -$secret = $tfa->createSecret(); -```` - -The `createSecret()` method accepts two arguments: `$bits` (default: `80`) and `$requirecryptosecure` (default: `true`). The former is the number of bits generated for the shared secret. Make sure this argument is a multiple of 8 and, again, keep in mind that not all combinations may be supported by all apps. Google authenticator seems happy with 80 and 160, the default is set to 80 because that's what most sites (that I know of) currently use; however a value of 160 or higher is recommended (see [RFC 4226 - Algorithm Requirements](https://tools.ietf.org/html/rfc4226#section-4)). The latter is used to ensure that the secret is cryptographically secure; if you don't care very much for cryptographically secure secrets you can specify `false` and use a **non**-cryptographically secure RNG provider. - -````php -// Display shared secret -<p>Please enter the following code in your app: '<?php echo $secret; ?>'</p> -```` - -Another, more user-friendly, way to get the shared secret into the app is to generate a [QR-code](http://en.wikipedia.org/wiki/QR_code) which can be scanned by the app. To generate these QR codes you can use any one of the built-in `QRProvider` classes: - -1. `QRServerProvider` (default) -2. `ImageChartsQRCodeProvider` -3. `QRicketProvider` -4. `EndroidQrCodeProvider` (requires `endroid/qr-code` to be installed) -5. `EndroidQrCodeWithLogoProvider` (same, but supporting embedded images) -6. `BaconQrCodeProvider` (requires `bacon/bacon-qr-code` to be installed) - -...or implement your own provider. To implement your own provider all you need to do is implement the `IQRCodeProvider` interface. You can use the built-in providers mentioned before to serve as an example or read the next chapter in this file. The built-in classes all use a 3rd (e.g. external) party (Image-charts, QRServer and QRicket) for the hard work of generating QR-codes (note: each of these services might at some point not be available or impose limitations to the number of codes generated per day, hour etc.). You could, however, easily use a project like [PHP QR Code](http://phpqrcode.sourceforge.net/) (or one of the [many others](https://packagist.org/search/?q=qr)) to generate your QR-codes without depending on external sources. Later on we'll [demonstrate](#qr-code-providers) how to do this. - -The built-in providers all have some provider-specific 'tweaks' you can 'apply'. Some provide support for different colors, others may let you specify the desired image-format etc. What they all have in common is that they return a QR-code as binary blob which, in turn, will be turned into a [data URI](http://en.wikipedia.org/wiki/Data_URI_scheme) by the `TwoFactorAuth` class. This makes it easy for you to display the image without requiring extra 'roundtrips' from browser to server and vice versa. - -````php -// Display QR code to user -<p>Scan the following image with your app:</p> -<p><img src="<?php echo $tfa->getQRCodeImageAsDataUri('Bob Ross', $secret); ?>"></p> -```` - -When outputting a QR-code you can choose a `$label` for the user (which, when entering a shared secret manually, will have to be chosen by the user). This label may be an empty string or `null`. Also a `$size` may be specified (in pixels, width == height) for which we use a default value of `200`. - -### Step 2: Verify secret shared key - -When the shared secret is added to the app, the app will be ready to start generating codes which 'expire' each '`$period`' number of seconds. To make sure the secret was entered, or scanned, correctly you need to verify this by having the user enter a generated code. To check if the generated code is valid you call the `verifyCode()` method: - -````php -// Verify code -$result = $tfa->verifyCode($_SESSION['secret'], $_POST['verification']); -```` - -If you do extra validations with your `$_POST` values, just make sure the code is still submitted as string - even if that's a numeric code, casting it to integer is unreliable. Also, you may need to store `$secret` in a `$_SESSION` or other persistent storage between requests. `verifyCode()` will return either `true` (the code was valid) or `false` (the code was invalid; no points for you!). - - The `verifyCode()` accepts, aside from `$secret` and `$code`, three more arguments, with the first being `$discrepancy`. Since TOTP codes are based on time("slices") it is very important that the server (but also client) have a correct date/time. But because the two *may* differ a bit we usually allow a certain amount of leeway. Because generated codes are valid for a specific period (remember the `$period` argument in the `TwoFactorAuth`'s constructor?) we usually check the period directly before and the period directly after the current time when validating codes. So when the current time is `14:34:21`, which results in a 'current timeslice' of `14:34:00` to `14:34:30` we also calculate/verify the codes for `14:33:30` to `14:34:00` and for `14:34:30` to `14:35:00`. This gives us a 'window' of `14:33:30` to `14:35:00`. The `$discrepancy` argument specifies how many periods (or: timeslices) we check in either direction of the current time. The default `$discrepancy` of `1` results in (max.) 3 period checks: -1, current and +1 period. A `$discrepancy` of `4` would result in a larger window (or: bigger time difference between client and server) of -4, -3, -2, -1, current, +1, +2, +3 and +4 periods. - -The second, `$time`, allows you to check a code for a specific point in time. This argument has no real practical use but can be handy for unittesting etc. The default value, `null`, means: use the current time. - -The third, `$timeslice`, is an out-argument; the value returned in `$timeslice` is the value of the timeslice that matched the code (if any). This value will be 0 when the code doesn't match and non-zero when the code matches. This value can be stored with the user and can be used to prevent replay-attacks. All you need to do is, on successful login, make sure `$timeslice` is greater than the previously stored timeslice. - -### Step 3: Store `$secret` with user and we're done! - -Ok, so now the code has been verified and found to be correct. Now we can store the `$secret` with our user in our database (or elsewhere) and whenever the user begins a new session we ask for a code generated by the authentication app of their choice. All we need to do is call `verifyCode()` again with the shared secret and the entered code and we know if the user is legit or not. - -Simple as 1-2-3. - -All we need is 3 methods and a constructor: - -````php -public function __construct( - $issuer = null, - $digits = 6, - $period = 30, - $algorithm = 'sha1', - RobThree\Auth\Providers\Qr\IQRCodeProvider $qrcodeprovider = null, - RobThree\Auth\Providers\Rng\IRNGProvider $rngprovider = null -); -public function createSecret($bits = 80, $requirecryptosecure = true): string; -public function getQRCodeImageAsDataUri($label, $secret, $size = 200): string; -public function verifyCode($secret, $code, $discrepancy = 1, $time = null): bool; -```` - -### QR-code providers - -As mentioned before, this library comes with five 'built-in' QR-code providers. This chapter will touch the subject a bit but most of it should be self-explanatory. The `TwoFactorAuth`-class accepts a `$qrcodeprovider` argument which lets you specify a built-in or custom QR-code provider. All five built-in providers do a simple HTTP request to retrieve an image using cURL and implement the [`IQRCodeProvider`](lib/Providers/Qr/IQRCodeProvider.php) interface which is all you need to implement to write your own QR-code provider. - -The default provider is the [`QRServerProvider`](lib/Providers/Qr/QRServerProvider.php) which uses the [goqr.me API](http://goqr.me/api/doc/create-qr-code/) to render QR-codes. Then we have the [`ImageChartsQRCodeProvider`](lib/Providers/Qr/ImageChartsQRCodeProvider.php) which uses the [image-charts.com replacement for Google Image Charts](https://image-charts.com) to render QR-codes and the [`QRicketProvider`](lib/Providers/Qr/QRicketProvider.php) which uses the [QRickit API](http://qrickit.com/qrickit_apps/qrickit_api.php). These three providers all inherit from a common (abstract) baseclass named [`BaseHTTPQRCodeProvider`](lib/Providers/Qr/BaseHTTPQRCodeProvider.php) because all three share the same functionality: retrieve an image from a 3rd party over HTTP. Finally, we have [`EndroidQrCodeProvider`](lib/Providers/Qr/EndroidQrCodeProvider.php), [`EndroidQrCodeWithLogoProvider`](lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php) and [`BaconQrCodeProvider`](lib/Providers/Qr/BaconQrCodeProvider.php) which require an optional dependency to be installed to use (see Requirements section above), but will generate the QR codes locally. All five classes have constructors that allow you to tweak some settings and most, if not all, arguments should speak for themselves. If you're not sure which values are supported, click the links in this paragraph for documentation on the API's that are utilized by these classes. - -If you don't like any of the built-in classes because you don't want to rely on external resources for example or because you're paranoid about sending the TOTP secret to these 3rd parties (which is useless to them since they miss *at least one* other factor in the [MFA process](http://en.wikipedia.org/wiki/Multi-factor_authentication)), feel tree to implement your own. The `IQRCodeProvider` interface couldn't be any simpler. All you need to do is implement 2 methods: - -````php -getMimeType(); -getQRCodeImage($qrtext, $size); -```` - -The `getMimeType()` method should return the [MIME type](http://en.wikipedia.org/wiki/Internet_media_type) of the image that is returned by our implementation of `getQRCodeImage()`. In this example it's simply `image/png`. The `getQRCodeImage()` method is passed two arguments: `$qrtext` and `$size`. The latter, `$size`, is simply the width/height in pixels of the image desired by the caller. The first, `$qrtext` is the text that should be encoded in the QR-code. An example of such a text would be: - -`otpauth://totp/LABEL:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=ISSUER` - -All you need to do is return the QR-code as binary image data and you're done. All parts of the `$qrtext` have been escaped for you (but note: you *may* need to escape the entire `$qrtext` just once more when passing the data to another server as GET-argument). - -Let's see if we can use [PHP QR Code](http://phpqrcode.sourceforge.net/) to implement our own, custom, no-3rd-parties-allowed-here, provider. We start with downloading the [required (single) file](https://github.com/t0k4rt/phpqrcode/blob/master/phpqrcode.php) and putting it in the directory where `TwoFactorAuth.php` is located as well. Now let's implement the provider: create another file named `myprovider.php` in the `Providers\Qr` directory and paste in this content: - -````php -<?php -require_once '../../phpqrcode.php'; // Yeah, we're gonna need that - -namespace RobThree\Auth\Providers\Qr; - -class MyProvider implements IQRCodeProvider { - public function getMimeType() { - return 'image/png'; // This provider only returns PNG's - } - - public function getQRCodeImage($qrtext, $size) { - ob_start(); // 'Catch' QRCode's output - QRCode::png($qrtext, null, QR_ECLEVEL_L, 3, 4); // We ignore $size and set it to 3 - // since phpqrcode doesn't support - // a size in pixels... - $result = ob_get_contents(); // 'Catch' QRCode's output - ob_end_clean(); // Cleanup - return $result; // Return image - } -} -```` - -That's it. We're done! We've implemented our own provider (with help of PHP QR Code). No more external dependencies, no more unnecessary latencies. Now let's *use* our provider: - -````php -<?php -$mp = new RobThree\Auth\Providers\Qr\MyProvider(); -$tfa = new RobThree\Auth\TwoFactorAuth('My Company', 6, 30, 'sha1', $mp); -$secret = $tfa->createSecret(); -?> -<p><img src="<?php echo $tfa->getQRCodeImageAsDataUri('Bob Ross', $secret); ?>"></p> -```` - -Voilà. Couldn't make it any simpler. - -### RNG providers - -This library also comes with three 'built-in' RNG providers ([Random Number Generator](https://en.wikipedia.org/wiki/Random_number_generation)). The RNG provider generates a number of random bytes and returns these bytes as a string. These values are then used to create the secret. By default (no RNG provider specified) TwoFactorAuth will try to determine the best available RNG provider to use. It will, by default, try to use the [`CSRNGProvider`](lib/Providers/Rng/CSRNGProvider.php) for PHP7+ or the [`MCryptRNGProvider`](lib/Providers/Rng/MCryptRNGProvider.php); if this is not available/supported for any reason it will try to use the [`OpenSSLRNGProvider`](lib/Providers/Rng/OpenSSLRNGProvider.php) and if that is also not available/supported it will try to use the final RNG provider: [`HashRNGProvider`](lib/Providers/Rng/HashRNGProvider.php). Each of these providers use their own method of generating a random sequence of bytes. The first three (`CSRNGProvider`, `OpenSSLRNGProvider` and `MCryptRNGProvider`) return a [cryptographically secure](https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator) sequence of random bytes whereas the `HashRNGProvider` returns a **non-cryptographically secure** sequence. - -You can easily implement your own `RNGProvider` by simply implementing the `IRNGProvider` interface. Each of the 'built-in' RNG providers have some constructor arguments that allow you to 'tweak' some of the settings to use when creating the random bytes such as which source to use (`MCryptRNGProvider`) or which hashing algorithm (`HashRNGProvider`). I encourage you to have a look at some of the ['built-in' RNG providers](lib/Providers/Rng) for details and the [`IRNGProvider` interface](lib/Providers/Rng/IRNGProvider.php). - -### Time providers - -Another set of providers in this library are the Time Providers; this library provides three 'built-in' ones. The default Time Provider used is the [`LocalMachineTimeProvider`](lib/Providers/Time/LocalMachineTimeProvider.php); this provider simply returns the output of `Time()` and is *highly recommended* as default provider. The [`HttpTimeProvider`](lib/Providers/Time/HttpTimeProvider.php) executes a `HEAD` request against a given webserver (default: google.com) and tries to extract the `Date:`-HTTP header and returns it's date. Other url's/domains can be used by specifying the url in the constructor. The final Time Provider is the [`NTPTimeProvider`](lib/Providers/Time/NTPTimeProvider.php) which does an NTP request to a specified NTP server. - -You can easily implement your own `TimeProvider` by simply implementing the `ITimeProvider` interface. - -As to *why* these Time Providers are implemented: it allows the TwoFactorAuth library to ensure the hosts time is correct (or rather: within a margin). You can use the `ensureCorrectTime()` method to ensure the hosts time is correct. By default this method will compare the hosts time (returned by calling `time()` on the `LocalMachineTimeProvider`) to the default `NTPTimeProvider` and `HttpTimeProvider`. You can pass an array of `ITimeProvider`s to change this and specify the `leniency` (second argument) allowed (default: 5 seconds). The method will throw when the TwoFactorAuth's timeprovider (which can be any `ITimeProvider`, see constructor) differs more than the given amount of seconds from any of the given `ITimeProviders`. We advise to call this method sparingly when relying on 3rd parties (which both the `HttpTimeProvider` and `NTPTimeProvider` do) or, if you need to ensure time is correct on a (very) regular basis to implement an `ITimeProvider` that is more efficient than the 'built-in' ones (like use a GPS signal). The `ensureCorrectTime()` method is mostly to be used to make sure the server is configured correctly. +If you need more in-depth information about the configuration available then you can read through the rest of [documentation](https://robthree.github.io/TwoFactorAuth). ## Integrations diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/composer.json b/data/web/inc/lib/vendor/robthree/twofactorauth/composer.json index 847b2f8e..b32e3bc4 100644 --- a/data/web/inc/lib/vendor/robthree/twofactorauth/composer.json +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/composer.json @@ -1,7 +1,7 @@ { "name": "robthree/twofactorauth", "description": "Two Factor Authentication", - "version": "1.8.0", + "version": "1.8.1", "type": "library", "keywords": [ "Authentication", "Two Factor Authentication", "Multi Factor Authentication", "TFA", "MFA", "PHP", "Authenticator", "Authy" ], "homepage": "https://github.com/RobThree/TwoFactorAuth", diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/demo/demo.php b/data/web/inc/lib/vendor/robthree/twofactorauth/demo/demo.php index 996dd928..91393819 100644 --- a/data/web/inc/lib/vendor/robthree/twofactorauth/demo/demo.php +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/demo/demo.php @@ -6,30 +6,46 @@ <body> <ol> <?php - require_once 'loader.php'; - Loader::register('../lib','RobThree\\Auth'); + // in practice you would require the composer loader if it was not already part of your framework or project + spl_autoload_register(function ($className) { + include_once str_replace(array('RobThree\\Auth', '\\'), array(__DIR__.'/../lib', '/'), $className) . '.php'; + }); - use \RobThree\Auth\TwoFactorAuth; - - $tfa = new TwoFactorAuth('MyApp'); - - echo '<li>First create a secret and associate it with a user'; - $secret = $tfa->createSecret(160); // Though the default is an 80 bits secret (for backwards compatibility reasons) we recommend creating 160+ bits secrets (see RFC 4226 - Algorithm Requirements) - echo '<li>Next create a QR code and let the user scan it:<br><img src="' . $tfa->getQRCodeImageAsDataUri('My label', $secret) . '"><br>...or display the secret to the user for manual entry: ' . chunk_split($secret, 4, ' '); - $code = $tfa->getCode($secret); - echo '<li>Next, have the user verify the code; at this time the code displayed by a 2FA-app would be: <span style="color:#00c">' . $code . '</span> (but that changes periodically)'; - echo '<li>When the code checks out, 2FA can be / is enabled; store (encrypted?) secret with user and have the user verify a code each time a new session is started.'; - echo '<li>When aforementioned code (' . $code . ') was entered, the result would be: ' . (($tfa->verifyCode($secret, $code) === true) ? '<span style="color:#0c0">OK</span>' : '<span style="color:#c00">FAIL</span>'); + // substitute your company or app name here + $tfa = new RobThree\Auth\TwoFactorAuth('RobThree TwoFactorAuth'); ?> + <li>First create a secret and associate it with a user</li> + <?php + $secret = $tfa->createSecret(); + ?> + <li> + Next create a QR code and let the user scan it:<br> + <img src="<?php echo $tfa->getQRCodeImageAsDataUri('Demo', $secret); ?>"><br> + ...or display the secret to the user for manual entry: + <?php echo chunk_split($secret, 4, ' '); ?> + </li> + <?php + $code = $tfa->getCode($secret); + ?> + <li>Next, have the user verify the code; at this time the code displayed by a 2FA-app would be: <span style="color:#00c"><?php echo $code; ?></span> (but that changes periodically)</li> + <li>When the code checks out, 2FA can be / is enabled; store (encrypted?) secret with user and have the user verify a code each time a new session is started.</li> + <li> + When aforementioned code (<?php echo $code; ?>) was entered, the result would be: + <?php if ($tfa->verifyCode($secret, $code) === true) { ?> + <span style="color:#0c0">OK</span> + <?php } else { ?> + <span style="color:#c00">FAIL</span> + <?php } ?> + </li> </ol> <p>Note: Make sure your server-time is <a href="http://en.wikipedia.org/wiki/Network_Time_Protocol">NTP-synced</a>! Depending on the $discrepancy allowed your time cannot drift too much from the users' time!</p> <?php - try { - $tfa->ensureCorrectTime(); - echo 'Your hosts time seems to be correct / within margin'; - } catch (RobThree\Auth\TwoFactorAuthException $ex) { - echo '<b>Warning:</b> Your hosts time seems to be off: ' . $ex->getMessage(); - } + try { + $tfa->ensureCorrectTime(); + echo 'Your hosts time seems to be correct / within margin'; + } catch (RobThree\Auth\TwoFactorAuthException $ex) { + echo '<b>Warning:</b> Your hosts time seems to be off: ' . $ex->getMessage(); + } ?> </body> </html> diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/demo/loader.php b/data/web/inc/lib/vendor/robthree/twofactorauth/demo/loader.php deleted file mode 100644 index 208f24d4..00000000 --- a/data/web/inc/lib/vendor/robthree/twofactorauth/demo/loader.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -//http://www.leaseweblabs.com/2014/04/psr-0-psr-4-autoloading-classes-php/ -class Loader -{ - protected static $parentPath = null; - protected static $paths = null; - protected static $files = null; - protected static $nsChar = '\\'; - protected static $initialized = false; - - protected static function initialize() - { - if (static::$initialized) return; - static::$initialized = true; - static::$parentPath = __FILE__; - for ($i=substr_count(get_class(), static::$nsChar);$i>=0;$i--) { - static::$parentPath = dirname(static::$parentPath); - } - static::$paths = array(); - static::$files = array(__FILE__); - } - - public static function register($path,$namespace) { - if (!static::$initialized) static::initialize(); - static::$paths[$namespace] = trim($path,DIRECTORY_SEPARATOR); - } - - public static function load($class) { - if (class_exists($class,false)) return; - if (!static::$initialized) static::initialize(); - - foreach (static::$paths as $namespace => $path) { - if (!$namespace || $namespace.static::$nsChar === substr($class, 0, strlen($namespace.static::$nsChar))) { - - $fileName = substr($class,strlen($namespace.static::$nsChar)-1); - $fileName = str_replace(static::$nsChar, DIRECTORY_SEPARATOR, ltrim($fileName,static::$nsChar)); - $fileName = static::$parentPath.DIRECTORY_SEPARATOR.$path.DIRECTORY_SEPARATOR.$fileName.'.php'; - - if (file_exists($fileName)) { - include $fileName; - return true; - } - } - } - return false; - } -} - -spl_autoload_register(array('Loader', 'load')); \ No newline at end of file diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/_config.yml b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/_config.yml new file mode 100644 index 00000000..35c8b82a --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/_config.yml @@ -0,0 +1,3 @@ +theme: jekyll-theme-minimal + +logo: https://raw.githubusercontent.com/RobThree/TwoFactorAuth/master/multifactorauthforeveryone.png diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/_layouts/post.html b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/_layouts/post.html new file mode 100644 index 00000000..7d4c7d9d --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/_layouts/post.html @@ -0,0 +1,9 @@ +--- +layout: default +--- + +<a href="{{ site.baseurl }}">← contents</a> + +<h1>{{ page.title }}</h1> + +{{ content }} diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/assets/css/style.scss b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/assets/css/style.scss new file mode 100644 index 00000000..9a8d9ff6 --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/assets/css/style.scss @@ -0,0 +1,54 @@ +--- +--- + +@import "{{ site.theme }}"; + +// undo some of the theme to allow code samples to be wider +header { + padding-right: 0; +} +@media print, screen and (min-width: 961px) { + header { + border: 1px solid #e5e5e5; + border-radius: 5px; + margin-bottom: 30px; + margin-right: 30px; + padding-top: 20px; + position: static; + text-align: center; + } + section { + float: none; + width: auto; + } + footer { + float: none; + position: static; + } +} + +// ensure code samples can be really wide +.language-php.highlighter-rouge { + clear: both; +} + +// add missing consistency +header img { + margin-bottom: 20px; +} + +// quick navigation hack needs some spacing +section > a:first-child { + display: block; + margin-bottom:45px; +} + +// 100% width is treated like clear which makes it look bad +table { + width: auto; +} + +// reset document block whatever so the bullets aren't disturbed by the float +ul { + overflow: hidden; +} diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/getting-started.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/getting-started.md new file mode 100644 index 00000000..e25df8b6 --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/getting-started.md @@ -0,0 +1,58 @@ +--- +layout: post +title: Getting Started +--- + +## 1. Installation + +The best way of making use of this project is by installing it with [composer](https://getcomposer.org/doc/01-basic-usage.md). + +``` +php composer.phar require robthree/twofactorauth +``` + +or if you have composer installed globally + +``` +composer require robthree/twofactorauth +``` + +## 2. Create an instance + +Now you can create an instance for use with your code + +```php +use RobThree\Auth\TwoFactorAuth; + +$tfa = new TwoFactorAuth(); +``` + +**Note:** if you are not using a framework that uses composer, you should [include the composer loader yourself](https://getcomposer.org/doc/01-basic-usage.md#autoloading) + +## 3. Shared secrets + +When your user is setting up two-factor, or multi-factor, authentication in your project, you can create a secret from the instance. + +```php +$secret = $tfa->createSecret(); +``` + +Once you have a secret, it can be communicated to the user however you wish. + +```php +<p>Please enter the following code in your app: '<?php echo $secret; ?>'</p> +``` + +**Note:** until you have verified the user is able to use the secret properly, you should store the secret as part of the current session and not save the secret against your user record. + +## 4. Verifying + +Having provided the user with the secret, the best practice is to verify their authenticator app can create the appropriate code. + +```php +$result = $tfa->verifyCode($secret, $_POST['verification']); +``` + +If `$result` is `true` then your user has been able to successfully record the `$secret` in their authenticator app and it has generated an appropriate code. + +You can now save the `$secret` to your user record and use the same `verifyCode` method each time they log in. diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/improved-code-verification.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/improved-code-verification.md new file mode 100644 index 00000000..ae195f48 --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/improved-code-verification.md @@ -0,0 +1,32 @@ +--- +layout: post +title: Improved Code Verification +--- + +When verifying codes that a user has entered, there are other optional arguments which can improve verification of the code. + +```php +$result = $tfa->verifyCode($secret, $_POST['verification'], $discrepancy, $time, &$timeslice); +``` + +## Discrepancy (default 1) + +As the codes that are generated and accepted are consistent within a certain time window (i.e. a timeslice, 30 seconds long by default), it is very important that the server (and the users authenticator app) have the correct time (and date). + +The value of `$discrepancy` is the number of timeslices checked in **both** directions of the current one. So when the current time is `14:34:21`, the 'current timeslice' is `14:34:00` to `14:34:30`. If the default is left unchanged, we also verify the code against the timeslice of `14:33:30` to `14:34:00` and for `14:34:30` to `14:35:00`. + +This should be sufficient for most cases however you can increase it if you wish. It would be unwise for this to be too high as it could allow a code to be valid for long enough that it could be used fraudulently. + +## Time (default null) + +The second, `$time`, allows you to check a code for a specific point in time. This argument has no real practical use but can be handy for unit testing. The default value, `null`, means: use the current time. + +## Timeslice + +`$timeslice` returns a value by reference. The value returned is the timeslice that matched the code (if any) or `0`. + +You can store a timeslice alongside the secret and verify that any new timeslice is greater than the existing one. + +i.e. if `verifyCode` returns true _and_ the returned timeslice is greater than the last used timeslice for this user/secret then this is the first time the code has been used and you should now store the higher timeslice to verify that the user. + +This is an effective defense against a [replay attack](https://en.wikipedia.org/wiki/Replay_attack). diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/index.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/index.md new file mode 100644 index 00000000..a1cddaac --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/index.md @@ -0,0 +1,18 @@ +--- +title: Contents +--- + +## [The Basics - Getting Started](getting-started.html) + +## Advanced Usage + +[QR Codes](qr-codes.html) +- [QRServerProvider](qr-codes/qr-server.html) +- [ImageChartsQRCodeProvider](qr-codes/image-charts.html) +- [QRicketProvider](qr-codes/qrickit.html) +- [EndroidQrCodeProvider](qr-codes/endroid.html) (and EndroidQrCodeWithLogoProvider) +- [BaconQRCodeProvider](qr-codes/bacon.html) + +[Improved Code Verification](improved-code-verification.html) + +[Other Optional Configuration](optional-configuration.html) diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/optional-configuration.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/optional-configuration.md new file mode 100644 index 00000000..c2bc5cdf --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/optional-configuration.md @@ -0,0 +1,56 @@ +--- +layout: post +title: Optional Configuration +--- + +## Instance Configuration + +The instance (`new TwoFactorAuth()`) can only be configured by the constructor with the following optional arguments + +Argument | Default value | Use +------------------|---------------|----- +`$issuer` | `null` | Will be displayed in the users app as the default issuer name when using QR code to import the secret +`$digits` | `6` | The number of digits the resulting codes will be +`$period` | `30` | The number of seconds a code will be valid +`$algorithm` | `'sha1'` | The algorithm used (one of `sha1`, `sha256`, `sha512`, `md5`) +`$qrcodeprovider` | `null` | QR-code provider +`$rngprovider` | `null` | Random Number Generator provider +`$timeprovider` | `null` | Time provider + +**Note:** the default values for `$digits`, `$period`, and `$algorithm` provide the widest variety of support amongst common authenticator apps such as Google Authenticator. If you choose to use different values for these arguments you will likely have to instruct your users to use a specific app which supports your chosen configuration. + +### RNG providers + +This library also comes with some [Random Number Generator (RNG)](https://en.wikipedia.org/wiki/Random_number_generation) providers. The RNG provider generates a number of random bytes and returns these bytes as a string. These values are then used to create the secret. By default (no RNG provider specified) TwoFactorAuth will try to determine the best available RNG provider to use in this order. + +1. [CSRNGProvider](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Rng/CSRNGProvider.php) for PHP7+ +2. [MCryptRNGProvider](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Rng/MCryptRNGProvider.php) where mcrypt is available +3. [OpenSSLRNGProvider](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Rng/OpenSSLRNGProvider.php) where openssl is available +4. [HashRNGProvider](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Rng/HashRNGProvider.php) **non-cryptographically secure** fallback + +Each of these RNG providers have some constructor arguments that allow you to tweak some of the settings to use when creating the random bytes. + +You can also implement your own by implementing the [`IRNGProvider` interface](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Rng/IRNGProvider.php). + +### Time providers + +These allow the TwoFactorAuth library to ensure the servers time is correct (or at least within a margin). + +You can use the `ensureCorrectTime()` method to ensure the hosts time is correct. By default this method will compare the hosts time (returned by calling `time()` on the `LocalMachineTimeProvider`) to the default `NTPTimeProvider` and `HttpTimeProvider`. + +**Note:** the `NTPTimeProvider` requires your PHP to have the ability to create sockets. If you do not have that ability and wish to use this function, you should pass an array with only an instance of `HttpTimeProvider`. + +Alternatively, you can pass an array of classes that implement the [`ITimeProvider` interface](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Time/ITimeProvider.php) to change this and specify the second argument, leniency in seconds (default: 5). An exception will be thrown if the time difference is greater than the leniency. + +Ordinarily, you should not need to monitor that the time on the server is correct in this way however if you choose to, we advise to call this method sparingly when relying on 3rd parties (which both the `HttpTimeProvider` and `NTPTimeProvider` do) or, if you need to ensure time is correct on a (very) regular basis to implement an `ITimeProvider` that is more efficient than the built-in ones (making use of a GPS signal for example). + +## Secret Configuration + +Secrets can be optionally configured with the following optional arguments + +Argument | Default value | Use +-----------------------|---------------|----- +`$bits` | `80` | The number of bits (related to the length of the secret) +`$requirecryptosecure` | `true` | Whether you want to require a cryptographically secure source of random numbers + +**Note:** as above, these values provide the widest variety of support amongst common authenticator apps however you may choose to increase the value of `$bits` (160 or higher is recommended, see [RFC 4226 - Algorithm Requirements](https://tools.ietf.org/html/rfc4226#section-4)) as long as it is set to a multiple of 8. diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes.md new file mode 100644 index 00000000..01e8dadf --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes.md @@ -0,0 +1,61 @@ +--- +layout: post +title: QR Codes +--- + +An alternative way of communicating the secret to the user is through the use of [QR Codes](http://en.wikipedia.org/wiki/QR_code) which most if not all authenticator mobile apps can scan. + +This can avoid accidental typing errors and also pre-set some text values within the users app. + +You can display the QR Code as a base64 encoded image using the instance as follows, supplying the users name or other public identifier as the first argument + +````php +<p>Scan the following image with your app:</p> +<img src="<?php echo $tfa->getQRCodeImageAsDataUri('Bob Ross', $secret); ?>"> +```` + +You can also specify a size as a third argument which is 200 by default. + +**Note:** by default, the QR code returned by the instance is generated from a third party across the internet. If the third party is encountering problems or is not available from where you have hosted your code, your user will likely experience a delay in seeing the QR code, if it even loads at all. This can be overcome with offline providers configured when you create the instance. + +## Online Providers + +[QRServerProvider](qr-codes/qr-server.html) (default) + +[ImageChartsQRCodeProvider](qr-codes/image-charts.html) + +[QRicketProvider](qr-codes/qrickit.html) + +## Offline Providers + +[EndroidQrCodeProvider](qr-codes/endroid.html) and EndroidQrCodeWithLogoProvider + +[BaconQRCodeProvider](qr-codes/bacon.html) + +**Note:** offline providers may have additional PHP requirements in order to function, you should study what is required before trying to make use of them. + +## Custom Provider + +If you wish to make your own QR Code provider to reference another service or library, it must implement the [IQRCodeProvider interface](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Qr/IQRCodeProvider.php). + +It is recommended to use similar constructor arguments as the included providers to avoid big shifts when trying different providers. + +## Using a specific provider + +If you do not want to use the default QR code provider, you can specify the one you want to use when you create your instance. + +```php +use RobThree\Auth\TwoFactorAuth; + +$qrCodeProvider = new YourChosenProvider(); + +$tfa = new TwoFactorAuth( + null, + 6, + 30, + 'sha1', + $qrCodeProvider +); +``` + +As you create a new instance of your provider, you can supply any extra configuration there. diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/bacon.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/bacon.md new file mode 100644 index 00000000..cd41404a --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/bacon.md @@ -0,0 +1,23 @@ +--- +layout: post +title: bacon/bacon-qr-code +--- + +## Installation + +In order to use this provider, you will need to install the library at version 2 (or later) and its dependencies + +``` +composer require bacon/bacon-qr-code ^2.0 +``` + +You will also need the PHP imagick extension **if** you aren't using the SVG format. + +## Optional Configuration + +Argument | Default value +--------------------|--------------- +`$borderWidth` | `4` +`$backgroundColour` | `'#ffffff'` +`$foregroundColour` | `'#000000'` +`$format` | `'png'` diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/endroid.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/endroid.md new file mode 100644 index 00000000..ccd214dc --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/endroid.md @@ -0,0 +1,37 @@ +--- +layout: post +title: endroid/qr-code +--- + +## Installation + +In order to use this provider, you will need to install the library at version 3 and its dependencies + +``` +composer require endroid/qr-code ^3.0 +``` + +You will also need the PHP gd extension installing. + +## Optional Configuration + +Argument | Default value +------------------------|--------------- +`$bgcolor` | `'ffffff'` +`$color` | `'000000'` +`$margin` | `0` +`$errorcorrectionlevel` | `'H'` + +## Logo + +If you make use of `EndroidQrCodeWithLogoProvider` then you have access to the `setLogo` function on the provider so you may add a logo to the centre of your QR code. + +```php +use RobThree\Auth\TwoFactorAuth\Providers\Qr\EndroidQrCodeWithLogoProvider; + +$qrCodeProvider = new EndroidQrCodeWithLogoProvider(); + +$qrCodeProvider->setLogo('/path/to/your/image'); +``` + +You can see how to also set the size of the logo in the [source code](https://github.com/RobThree/TwoFactorAuth/blob/master/lib/Providers/Qr/EndroidQrCodeWithLogoProvider.php). diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/image-charts.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/image-charts.md new file mode 100644 index 00000000..2d669cca --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/image-charts.md @@ -0,0 +1,16 @@ +--- +layout: post +title: Image-Charts +--- + +## Optional Configuration + +Argument | Default value +------------------------|--------------- +`$verifyssl` | `false` +`$errorcorrectionlevel` | `'L'` +`$margin` | `4` + +`$verifyssl` is used internally to help guarantee the security of the connection. It is possible that where you are running the code from will have problems verifying an SSL connection so if you know this is not the case, you can supply `true`. + +The other parameters are passed to [Image-Charts](https://documentation.image-charts.com/qr-codes/) so you can refer to them for more detail on how the values are used. diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/qr-server.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/qr-server.md new file mode 100644 index 00000000..b1ac5468 --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/qr-server.md @@ -0,0 +1,20 @@ +--- +layout: post +title: QR Server +--- + +## Optional Configuration + +Argument | Default value +------------------------|--------------- +`$verifyssl` | `false` +`$errorcorrectionlevel` | `'L'` +`$margin` | `4` +`$qzone` | `1` +`$bgcolor` | `'ffffff'` +`$color` | `'000000'` +`$format` | `'png'` + +`$verifyssl` is used internally to help guarantee the security of the connection. It is possible that where you are running the code from will have problems verifying an SSL connection so if you know this is not the case, you can supply `true`. + +The other parameters are passed to [goqr.me](http://goqr.me/api/doc/create-qr-code/) so you can refer to them for more detail on how the values are used. diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/qrickit.md b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/qrickit.md new file mode 100644 index 00000000..4c022b99 --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/docs/qr-codes/qrickit.md @@ -0,0 +1,15 @@ +--- +layout: post +title: QRickit +--- + +## Optional Configuration + +Argument | Default value +------------------------|--------------- +`$errorcorrectionlevel` | `'L'` +`$bgcolor` | `'ffffff'` +`$color` | `'000000'` +`$format` | `'png'` + +The parameters are passed to [QRickit](http://qrickit.com/qrickit_apps/qrickit_api.php) so you can refer to them for more detail on how the values are used. diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/lib/Providers/Qr/GoogleChartsQrCodeProvider.php b/data/web/inc/lib/vendor/robthree/twofactorauth/lib/Providers/Qr/GoogleChartsQrCodeProvider.php new file mode 100644 index 00000000..1118ea7b --- /dev/null +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/lib/Providers/Qr/GoogleChartsQrCodeProvider.php @@ -0,0 +1,67 @@ +<?php + +namespace RobThree\Auth\Providers\Qr; + +// https://developers.google.com/chart/infographics/docs/qr_codes +class GoogleChartsQrCodeProvider extends BaseHTTPQRCodeProvider +{ + /** @var string */ + public $errorcorrectionlevel; + + /** @var int */ + public $margin; + + /** @var string */ + public $encoding; + + /** + * @param bool $verifyssl + * @param string $errorcorrectionlevel + * @param int $margin + * @param string $encoding + */ + public function __construct($verifyssl = false, $errorcorrectionlevel = 'L', $margin = 4, $encoding = 'UTF-8') + { + if (!is_bool($verifyssl)) { + throw new QRException('VerifySSL must be bool'); + } + + $this->verifyssl = $verifyssl; + + $this->errorcorrectionlevel = $errorcorrectionlevel; + $this->margin = $margin; + $this->encoding = $encoding; + } + + /** + * {@inheritdoc} + */ + public function getMimeType() + { + return 'image/png'; + } + + /** + * {@inheritdoc} + */ + public function getQRCodeImage($qrtext, $size) + { + return $this->getContent($this->getUrl($qrtext, $size)); + } + + /** + * @param string $qrtext the value to encode in the QR code + * @param int|string $size the desired size of the QR code + * + * @return string file contents of the QR code + */ + public function getUrl($qrtext, $size) + { + return 'https://chart.googleapis.com/chart' + . '?chs=' . $size . 'x' . $size + . '&chld=' . urlencode(strtoupper($this->errorcorrectionlevel) . '|' . $this->margin) + . '&cht=' . 'qr' + . '&choe=' . $this->encoding + . '&chl=' . rawurlencode($qrtext); + } +} diff --git a/data/web/inc/lib/vendor/robthree/twofactorauth/tests/TwoFactorAuthTest.php b/data/web/inc/lib/vendor/robthree/twofactorauth/tests/TwoFactorAuthTest.php index ca00df9d..99aeb0b1 100644 --- a/data/web/inc/lib/vendor/robthree/twofactorauth/tests/TwoFactorAuthTest.php +++ b/data/web/inc/lib/vendor/robthree/twofactorauth/tests/TwoFactorAuthTest.php @@ -60,7 +60,7 @@ class TwoFactorAuthTest extends TestCase new \RobThree\Auth\Providers\Time\NTPTimeProvider(), // Uses pool.ntp.org by default //new \RobThree\Auth\Providers\Time\NTPTimeProvider('time.google.com'), // Somehow time.google.com and time.windows.com make travis timeout?? new \RobThree\Auth\Providers\Time\HttpTimeProvider(), // Uses google.com by default - new \RobThree\Auth\Providers\Time\HttpTimeProvider('https://github.com'), + //new \RobThree\Auth\Providers\Time\HttpTimeProvider('https://github.com'), // github.com will periodically report times that are off by more than 5 sec new \RobThree\Auth\Providers\Time\HttpTimeProvider('https://yahoo.com'), )); $this->noAssertionsMade(); diff --git a/data/web/inc/lib/vendor/symfony/deprecation-contracts/.gitignore b/data/web/inc/lib/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8d..00000000 --- a/data/web/inc/lib/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/data/web/inc/lib/vendor/symfony/deprecation-contracts/CHANGELOG.md b/data/web/inc/lib/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e261..00000000 --- a/data/web/inc/lib/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/data/web/inc/lib/vendor/symfony/deprecation-contracts/LICENSE b/data/web/inc/lib/vendor/symfony/deprecation-contracts/LICENSE deleted file mode 100644 index ad85e173..00000000 --- a/data/web/inc/lib/vendor/symfony/deprecation-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020-2021 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/data/web/inc/lib/vendor/symfony/deprecation-contracts/README.md b/data/web/inc/lib/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933a..00000000 --- a/data/web/inc/lib/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/data/web/inc/lib/vendor/symfony/deprecation-contracts/composer.json b/data/web/inc/lib/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index 38848896..00000000 --- a/data/web/inc/lib/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/data/web/inc/lib/vendor/symfony/deprecation-contracts/function.php b/data/web/inc/lib/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index d4371504..00000000 --- a/data/web/inc/lib/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas <p@tchwork.com> - */ - function trigger_deprecation(string $package, string $version, string $message, ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/data/web/inc/lib/vendor/symfony/polyfill-ctype/Ctype.php b/data/web/inc/lib/vendor/symfony/polyfill-ctype/Ctype.php index 58414dc7..ba75a2c9 100644 --- a/data/web/inc/lib/vendor/symfony/polyfill-ctype/Ctype.php +++ b/data/web/inc/lib/vendor/symfony/polyfill-ctype/Ctype.php @@ -25,13 +25,13 @@ final class Ctype * * @see https://php.net/ctype-alnum * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alnum($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); } @@ -41,13 +41,13 @@ final class Ctype * * @see https://php.net/ctype-alpha * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_alpha($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); } @@ -57,13 +57,13 @@ final class Ctype * * @see https://php.net/ctype-cntrl * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_cntrl($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); } @@ -73,13 +73,13 @@ final class Ctype * * @see https://php.net/ctype-digit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_digit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); } @@ -89,13 +89,13 @@ final class Ctype * * @see https://php.net/ctype-graph * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_graph($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); } @@ -105,13 +105,13 @@ final class Ctype * * @see https://php.net/ctype-lower * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_lower($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); } @@ -121,13 +121,13 @@ final class Ctype * * @see https://php.net/ctype-print * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_print($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); } @@ -137,13 +137,13 @@ final class Ctype * * @see https://php.net/ctype-punct * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_punct($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); } @@ -153,13 +153,13 @@ final class Ctype * * @see https://php.net/ctype-space * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_space($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); } @@ -169,13 +169,13 @@ final class Ctype * * @see https://php.net/ctype-upper * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_upper($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); } @@ -185,13 +185,13 @@ final class Ctype * * @see https://php.net/ctype-xdigit * - * @param string|int $text + * @param mixed $text * * @return bool */ public static function ctype_xdigit($text) { - $text = self::convert_int_to_char_for_ctype($text); + $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); } @@ -204,11 +204,12 @@ final class Ctype * (negative values have 256 added in order to allow characters in the Extended ASCII range). * Any other integer is interpreted as a string containing the decimal digits of the integer. * - * @param string|int $int + * @param mixed $int + * @param string $function * * @return mixed */ - private static function convert_int_to_char_for_ctype($int) + private static function convert_int_to_char_for_ctype($int, $function) { if (!\is_int($int)) { return $int; @@ -218,6 +219,10 @@ final class Ctype return (string) $int; } + if (\PHP_VERSION_ID >= 80100) { + @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); + } + if ($int < 0) { $int += 256; } diff --git a/data/web/inc/lib/vendor/symfony/polyfill-ctype/composer.json b/data/web/inc/lib/vendor/symfony/polyfill-ctype/composer.json index f0621a3b..ccb8e570 100644 --- a/data/web/inc/lib/vendor/symfony/polyfill-ctype/composer.json +++ b/data/web/inc/lib/vendor/symfony/polyfill-ctype/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, "files": [ "bootstrap.php" ] diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php index b5990956..b65c54a6 100644 --- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -80,7 +80,7 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -602,6 +602,9 @@ final class Mbstring if (80000 > \PHP_VERSION_ID) { return false; } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); } diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json index 2ed7a743..1fa21ca1 100644 --- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json +++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" ] diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php index 7fb2000e..37937cbf 100644 --- a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -1,5 +1,7 @@ <?php -class UnhandledMatchError extends Error -{ +if (\PHP_VERSION_ID < 80000) { + class UnhandledMatchError extends Error + { + } } diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php index 99843cad..a3a9b88b 100644 --- a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -1,5 +1,7 @@ <?php -class ValueError extends Error -{ +if (\PHP_VERSION_ID < 80000) { + class ValueError extends Error + { + } } diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/data/web/inc/lib/vendor/symfony/translation-contracts/LocaleAwareInterface.php index 922ec1dc..6923b977 100644 --- a/data/web/inc/lib/vendor/symfony/translation-contracts/LocaleAwareInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation-contracts/LocaleAwareInterface.php @@ -16,16 +16,12 @@ interface LocaleAwareInterface /** * Sets the current locale. * - * @param string $locale The locale - * * @throws \InvalidArgumentException If the locale contains invalid characters */ public function setLocale(string $locale); /** * Returns the current locale. - * - * @return string The locale */ - public function getLocale(); + public function getLocale(): string; } diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php index aac9d685..c2c30a91 100644 --- a/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ b/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -30,7 +30,20 @@ use Symfony\Contracts\Translation\TranslatorTrait; */ class TranslatorTest extends TestCase { - public function getTranslator() + private $defaultLocale; + + protected function setUp(): void + { + $this->defaultLocale = \Locale::getDefault(); + \Locale::setDefault('en'); + } + + protected function tearDown(): void + { + \Locale::setDefault($this->defaultLocale); + } + + public function getTranslator(): TranslatorInterface { return new class() implements TranslatorInterface { use TranslatorTrait; @@ -53,7 +66,6 @@ class TranslatorTest extends TestCase public function testTransChoiceWithExplicitLocale($expected, $id, $number) { $translator = $this->getTranslator(); - $translator->setLocale('en'); $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); } @@ -65,17 +77,25 @@ class TranslatorTest extends TestCase */ public function testTransChoiceWithDefaultLocale($expected, $id, $number) { - \Locale::setDefault('en'); - $translator = $this->getTranslator(); $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); } + /** + * @dataProvider getTransChoiceTests + */ + public function testTransChoiceWithEnUsPosix($expected, $id, $number) + { + $translator = $this->getTranslator(); + $translator->setLocale('en_US_POSIX'); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + public function testGetSetLocale() { $translator = $this->getTranslator(); - $translator->setLocale('en'); $this->assertEquals('en', $translator->getLocale()); } @@ -294,14 +314,12 @@ class TranslatorTest extends TestCase * This array should contain all currently known langcodes. * * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. - * - * @return array */ - public function successLangcodes() + public function successLangcodes(): array { return [ ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], - ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM']], + ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']], ['3', ['be', 'bs', 'cs', 'hr']], ['4', ['cy', 'mt', 'sl']], ['6', ['ar']], @@ -316,7 +334,7 @@ class TranslatorTest extends TestCase * * @return array with nplural together with langcodes */ - public function failingLangcodes() + public function failingLangcodes(): array { return [ ['1', ['fa']], @@ -330,11 +348,10 @@ class TranslatorTest extends TestCase /** * We validate only on the plural coverage. Thus the real rules is not tested. * - * @param string $nplural Plural expected - * @param array $matrix Containing langcodes and their plural index values - * @param bool $expectSuccess + * @param string $nplural Plural expected + * @param array $matrix Containing langcodes and their plural index values */ - protected function validateMatrix($nplural, $matrix, $expectSuccess = true) + protected function validateMatrix(string $nplural, array $matrix, bool $expectSuccess = true) { foreach ($matrix as $langCode => $data) { $indexes = array_flip($data); diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorInterface.php b/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorInterface.php index dc9bf7f4..018db07e 100644 --- a/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorInterface.php @@ -13,8 +13,6 @@ namespace Symfony\Contracts\Translation; /** * @author Fabien Potencier <fabien@symfony.com> - * - * @method string getLocale() Returns the default locale */ interface TranslatorInterface { @@ -59,9 +57,12 @@ interface TranslatorInterface * @param string|null $domain The domain for the message or null to use the default * @param string|null $locale The locale or null to use the default * - * @return string The translated string - * * @throws \InvalidArgumentException If the locale contains invalid characters */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null); + public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string; + + /** + * Returns the default locale. + */ + public function getLocale(): string; } diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php b/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php index 789693dd..9c264bd2 100644 --- a/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php +++ b/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php @@ -20,7 +20,7 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException; */ trait TranslatorTrait { - private $locale; + private ?string $locale = null; /** * {@inheritdoc} @@ -32,10 +32,8 @@ trait TranslatorTrait /** * {@inheritdoc} - * - * @return string */ - public function getLocale() + public function getLocale(): string { return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); } @@ -142,7 +140,7 @@ EOF; { $number = abs($number); - switch ('pt_BR' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { + switch ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { case 'af': case 'bn': case 'bg': @@ -151,6 +149,7 @@ EOF; case 'de': case 'el': case 'en': + case 'en_US_POSIX': case 'eo': case 'es': case 'et': diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/composer.json b/data/web/inc/lib/vendor/symfony/translation-contracts/composer.json index 00e27f83..875242f6 100644 --- a/data/web/inc/lib/vendor/symfony/translation-contracts/composer.json +++ b/data/web/inc/lib/vendor/symfony/translation-contracts/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -27,7 +27,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/data/web/inc/lib/vendor/symfony/translation/CHANGELOG.md b/data/web/inc/lib/vendor/symfony/translation/CHANGELOG.md index 3341328a..160b5e69 100644 --- a/data/web/inc/lib/vendor/symfony/translation/CHANGELOG.md +++ b/data/web/inc/lib/vendor/symfony/translation/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +5.4 +--- + + * Add `github` format & autodetection to render errors as annotations when + running the XLIFF linter command in a Github Actions environment. + * Translation providers are not experimental anymore + 5.3 --- diff --git a/data/web/inc/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php b/data/web/inc/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php index 9869fbb8..43a52fab 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php +++ b/data/web/inc/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php @@ -80,10 +80,21 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getDomains() + public function getDomains(): array { if (null === $this->domains) { - $this->domains = array_values(array_unique(array_merge($this->source->getDomains(), $this->target->getDomains()))); + $domains = []; + foreach ([$this->source, $this->target] as $catalogue) { + foreach ($catalogue->getDomains() as $domain) { + $domains[$domain] = $domain; + + if ($catalogue->all($domainIcu = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX)) { + $domains[$domainIcu] = $domainIcu; + } + } + } + + $this->domains = array_values($domains); } return $this->domains; @@ -92,7 +103,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getMessages(string $domain) + public function getMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); @@ -108,7 +119,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getNewMessages(string $domain) + public function getNewMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); @@ -124,7 +135,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getObsoleteMessages(string $domain) + public function getObsoleteMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { throw new InvalidArgumentException(sprintf('Invalid domain: "%s".', $domain)); @@ -140,7 +151,7 @@ abstract class AbstractOperation implements OperationInterface /** * {@inheritdoc} */ - public function getResult() + public function getResult(): MessageCatalogueInterface { foreach ($this->getDomains() as $domain) { if (!isset($this->messages[$domain])) { diff --git a/data/web/inc/lib/vendor/symfony/translation/Catalogue/OperationInterface.php b/data/web/inc/lib/vendor/symfony/translation/Catalogue/OperationInterface.php index 9ffac88d..1fe9534e 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Catalogue/OperationInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/Catalogue/OperationInterface.php @@ -36,36 +36,26 @@ interface OperationInterface { /** * Returns domains affected by operation. - * - * @return array */ - public function getDomains(); + public function getDomains(): array; /** * Returns all valid messages ('all') after operation. - * - * @return array */ - public function getMessages(string $domain); + public function getMessages(string $domain): array; /** * Returns new messages ('new') after operation. - * - * @return array */ - public function getNewMessages(string $domain); + public function getNewMessages(string $domain): array; /** * Returns obsolete messages ('obsolete') after operation. - * - * @return array */ - public function getObsoleteMessages(string $domain); + public function getObsoleteMessages(string $domain): array; /** * Returns resulting catalogue ('result'). - * - * @return MessageCatalogueInterface */ - public function getResult(); + public function getResult(): MessageCatalogueInterface; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php b/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php index 399d9174..682b5752 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php +++ b/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php @@ -49,7 +49,7 @@ class TargetOperation extends AbstractOperation foreach ($this->source->all($domain) as $id => $message) { if ($this->target->has($id, $domain)) { $this->messages[$domain]['all'][$id] = $message; - $d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain; + $d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain; $this->result->add([$id => $message], $d); if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) { $this->result->setMetadata($id, $keyMetadata, $d); diff --git a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPullCommand.php b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPullCommand.php index 0ec02ca7..42513a8a 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPullCommand.php +++ b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPullCommand.php @@ -11,7 +11,10 @@ namespace Symfony\Component\Translation\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -25,22 +28,18 @@ use Symfony\Component\Translation\Writer\TranslationWriterInterface; /** * @author Mathieu Santostefano <msantostefano@protonmail.com> - * - * @experimental in 5.3 */ +#[AsCommand(name: 'translation:pull', description: 'Pull translations from a given provider.')] final class TranslationPullCommand extends Command { use TranslationTrait; - protected static $defaultName = 'translation:pull'; - protected static $defaultDescription = 'Pull translations from a given provider.'; - private $providerCollection; private $writer; private $reader; - private $defaultLocale; - private $transPaths; - private $enabledLocales; + private string $defaultLocale; + private array $transPaths; + private array $enabledLocales; public function __construct(TranslationProviderCollection $providerCollection, TranslationWriterInterface $writer, TranslationReaderInterface $reader, string $defaultLocale, array $transPaths = [], array $enabledLocales = []) { @@ -54,6 +53,36 @@ final class TranslationPullCommand extends Command parent::__construct(); } + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('provider')) { + $suggestions->suggestValues($this->providerCollection->keys()); + + return; + } + + if ($input->mustSuggestOptionValuesFor('domains')) { + $provider = $this->providerCollection->get($input->getArgument('provider')); + + if ($provider && method_exists($provider, 'getDomains')) { + $domains = $provider->getDomains(); + $suggestions->suggestValues($domains); + } + + return; + } + + if ($input->mustSuggestOptionValuesFor('locales')) { + $suggestions->suggestValues($this->enabledLocales); + + return; + } + + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues(['php', 'xlf', 'xlf12', 'xlf20', 'po', 'mo', 'yml', 'yaml', 'ts', 'csv', 'json', 'ini', 'res']); + } + } + /** * {@inheritdoc} */ @@ -81,7 +110,7 @@ You can overwrite existing translations (and remove the missing ones on local si Full example: - <info>php %command.full_name% provider --force --domains=messages,validators --locales=en</> + <info>php %command.full_name% provider --force --domains=messages --domains=validators --locales=en</> This command pulls all translations associated with the <comment>messages</> and <comment>validators</> domains for the <comment>en</> locale. Local translations for the specified domains and locale are deleted if they're not present on the provider and overwritten if it's the case. @@ -119,6 +148,7 @@ EOF $writeOptions = [ 'path' => end($this->transPaths), 'xliff_version' => $xliffVersion, + 'default_locale' => $this->defaultLocale, ]; if (!$domains) { diff --git a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php index b28d3e10..dba21643 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php +++ b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php @@ -11,7 +11,10 @@ namespace Symfony\Component\Translation\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -24,20 +27,16 @@ use Symfony\Component\Translation\TranslatorBag; /** * @author Mathieu Santostefano <msantostefano@protonmail.com> - * - * @experimental in 5.3 */ +#[AsCommand(name: 'translation:push', description: 'Push translations to a given provider.')] final class TranslationPushCommand extends Command { use TranslationTrait; - protected static $defaultName = 'translation:push'; - protected static $defaultDescription = 'Push translations to a given provider.'; - private $providers; private $reader; - private $transPaths; - private $enabledLocales; + private array $transPaths; + private array $enabledLocales; public function __construct(TranslationProviderCollection $providers, TranslationReaderInterface $reader, array $transPaths = [], array $enabledLocales = []) { @@ -49,6 +48,30 @@ final class TranslationPushCommand extends Command parent::__construct(); } + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('provider')) { + $suggestions->suggestValues($this->providers->keys()); + + return; + } + + if ($input->mustSuggestOptionValuesFor('domains')) { + $provider = $this->providers->get($input->getArgument('provider')); + + if ($provider && method_exists($provider, 'getDomains')) { + $domains = $provider->getDomains(); + $suggestions->suggestValues($domains); + } + + return; + } + + if ($input->mustSuggestOptionValuesFor('locales')) { + $suggestions->suggestValues($this->enabledLocales); + } + } + /** * {@inheritdoc} */ @@ -79,7 +102,7 @@ You can delete provider translations which are not present locally by using the Full example: - <info>php %command.full_name% provider --force --delete-missing --domains=messages,validators --locales=en</> + <info>php %command.full_name% provider --force --delete-missing --domains=messages --domains=validators --locales=en</> This command pushes all translations associated with the <comment>messages</> and <comment>validators</> domains for the <comment>en</> locale. Provider translations for the specified domains and locale are deleted if they're not present locally and overwritten if it's the case. diff --git a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationTrait.php b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationTrait.php index 6a2b1ba8..eafaffd3 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationTrait.php +++ b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationTrait.php @@ -32,8 +32,7 @@ trait TranslationTrait if ($domains) { foreach ($domains as $domain) { - $catalogue = $this->filterCatalogue($catalogue, $domain); - $bag->addCatalogue($catalogue); + $bag->addCatalogue($this->filterCatalogue($catalogue, $domain)); } } else { $bag->addCatalogue($catalogue); diff --git a/data/web/inc/lib/vendor/symfony/translation/Command/XliffLintCommand.php b/data/web/inc/lib/vendor/symfony/translation/Command/XliffLintCommand.php index 4117d87c..f062fb79 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Command/XliffLintCommand.php +++ b/data/web/inc/lib/vendor/symfony/translation/Command/XliffLintCommand.php @@ -11,7 +11,11 @@ namespace Symfony\Component\Translation\Command; +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\CI\GithubActionReporter; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Exception\RuntimeException; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -28,23 +32,21 @@ use Symfony\Component\Translation\Util\XliffUtils; * @author Robin Chalas <robin.chalas@gmail.com> * @author Javier Eguiluz <javier.eguiluz@gmail.com> */ +#[AsCommand(name: 'lint:xliff', description: 'Lint an XLIFF file and outputs encountered errors')] class XliffLintCommand extends Command { - protected static $defaultName = 'lint:xliff'; - protected static $defaultDescription = 'Lint an XLIFF file and outputs encountered errors'; - - private $format; - private $displayCorrectFiles; - private $directoryIteratorProvider; - private $isReadableProvider; - private $requireStrictFileNames; + private string $format; + private bool $displayCorrectFiles; + private ?\Closure $directoryIteratorProvider; + private ?\Closure $isReadableProvider; + private bool $requireStrictFileNames; public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true) { parent::__construct($name); - $this->directoryIteratorProvider = $directoryIteratorProvider; - $this->isReadableProvider = $isReadableProvider; + $this->directoryIteratorProvider = null === $directoryIteratorProvider || $directoryIteratorProvider instanceof \Closure ? $directoryIteratorProvider : \Closure::fromCallable($directoryIteratorProvider); + $this->isReadableProvider = null === $isReadableProvider || $isReadableProvider instanceof \Closure ? $isReadableProvider : \Closure::fromCallable($isReadableProvider); $this->requireStrictFileNames = $requireStrictFileNames; } @@ -54,9 +56,8 @@ class XliffLintCommand extends Command protected function configure() { $this - ->setDescription(self::$defaultDescription) ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') + ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') ->setHelp(<<<EOF The <info>%command.name%</info> command lints an XLIFF file and outputs to STDOUT the first encountered syntax error. @@ -79,11 +80,11 @@ EOF ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $filenames = (array) $input->getArgument('filename'); - $this->format = $input->getOption('format'); + $this->format = $input->getOption('format') ?? (GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt'); $this->displayCorrectFiles = $output->isVerbose(); if (['-'] === $filenames) { @@ -160,15 +161,18 @@ EOF return $this->displayTxt($io, $files); case 'json': return $this->displayJson($io, $files); + case 'github': + return $this->displayTxt($io, $files, true); default: throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); } } - private function displayTxt(SymfonyStyle $io, array $filesInfo) + private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false) { $countFiles = \count($filesInfo); $erroredFiles = 0; + $githubReporter = $errorAsGithubAnnotations ? new GithubActionReporter($io) : null; foreach ($filesInfo as $info) { if ($info['valid'] && $this->displayCorrectFiles) { @@ -176,9 +180,15 @@ EOF } elseif (!$info['valid']) { ++$erroredFiles; $io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->listing(array_map(function ($error) { + $io->listing(array_map(function ($error) use ($info, $githubReporter) { // general document errors have a '-1' line number - return -1 === $error['line'] ? $error['message'] : sprintf('Line %d, Column %d: %s', $error['line'], $error['column'], $error['message']); + $line = -1 === $error['line'] ? null : $error['line']; + + if ($githubReporter) { + $githubReporter->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null); + } + + return null === $line ? $error['message'] : sprintf('Line %d, Column %d: %s', $line, $error['column'], $error['message']); }, $info['messages'])); } } @@ -264,4 +274,11 @@ EOF return null; } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues(['txt', 'json', 'github']); + } + } } diff --git a/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php index f8480adb..0f7901d5 100644 --- a/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +++ b/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php @@ -62,34 +62,22 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto $this->data = []; } - /** - * @return array|Data - */ - public function getMessages() + public function getMessages(): array|Data { return $this->data['messages'] ?? []; } - /** - * @return int - */ - public function getCountMissings() + public function getCountMissings(): int { return $this->data[DataCollectorTranslator::MESSAGE_MISSING] ?? 0; } - /** - * @return int - */ - public function getCountFallbacks() + public function getCountFallbacks(): int { return $this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK] ?? 0; } - /** - * @return int - */ - public function getCountDefines() + public function getCountDefines(): int { return $this->data[DataCollectorTranslator::MESSAGE_DEFINED] ?? 0; } @@ -110,7 +98,7 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto /** * {@inheritdoc} */ - public function getName() + public function getName(): string { return 'translation'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/DataCollectorTranslator.php b/data/web/inc/lib/vendor/symfony/translation/DataCollectorTranslator.php index c7d35975..2a08b096 100644 --- a/data/web/inc/lib/vendor/symfony/translation/DataCollectorTranslator.php +++ b/data/web/inc/lib/vendor/symfony/translation/DataCollectorTranslator.php @@ -25,15 +25,11 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter public const MESSAGE_MISSING = 1; public const MESSAGE_EQUALS_FALLBACK = 2; - /** - * @var TranslatorInterface|TranslatorBagInterface - */ private $translator; - - private $messages = []; + private array $messages = []; /** - * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface + * @param TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator */ public function __construct(TranslatorInterface $translator) { @@ -47,7 +43,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * {@inheritdoc} */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->collectMessage($locale, $domain, $id, $trans, $parameters); @@ -66,7 +62,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->translator->getLocale(); } @@ -74,7 +70,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } @@ -92,7 +88,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter * * @return string[] */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { if ($this->translator instanceof WarmableInterface) { return (array) $this->translator->warmUp($cacheDir); @@ -103,10 +99,8 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter /** * Gets the fallback locales. - * - * @return array The fallback locales */ - public function getFallbackLocales() + public function getFallbackLocales(): array { if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { return $this->translator->getFallbackLocales(); @@ -123,10 +117,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter return $this->translator->{$method}(...$args); } - /** - * @return array - */ - public function getCollectedMessages() + public function getCollectedMessages(): array { return $this->messages; } diff --git a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php index 6d78342b..4020a078 100644 --- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php +++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php @@ -20,28 +20,15 @@ use Symfony\Component\DependencyInjection\Reference; */ class TranslationDumperPass implements CompilerPassInterface { - private $writerServiceId; - private $dumperTag; - - public function __construct(string $writerServiceId = 'translation.writer', string $dumperTag = 'translation.dumper') - { - if (1 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->writerServiceId = $writerServiceId; - $this->dumperTag = $dumperTag; - } - public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->writerServiceId)) { + if (!$container->hasDefinition('translation.writer')) { return; } - $definition = $container->getDefinition($this->writerServiceId); + $definition = $container->getDefinition('translation.writer'); - foreach ($container->findTaggedServiceIds($this->dumperTag, true) as $id => $attributes) { + foreach ($container->findTaggedServiceIds('translation.dumper', true) as $id => $attributes) { $definition->addMethodCall('addDumper', [$attributes[0]['alias'], new Reference($id)]); } } diff --git a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php index fab6b20a..ee7c47ae 100644 --- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php +++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php @@ -21,28 +21,15 @@ use Symfony\Component\DependencyInjection\Reference; */ class TranslationExtractorPass implements CompilerPassInterface { - private $extractorServiceId; - private $extractorTag; - - public function __construct(string $extractorServiceId = 'translation.extractor', string $extractorTag = 'translation.extractor') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->extractorServiceId = $extractorServiceId; - $this->extractorTag = $extractorTag; - } - public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->extractorServiceId)) { + if (!$container->hasDefinition('translation.extractor')) { return; } - $definition = $container->getDefinition($this->extractorServiceId); + $definition = $container->getDefinition('translation.extractor'); - foreach ($container->findTaggedServiceIds($this->extractorTag, true) as $id => $attributes) { + foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) { if (!isset($attributes[0]['alias'])) { throw new RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id)); } diff --git a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php index c6a1306e..be79cdaf 100644 --- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php +++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php @@ -18,34 +18,15 @@ use Symfony\Component\DependencyInjection\Reference; class TranslatorPass implements CompilerPassInterface { - private $translatorServiceId; - private $readerServiceId; - private $loaderTag; - private $debugCommandServiceId; - private $updateCommandServiceId; - - public function __construct(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->translatorServiceId = $translatorServiceId; - $this->readerServiceId = $readerServiceId; - $this->loaderTag = $loaderTag; - $this->debugCommandServiceId = $debugCommandServiceId; - $this->updateCommandServiceId = $updateCommandServiceId; - } - public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->translatorServiceId)) { + if (!$container->hasDefinition('translator.default')) { return; } $loaders = []; $loaderRefs = []; - foreach ($container->findTaggedServiceIds($this->loaderTag, true) as $id => $attributes) { + foreach ($container->findTaggedServiceIds('translation.loader', true) as $id => $attributes) { $loaderRefs[$id] = new Reference($id); $loaders[$id][] = $attributes[0]['alias']; if (isset($attributes[0]['legacy-alias'])) { @@ -53,8 +34,8 @@ class TranslatorPass implements CompilerPassInterface } } - if ($container->hasDefinition($this->readerServiceId)) { - $definition = $container->getDefinition($this->readerServiceId); + if ($container->hasDefinition('translation.reader')) { + $definition = $container->getDefinition('translation.reader'); foreach ($loaders as $id => $formats) { foreach ($formats as $format) { $definition->addMethodCall('addLoader', [$format, $loaderRefs[$id]]); @@ -63,7 +44,7 @@ class TranslatorPass implements CompilerPassInterface } $container - ->findDefinition($this->translatorServiceId) + ->findDefinition('translator.default') ->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs)) ->replaceArgument(3, $loaders) ; @@ -73,16 +54,16 @@ class TranslatorPass implements CompilerPassInterface } $paths = array_keys($container->getDefinition('twig.template_iterator')->getArgument(1)); - if ($container->hasDefinition($this->debugCommandServiceId)) { - $definition = $container->getDefinition($this->debugCommandServiceId); + if ($container->hasDefinition('console.command.translation_debug')) { + $definition = $container->getDefinition('console.command.translation_debug'); $definition->replaceArgument(4, $container->getParameter('twig.default_path')); if (\count($definition->getArguments()) > 6) { $definition->replaceArgument(6, $paths); } } - if ($container->hasDefinition($this->updateCommandServiceId)) { - $definition = $container->getDefinition($this->updateCommandServiceId); + if ($container->hasDefinition('console.command.translation_extract')) { + $definition = $container->getDefinition('console.command.translation_extract'); $definition->replaceArgument(5, $container->getParameter('twig.default_path')); if (\count($definition->getArguments()) > 7) { diff --git a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php index 85b0fa48..b85c0662 100644 --- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php +++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php @@ -22,30 +22,26 @@ use Symfony\Component\DependencyInjection\ServiceLocator; */ class TranslatorPathsPass extends AbstractRecursivePass { - private $translatorServiceId; - private $debugCommandServiceId; - private $updateCommandServiceId; - private $resolverServiceId; - private $level = 0; - private $paths = []; - private $definitions = []; - private $controllers = []; + private int $level = 0; - public function __construct(string $translatorServiceId = 'translator', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update', string $resolverServiceId = 'argument_resolver.service') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } + /** + * @var array<string, bool> + */ + private array $paths = []; - $this->translatorServiceId = $translatorServiceId; - $this->debugCommandServiceId = $debugCommandServiceId; - $this->updateCommandServiceId = $updateCommandServiceId; - $this->resolverServiceId = $resolverServiceId; - } + /** + * @var array<int, Definition> + */ + private array $definitions = []; + + /** + * @var array<string, array<string, bool>> + */ + private array $controllers = []; public function process(ContainerBuilder $container) { - if (!$container->hasDefinition($this->translatorServiceId)) { + if (!$container->hasDefinition('translator')) { return; } @@ -70,12 +66,12 @@ class TranslatorPathsPass extends AbstractRecursivePass } } if ($paths) { - if ($container->hasDefinition($this->debugCommandServiceId)) { - $definition = $container->getDefinition($this->debugCommandServiceId); + if ($container->hasDefinition('console.command.translation_debug')) { + $definition = $container->getDefinition('console.command.translation_debug'); $definition->replaceArgument(6, array_merge($definition->getArgument(6), $paths)); } - if ($container->hasDefinition($this->updateCommandServiceId)) { - $definition = $container->getDefinition($this->updateCommandServiceId); + if ($container->hasDefinition('console.command.translation_extract')) { + $definition = $container->getDefinition('console.command.translation_extract'); $definition->replaceArgument(7, array_merge($definition->getArgument(7), $paths)); } } @@ -86,10 +82,10 @@ class TranslatorPathsPass extends AbstractRecursivePass } } - protected function processValue($value, bool $isRoot = false) + protected function processValue(mixed $value, bool $isRoot = false): mixed { if ($value instanceof Reference) { - if ((string) $value === $this->translatorServiceId) { + if ('translator' === (string) $value) { for ($i = $this->level - 1; $i >= 0; --$i) { $class = $this->definitions[$i]->getClass(); @@ -124,8 +120,8 @@ class TranslatorPathsPass extends AbstractRecursivePass private function findControllerArguments(ContainerBuilder $container): array { - if ($container->hasDefinition($this->resolverServiceId)) { - $argument = $container->getDefinition($this->resolverServiceId)->getArgument(0); + if ($container->hasDefinition('argument_resolver.service')) { + $argument = $container->getDefinition('argument_resolver.service')->getArgument(0); if ($argument instanceof Reference) { $argument = $container->getDefinition($argument); } @@ -133,8 +129,8 @@ class TranslatorPathsPass extends AbstractRecursivePass return $argument->getArgument(0); } - if ($container->hasDefinition('debug.'.$this->resolverServiceId)) { - $argument = $container->getDefinition('debug.'.$this->resolverServiceId)->getArgument(0); + if ($container->hasDefinition('debug.'.'argument_resolver.service')) { + $argument = $container->getDefinition('debug.'.'argument_resolver.service')->getArgument(0); if ($argument instanceof Reference) { $argument = $container->getDefinition($argument); } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php index 0c8589af..0bd3f5e0 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php @@ -20,13 +20,13 @@ use Symfony\Component\Translation\MessageCatalogue; */ class CsvFileDumper extends FileDumper { - private $delimiter = ';'; - private $enclosure = '"'; + private string $delimiter = ';'; + private string $enclosure = '"'; /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $handle = fopen('php://memory', 'r+'); @@ -53,7 +53,7 @@ class CsvFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'csv'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/FileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/FileDumper.php index e257e722..6bad4ff3 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/FileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/FileDumper.php @@ -86,17 +86,13 @@ abstract class FileDumper implements DumperInterface /** * Transforms a domain of a message catalogue to its string representation. - * - * @return string representation */ - abstract public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []); + abstract public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string; /** * Gets the file extension of the dumper. - * - * @return string file extension */ - abstract protected function getExtension(); + abstract protected function getExtension(): string; /** * Gets the relative file path using the template. diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php index cdc59913..b62ea153 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php @@ -28,7 +28,7 @@ class IcuResFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $data = $indexes = $resources = ''; @@ -97,7 +97,7 @@ class IcuResFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'res'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php index 93c900a4..75032be1 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php @@ -23,7 +23,7 @@ class IniFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $output = ''; @@ -38,7 +38,7 @@ class IniFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'ini'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php index 34c0b569..11027303 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php @@ -23,7 +23,7 @@ class JsonFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $flags = $options['json_encoding'] ?? \JSON_PRETTY_PRINT; @@ -33,7 +33,7 @@ class JsonFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'json'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php index 54d0da87..08c8f899 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php @@ -24,7 +24,7 @@ class MoFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $sources = $targets = $sourceOffsets = $targetOffsets = ''; $offsets = []; @@ -70,12 +70,12 @@ class MoFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'mo'; } - private function writeLong($str): string + private function writeLong(mixed $str): string { return pack('V*', $str); } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php index 6163b529..565d8937 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php @@ -23,7 +23,7 @@ class PhpFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { return "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n"; } @@ -31,7 +31,7 @@ class PhpFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'php'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php index 0d822818..313e5045 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php @@ -23,7 +23,7 @@ class PoFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $output = 'msgid ""'."\n"; $output .= 'msgstr ""'."\n"; @@ -114,7 +114,7 @@ EOF; /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'po'; } @@ -124,7 +124,7 @@ EOF; return addcslashes($str, "\0..\37\42\134"); } - private function formatComments($comments, string $prefix = ''): ?string + private function formatComments(string|array $comments, string $prefix = ''): ?string { $output = null; diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php index 406e9f00..819409fc 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php @@ -23,7 +23,7 @@ class QtFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $dom = new \DOMDocument('1.0', 'utf-8'); $dom->formatOutput = true; @@ -54,7 +54,7 @@ class QtFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'ts'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php index f7dbdcdd..b8a109a4 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php @@ -24,7 +24,7 @@ class XliffFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $xliffVersion = '1.2'; if (\array_key_exists('xliff_version', $options)) { @@ -50,7 +50,7 @@ class XliffFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return 'xlf'; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php index 0b21e8c8..d0cfbefa 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php +++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php @@ -23,7 +23,7 @@ use Symfony\Component\Yaml\Yaml; */ class YamlFileDumper extends FileDumper { - private $extension; + private string $extension; public function __construct(string $extension = 'yml') { @@ -33,7 +33,7 @@ class YamlFileDumper extends FileDumper /** * {@inheritdoc} */ - public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { if (!class_exists(Yaml::class)) { throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); @@ -55,7 +55,7 @@ class YamlFileDumper extends FileDumper /** * {@inheritdoc} */ - protected function getExtension() + protected function getExtension(): string { return $this->extension; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php b/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php index 659c6d77..331ff758 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php +++ b/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php @@ -15,18 +15,16 @@ use Symfony\Contracts\HttpClient\ResponseInterface; /** * @author Fabien Potencier <fabien@symfony.com> - * - * @experimental in 5.3 */ class ProviderException extends RuntimeException implements ProviderExceptionInterface { private $response; - private $debug; + private string $debug; public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null) { $this->response = $response; - $this->debug .= $response->getInfo('debug') ?? ''; + $this->debug = $response->getInfo('debug') ?? ''; parent::__construct($message, $code, $previous); } diff --git a/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderExceptionInterface.php b/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderExceptionInterface.php index 8cf1c51c..922e8272 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderExceptionInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderExceptionInterface.php @@ -13,8 +13,6 @@ namespace Symfony\Component\Translation\Exception; /** * @author Fabien Potencier <fabien@symfony.com> - * - * @experimental in 5.3 */ interface ProviderExceptionInterface extends ExceptionInterface { diff --git a/data/web/inc/lib/vendor/symfony/translation/Extractor/AbstractFileExtractor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/AbstractFileExtractor.php index 729dd178..4c088b94 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Extractor/AbstractFileExtractor.php +++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/AbstractFileExtractor.php @@ -20,12 +20,7 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException; */ abstract class AbstractFileExtractor { - /** - * @param string|iterable $resource Files, a file or a directory - * - * @return iterable - */ - protected function extractFiles($resource) + protected function extractFiles(string|iterable $resource): iterable { if (is_iterable($resource)) { $files = []; @@ -49,11 +44,9 @@ abstract class AbstractFileExtractor } /** - * @return bool - * * @throws InvalidArgumentException */ - protected function isFile(string $file) + protected function isFile(string $file): bool { if (!is_file($file)) { throw new InvalidArgumentException(sprintf('The "%s" file does not exist.', $file)); @@ -68,9 +61,7 @@ abstract class AbstractFileExtractor abstract protected function canBeExtracted(string $file); /** - * @param string|array $resource Files, a file or a directory - * - * @return iterable files to be extracted + * @return iterable */ - abstract protected function extractFromDirectory($resource); + abstract protected function extractFromDirectory(string|array $resource); } diff --git a/data/web/inc/lib/vendor/symfony/translation/Extractor/ChainExtractor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/ChainExtractor.php index 95dcf157..e58e82f0 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Extractor/ChainExtractor.php +++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/ChainExtractor.php @@ -25,7 +25,7 @@ class ChainExtractor implements ExtractorInterface * * @var ExtractorInterface[] */ - private $extractors = []; + private array $extractors = []; /** * Adds a loader to the translation extractor. @@ -48,7 +48,7 @@ class ChainExtractor implements ExtractorInterface /** * {@inheritdoc} */ - public function extract($directory, MessageCatalogue $catalogue) + public function extract(string|iterable $directory, MessageCatalogue $catalogue) { foreach ($this->extractors as $extractor) { $extractor->extract($directory, $catalogue); diff --git a/data/web/inc/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php index e1db8a9c..b76a7f20 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php @@ -26,7 +26,7 @@ interface ExtractorInterface * * @param string|iterable<string> $resource Files, a file or a directory */ - public function extract($resource, MessageCatalogue $catalogue); + public function extract(string|iterable $resource, MessageCatalogue $catalogue); /** * Sets the prefix that should be used for new found messages. diff --git a/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php index c5efb5f3..1b86cc59 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php +++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php @@ -27,15 +27,11 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * Prefix for new found message. - * - * @var string */ - private $prefix = ''; + private string $prefix = ''; /** * The sequence that captures translation messages. - * - * @var array */ protected $sequences = [ [ @@ -135,7 +131,7 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * {@inheritdoc} */ - public function extract($resource, MessageCatalogue $catalog) + public function extract(string|iterable $resource, MessageCatalogue $catalog) { $files = $this->extractFiles($resource); foreach ($files as $file) { @@ -155,12 +151,8 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * Normalizes a token. - * - * @param mixed $token - * - * @return string|null */ - protected function normalizeToken($token) + protected function normalizeToken(mixed $token): ?string { if (isset($token[1]) && 'b"' !== $token) { return $token[1]; @@ -315,11 +307,9 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface } /** - * @return bool - * * @throws \InvalidArgumentException */ - protected function canBeExtracted(string $file) + protected function canBeExtracted(string $file): bool { return $this->isFile($file) && 'php' === pathinfo($file, \PATHINFO_EXTENSION); } @@ -327,8 +317,12 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface /** * {@inheritdoc} */ - protected function extractFromDirectory($directory) + protected function extractFromDirectory(string|array $directory): iterable { + if (!class_exists(Finder::class)) { + throw new \LogicException(sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); + } + $finder = new Finder(); return $finder->files()->name('*.php')->in($directory); diff --git a/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php index 1d82caf2..7fbd37c6 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php +++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php @@ -64,10 +64,8 @@ class PhpStringTokenParser * Parses a string token. * * @param string $str String token content - * - * @return string The parsed string */ - public static function parse(string $str) + public static function parse(string $str): string { $bLength = 0; if ('b' === $str[0]) { @@ -90,10 +88,8 @@ class PhpStringTokenParser * * @param string $str String without quotes * @param string|null $quote Quote type - * - * @return string String with escape sequences parsed */ - public static function parseEscapeSequences(string $str, string $quote = null) + public static function parseEscapeSequences(string $str, string $quote = null): string { if (null !== $quote) { $str = str_replace('\\'.$quote, $quote, $str); @@ -124,10 +120,8 @@ class PhpStringTokenParser * * @param string $startToken Doc string start token content (<<<SMTHG) * @param string $str String token content - * - * @return string Parsed string */ - public static function parseDocString(string $startToken, string $str) + public static function parseDocString(string $startToken, string $str): string { // strip last newline (thanks tokenizer for sticking it into the string!) $str = preg_replace('~(\r\n|\n|\r)$~', '', $str); diff --git a/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatter.php b/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatter.php index 04079648..68821b1d 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatter.php +++ b/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatter.php @@ -37,7 +37,7 @@ class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterf /** * {@inheritdoc} */ - public function format(string $message, string $locale, array $parameters = []) + public function format(string $message, string $locale, array $parameters = []): string { if ($this->translator instanceof TranslatorInterface) { return $this->translator->trans($message, $parameters, null, $locale); diff --git a/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatterInterface.php b/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatterInterface.php index b85dbfd1..d5c41c19 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatterInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatterInterface.php @@ -23,8 +23,6 @@ interface MessageFormatterInterface * @param string $message The message (may also be an object that can be cast to string) * @param string $locale The message locale * @param array $parameters An array of parameters for the message - * - * @return string */ - public function format(string $message, string $locale, array $parameters = []); + public function format(string $message, string $locale, array $parameters = []): string; } diff --git a/data/web/inc/lib/vendor/symfony/translation/LICENSE b/data/web/inc/lib/vendor/symfony/translation/LICENSE index 9ff2d0d6..88bf75bb 100644 --- a/data/web/inc/lib/vendor/symfony/translation/LICENSE +++ b/data/web/inc/lib/vendor/symfony/translation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2021 Fabien Potencier +Copyright (c) 2004-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php index 0758da8b..35de9ef5 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php @@ -23,7 +23,7 @@ class ArrayLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { $resource = $this->flatten($resource); $catalogue = new MessageCatalogue($locale); diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php index 8d5d4db9..76b00b15 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php @@ -20,14 +20,14 @@ use Symfony\Component\Translation\Exception\NotFoundResourceException; */ class CsvFileLoader extends FileLoader { - private $delimiter = ';'; - private $enclosure = '"'; - private $escape = '\\'; + private string $delimiter = ';'; + private string $enclosure = '"'; + private string $escape = '\\'; /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $messages = []; diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php index 4725ea6d..e170d761 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php @@ -14,6 +14,7 @@ namespace Symfony\Component\Translation\Loader; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\Translation\Exception\InvalidResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\MessageCatalogue; /** * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> @@ -23,7 +24,7 @@ abstract class FileLoader extends ArrayLoader /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource)) { throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); @@ -55,9 +56,7 @@ abstract class FileLoader extends ArrayLoader } /** - * @return array - * * @throws InvalidResourceException if stream content has an invalid format */ - abstract protected function loadResource(string $resource); + abstract protected function loadResource(string $resource): array; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php index 2a1aecc6..c3ca5fd0 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php @@ -26,7 +26,7 @@ class IcuDatFileLoader extends IcuResFileLoader /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource.'.dat')) { throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php index 64bbd3e1..54c48f81 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -26,7 +26,7 @@ class IcuResFileLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource)) { throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); @@ -72,10 +72,8 @@ class IcuResFileLoader implements LoaderInterface * @param \ResourceBundle $rb The ResourceBundle that will be flattened * @param array $messages Used internally for recursive calls * @param string $path Current path being parsed, used internally for recursive calls - * - * @return array the flattened ResourceBundle */ - protected function flatten(\ResourceBundle $rb, array &$messages = [], string $path = null) + protected function flatten(\ResourceBundle $rb, array &$messages = [], string $path = null): array { foreach ($rb as $key => $value) { $nodePath = $path ? $path.'.'.$key : $key; diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php index 7398f777..04e294d1 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php @@ -21,7 +21,7 @@ class IniFileLoader extends FileLoader /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { return parse_ini_file($resource, true); } diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php index 5aefba07..67a8d58e 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php @@ -23,7 +23,7 @@ class JsonFileLoader extends FileLoader /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $messages = []; if ($data = file_get_contents($resource)) { diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/LoaderInterface.php b/data/web/inc/lib/vendor/symfony/translation/Loader/LoaderInterface.php index 2073f2b2..29d5560d 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/LoaderInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/LoaderInterface.php @@ -25,14 +25,8 @@ interface LoaderInterface /** * Loads a locale. * - * @param mixed $resource A resource - * @param string $locale A locale - * @param string $domain The domain - * - * @return MessageCatalogue A MessageCatalogue instance - * * @throws NotFoundResourceException when the resource cannot be found * @throws InvalidResourceException when the resource cannot be loaded */ - public function load($resource, string $locale, string $domain = 'messages'); + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/MoFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/MoFileLoader.php index 0ff6549d..b0c89138 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/MoFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/MoFileLoader.php @@ -22,13 +22,13 @@ class MoFileLoader extends FileLoader * Magic used for validating the format of an MO file as well as * detecting if the machine used to create that file was little endian. */ - public const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; + public const MO_LITTLE_ENDIAN_MAGIC = 0x950412DE; /** * Magic used for validating the format of an MO file as well as * detecting if the machine used to create that file was big endian. */ - public const MO_BIG_ENDIAN_MAGIC = 0xde120495; + public const MO_BIG_ENDIAN_MAGIC = 0xDE120495; /** * The size of the header of an MO file in bytes. @@ -41,7 +41,7 @@ class MoFileLoader extends FileLoader * * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $stream = fopen($resource, 'r'); diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/PhpFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/PhpFileLoader.php index 85f10902..6bc2a05f 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/PhpFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/PhpFileLoader.php @@ -18,12 +18,12 @@ namespace Symfony\Component\Translation\Loader; */ class PhpFileLoader extends FileLoader { - private static $cache = []; + private static ?array $cache = []; /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) { self::$cache = null; diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/PoFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/PoFileLoader.php index ee143e20..6df16148 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/PoFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/PoFileLoader.php @@ -60,7 +60,7 @@ class PoFileLoader extends FileLoader * * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { $stream = fopen($resource, 'r'); diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php index 9cf2fe97..6d5582d6 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php @@ -28,7 +28,7 @@ class QtFileLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!class_exists(XmlUtils::class)) { throw new RuntimeException('Loading translations from the QT format requires the Symfony Config component.'); diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php index 35ad33ef..670e1997 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -31,7 +31,7 @@ class XliffFileLoader implements LoaderInterface /** * {@inheritdoc} */ - public function load($resource, string $locale, string $domain = 'messages') + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!class_exists(XmlUtils::class)) { throw new RuntimeException('Loading translations from the Xliff format requires the Symfony Config component.'); @@ -57,7 +57,7 @@ class XliffFileLoader implements LoaderInterface } else { $dom = XmlUtils::loadFile($resource); } - } catch (\InvalidArgumentException | XmlParsingException | InvalidXmlException $e) { + } catch (\InvalidArgumentException|XmlParsingException|InvalidXmlException $e) { throw new InvalidResourceException(sprintf('Unable to load "%s": ', $resource).$e->getMessage(), $e->getCode(), $e); } diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php index 8588e186..5eccf99d 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php @@ -29,7 +29,7 @@ class YamlFileLoader extends FileLoader /** * {@inheritdoc} */ - protected function loadResource(string $resource) + protected function loadResource(string $resource): array { if (null === $this->yamlParser) { if (!class_exists(\Symfony\Component\Yaml\Parser::class)) { diff --git a/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php b/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php index bb93435c..8c8441cd 100644 --- a/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php +++ b/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php @@ -21,15 +21,11 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface { - /** - * @var TranslatorInterface|TranslatorBagInterface - */ private $translator; - private $logger; /** - * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface + * @param TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator The translator must implement TranslatorBagInterface */ public function __construct(TranslatorInterface $translator, LoggerInterface $logger) { @@ -44,7 +40,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * {@inheritdoc} */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->log($id, $domain, $locale); @@ -69,7 +65,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->translator->getLocale(); } @@ -77,7 +73,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } @@ -92,10 +88,8 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, /** * Gets the fallback locales. - * - * @return array The fallback locales */ - public function getFallbackLocales() + public function getFallbackLocales(): array { if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { return $this->translator->getFallbackLocales(); diff --git a/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php index ff49b5a9..7aa27efd 100644 --- a/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php +++ b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php @@ -19,12 +19,12 @@ use Symfony\Component\Translation\Exception\LogicException; */ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface { - private $messages = []; - private $metadata = []; - private $resources = []; - private $locale; - private $fallbackCatalogue; - private $parent; + private array $messages = []; + private array $metadata = []; + private array $resources = []; + private string $locale; + private $fallbackCatalogue = null; + private ?self $parent = null; /** * @param array $messages An array of messages classified by domain @@ -38,7 +38,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->locale; } @@ -46,7 +46,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getDomains() + public function getDomains(): array { $domains = []; @@ -63,7 +63,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function all(string $domain = null) + public function all(string $domain = null): array { if (null !== $domain) { // skip messages merge if intl-icu requested explicitly @@ -99,7 +99,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function has(string $id, string $domain = 'messages') + public function has(string $id, string $domain = 'messages'): bool { if (isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { return true; @@ -115,7 +115,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function defines(string $id, string $domain = 'messages') + public function defines(string $id, string $domain = 'messages'): bool { return isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]); } @@ -123,7 +123,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function get(string $id, string $domain = 'messages') + public function get(string $id, string $domain = 'messages'): string { if (isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { return $this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]; @@ -233,7 +233,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getFallbackCatalogue() + public function getFallbackCatalogue(): ?MessageCatalogueInterface { return $this->fallbackCatalogue; } @@ -241,7 +241,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getResources() + public function getResources(): array { return array_values($this->resources); } @@ -257,7 +257,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function getMetadata(string $key = '', string $domain = 'messages') + public function getMetadata(string $key = '', string $domain = 'messages'): mixed { if ('' == $domain) { return $this->metadata; @@ -279,7 +279,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf /** * {@inheritdoc} */ - public function setMetadata(string $key, $value, string $domain = 'messages') + public function setMetadata(string $key, mixed $value, string $domain = 'messages') { $this->metadata[$domain][$key] = $value; } diff --git a/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php index 5d83bd8a..75e3a2fa 100644 --- a/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php @@ -24,17 +24,13 @@ interface MessageCatalogueInterface /** * Gets the catalogue locale. - * - * @return string The locale */ - public function getLocale(); + public function getLocale(): string; /** * Gets the domains. - * - * @return array An array of domains */ - public function getDomains(); + public function getDomains(): array; /** * Gets the messages within a given domain. @@ -42,10 +38,8 @@ interface MessageCatalogueInterface * If $domain is null, it returns all messages. * * @param string $domain The domain name - * - * @return array An array of messages */ - public function all(string $domain = null); + public function all(string $domain = null): array; /** * Sets a message translation. @@ -61,30 +55,24 @@ interface MessageCatalogueInterface * * @param string $id The message id * @param string $domain The domain name - * - * @return bool true if the message has a translation, false otherwise */ - public function has(string $id, string $domain = 'messages'); + public function has(string $id, string $domain = 'messages'): bool; /** * Checks if a message has a translation (it does not take into account the fallback mechanism). * * @param string $id The message id * @param string $domain The domain name - * - * @return bool true if the message has a translation, false otherwise */ - public function defines(string $id, string $domain = 'messages'); + public function defines(string $id, string $domain = 'messages'): bool; /** * Gets a message translation. * * @param string $id The message id * @param string $domain The domain name - * - * @return string The message translation */ - public function get(string $id, string $domain = 'messages'); + public function get(string $id, string $domain = 'messages'): string; /** * Sets translations for a given domain. @@ -119,17 +107,15 @@ interface MessageCatalogueInterface /** * Gets the fallback catalogue. - * - * @return self|null A MessageCatalogueInterface instance or null when no fallback has been set */ - public function getFallbackCatalogue(); + public function getFallbackCatalogue(): ?self; /** * Returns an array of resources loaded to build this collection. * - * @return ResourceInterface[] An array of resources + * @return ResourceInterface[] */ - public function getResources(); + public function getResources(): array; /** * Adds a resource for this collection. diff --git a/data/web/inc/lib/vendor/symfony/translation/MetadataAwareInterface.php b/data/web/inc/lib/vendor/symfony/translation/MetadataAwareInterface.php index 2216eed9..2eaaceb3 100644 --- a/data/web/inc/lib/vendor/symfony/translation/MetadataAwareInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/MetadataAwareInterface.php @@ -27,14 +27,12 @@ interface MetadataAwareInterface * * @return mixed The value that was set or an array with the domains/keys or null */ - public function getMetadata(string $key = '', string $domain = 'messages'); + public function getMetadata(string $key = '', string $domain = 'messages'): mixed; /** * Adds metadata to a message domain. - * - * @param mixed $value */ - public function setMetadata(string $key, $value, string $domain = 'messages'); + public function setMetadata(string $key, mixed $value, string $domain = 'messages'); /** * Deletes metadata for the given key and domain. diff --git a/data/web/inc/lib/vendor/symfony/translation/Provider/Dsn.php b/data/web/inc/lib/vendor/symfony/translation/Provider/Dsn.php index 820cabfb..0f74d17f 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Provider/Dsn.php +++ b/data/web/inc/lib/vendor/symfony/translation/Provider/Dsn.php @@ -20,14 +20,14 @@ use Symfony\Component\Translation\Exception\MissingRequiredOptionException; */ final class Dsn { - private $scheme; - private $host; - private $user; - private $password; - private $port; - private $path; - private $options; - private $originalDsn; + private ?string $scheme; + private ?string $host; + private ?string $user; + private ?string $password; + private ?int $port; + private ?string $path; + private array $options = []; + private string $originalDsn; public function __construct(string $dsn) { @@ -79,7 +79,7 @@ final class Dsn return $this->port ?? $default; } - public function getOption(string $key, $default = null) + public function getOption(string $key, mixed $default = null) { return $this->options[$key] ?? $default; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php b/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php index 0307cdac..a43fedc7 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php +++ b/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php @@ -18,14 +18,12 @@ use Symfony\Component\Translation\TranslatorBagInterface; * Filters domains and locales between the Translator config values and those specific to each provider. * * @author Mathieu Santostefano <msantostefano@protonmail.com> - * - * @experimental in 5.3 */ class FilteringProvider implements ProviderInterface { private $provider; - private $locales; - private $domains; + private array $locales; + private array $domains; public function __construct(ProviderInterface $provider, array $locales, array $domains = []) { diff --git a/data/web/inc/lib/vendor/symfony/translation/Provider/NullProvider.php b/data/web/inc/lib/vendor/symfony/translation/Provider/NullProvider.php index 785fcaa6..f00392ea 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Provider/NullProvider.php +++ b/data/web/inc/lib/vendor/symfony/translation/Provider/NullProvider.php @@ -16,8 +16,6 @@ use Symfony\Component\Translation\TranslatorBagInterface; /** * @author Mathieu Santostefano <msantostefano@protonmail.com> - * - * @experimental in 5.3 */ class NullProvider implements ProviderInterface { diff --git a/data/web/inc/lib/vendor/symfony/translation/Provider/NullProviderFactory.php b/data/web/inc/lib/vendor/symfony/translation/Provider/NullProviderFactory.php index 6ddbd857..f350f160 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Provider/NullProviderFactory.php +++ b/data/web/inc/lib/vendor/symfony/translation/Provider/NullProviderFactory.php @@ -15,8 +15,6 @@ use Symfony\Component\Translation\Exception\UnsupportedSchemeException; /** * @author Mathieu Santostefano <msantostefano@protonmail.com> - * - * @experimental in 5.3 */ final class NullProviderFactory extends AbstractProviderFactory { diff --git a/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php b/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php index 9963cb9f..61ac641c 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php +++ b/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php @@ -15,11 +15,12 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException; /** * @author Mathieu Santostefano <msantostefano@protonmail.com> - * - * @experimental in 5.3 */ final class TranslationProviderCollection { + /** + * @var array<string, ProviderInterface> + */ private $providers; /** @@ -27,10 +28,7 @@ final class TranslationProviderCollection */ public function __construct(iterable $providers) { - $this->providers = []; - foreach ($providers as $name => $provider) { - $this->providers[$name] = $provider; - } + $this->providers = \is_array($providers) ? $providers : iterator_to_array($providers); } public function __toString(): string diff --git a/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php b/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php index 43f4a344..6300c875 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php +++ b/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php @@ -15,16 +15,14 @@ use Symfony\Component\Translation\Exception\UnsupportedSchemeException; /** * @author Mathieu Santostefano <msantostefano@protonmail.com> - * - * @experimental in 5.3 */ class TranslationProviderCollectionFactory { - private $factories; - private $enabledLocales; + private iterable $factories; + private array $enabledLocales; /** - * @param ProviderFactoryInterface[] $factories + * @param iterable<mixed, ProviderFactoryInterface> $factories */ public function __construct(iterable $factories, array $enabledLocales) { diff --git a/data/web/inc/lib/vendor/symfony/translation/PseudoLocalizationTranslator.php b/data/web/inc/lib/vendor/symfony/translation/PseudoLocalizationTranslator.php index 49f122eb..1d10e0cc 100644 --- a/data/web/inc/lib/vendor/symfony/translation/PseudoLocalizationTranslator.php +++ b/data/web/inc/lib/vendor/symfony/translation/PseudoLocalizationTranslator.php @@ -21,11 +21,15 @@ final class PseudoLocalizationTranslator implements TranslatorInterface private const EXPANSION_CHARACTER = '~'; private $translator; - private $accents; - private $expansionFactor; - private $brackets; - private $parseHTML; - private $localizableHTMLAttributes; + private bool $accents; + private float $expansionFactor; + private bool $brackets; + private bool $parseHTML; + + /** + * @var string[] + */ + private array $localizableHTMLAttributes; /** * Available options: @@ -82,7 +86,7 @@ final class PseudoLocalizationTranslator implements TranslatorInterface /** * {@inheritdoc} */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string { $trans = ''; $visibleText = ''; diff --git a/data/web/inc/lib/vendor/symfony/translation/README.md b/data/web/inc/lib/vendor/symfony/translation/README.md index 720bee3b..adda9a5b 100644 --- a/data/web/inc/lib/vendor/symfony/translation/README.md +++ b/data/web/inc/lib/vendor/symfony/translation/README.md @@ -23,6 +23,16 @@ $translator->addResource('array', [ echo $translator->trans('Hello World!'); // outputs « Bonjour ! » ``` +Sponsor +------- + +The Translation component for Symfony 5.4/6.0 is [backed][1] by: + + * [Crowdin][2], a cloud-based localization management software helping teams to go global and stay agile. + * [Lokalise][3], a continuous localization and translation management platform that integrates into your development workflow so you can ship localized products, faster. + +Help Symfony by [sponsoring][4] its development! + Resources --------- @@ -31,3 +41,8 @@ Resources * [Report issues](https://github.com/symfony/symfony/issues) and [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://crowdin.com +[3]: https://lokalise.com +[4]: https://symfony.com/sponsor diff --git a/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReader.php b/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReader.php index 9e51b15b..bbc687e1 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReader.php +++ b/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReader.php @@ -25,9 +25,9 @@ class TranslationReader implements TranslationReaderInterface /** * Loaders used for import. * - * @var array + * @var array<string, LoaderInterface> */ - private $loaders = []; + private array $loaders = []; /** * Adds a loader to the translation extractor. diff --git a/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php b/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php index 4e0723bb..a7691642 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php +++ b/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php @@ -19,13 +19,16 @@ $usageInstructions = <<<END # show the translation status of all locales $ php translation-status.php - # show the translation status of all locales and all their missing translations + # only show the translation status of incomplete or erroneous locales + $ php translation-status.php --incomplete + + # show the translation status of all locales, all their missing translations and mismatches between trans-unit id and source $ php translation-status.php -v # show the status of a single locale $ php translation-status.php fr - # show the status of a single locale and all its missing translations + # show the status of a single locale, missing translations and mismatches between trans-unit id and source $ php translation-status.php fr -v END; @@ -35,6 +38,8 @@ $config = [ 'verbose_output' => false, // NULL = analyze all locales 'locale_to_analyze' => null, + // append --incomplete to only show incomplete languages + 'include_completed_languages' => true, // the reference files all the other translations are compared to 'original_files' => [ 'src/Symfony/Component/Form/Resources/translations/validators.en.xlf', @@ -46,12 +51,17 @@ $config = [ $argc = $_SERVER['argc']; $argv = $_SERVER['argv']; -if ($argc > 3) { +if ($argc > 4) { echo str_replace('translation-status.php', $argv[0], $usageInstructions); exit(1); } foreach (array_slice($argv, 1) as $argumentOrOption) { + if ('--incomplete' === $argumentOrOption) { + $config['include_completed_languages'] = false; + continue; + } + if (str_starts_with($argumentOrOption, '-')) { $config['verbose_output'] = true; } else { @@ -67,6 +77,7 @@ foreach ($config['original_files'] as $originalFilePath) { } $totalMissingTranslations = 0; +$totalTranslationMismatches = 0; foreach ($config['original_files'] as $originalFilePath) { $translationFilePaths = findTranslationFiles($originalFilePath, $config['locale_to_analyze']); @@ -75,11 +86,14 @@ foreach ($config['original_files'] as $originalFilePath) { $totalMissingTranslations += array_sum(array_map(function ($translation) { return count($translation['missingKeys']); }, array_values($translationStatus))); + $totalTranslationMismatches += array_sum(array_map(function ($translation) { + return count($translation['mismatches']); + }, array_values($translationStatus))); - printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output']); + printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output'], $config['include_completed_languages']); } -exit($totalMissingTranslations > 0 ? 1 : 0); +exit($totalTranslationMismatches > 0 ? 1 : 0); function findTranslationFiles($originalFilePath, $localeToAnalyze) { @@ -112,21 +126,29 @@ function calculateTranslationStatus($originalFilePath, $translationFilePaths) foreach ($translationFilePaths as $locale => $translationPath) { $translatedKeys = extractTranslationKeys($translationPath); $missingKeys = array_diff_key($allTranslationKeys, $translatedKeys); + $mismatches = findTransUnitMismatches($allTranslationKeys, $translatedKeys); $translationStatus[$locale] = [ 'total' => count($allTranslationKeys), 'translated' => count($translatedKeys), 'missingKeys' => $missingKeys, + 'mismatches' => $mismatches, ]; + $translationStatus[$locale]['is_completed'] = isTranslationCompleted($translationStatus[$locale]); } return $translationStatus; } -function printTranslationStatus($originalFilePath, $translationStatus, $verboseOutput) +function isTranslationCompleted(array $translationStatus): bool +{ + return $translationStatus['total'] === $translationStatus['translated'] && 0 === count($translationStatus['mismatches']); +} + +function printTranslationStatus($originalFilePath, $translationStatus, $verboseOutput, $includeCompletedLanguages) { printTitle($originalFilePath); - printTable($translationStatus, $verboseOutput); + printTable($translationStatus, $verboseOutput, $includeCompletedLanguages); echo \PHP_EOL.\PHP_EOL; } @@ -152,13 +174,35 @@ function extractTranslationKeys($filePath) return $translationKeys; } +/** + * Check whether the trans-unit id and source match with the base translation. + */ +function findTransUnitMismatches(array $baseTranslationKeys, array $translatedKeys): array +{ + $mismatches = []; + + foreach ($baseTranslationKeys as $translationId => $translationKey) { + if (!isset($translatedKeys[$translationId])) { + continue; + } + if ($translatedKeys[$translationId] !== $translationKey) { + $mismatches[$translationId] = [ + 'found' => $translatedKeys[$translationId], + 'expected' => $translationKey, + ]; + } + } + + return $mismatches; +} + function printTitle($title) { echo $title.\PHP_EOL; echo str_repeat('=', strlen($title)).\PHP_EOL.\PHP_EOL; } -function printTable($translations, $verboseOutput) +function printTable($translations, $verboseOutput, bool $includeCompletedLanguages) { if (0 === count($translations)) { echo 'No translations found'; @@ -168,24 +212,47 @@ function printTable($translations, $verboseOutput) $longestLocaleNameLength = max(array_map('strlen', array_keys($translations))); foreach ($translations as $locale => $translation) { + if (!$includeCompletedLanguages && $translation['is_completed']) { + continue; + } + if ($translation['translated'] > $translation['total']) { textColorRed(); - } elseif ($translation['translated'] === $translation['total']) { + } elseif (count($translation['mismatches']) > 0) { + textColorRed(); + } elseif ($translation['is_completed']) { textColorGreen(); } - echo sprintf('| Locale: %-'.$longestLocaleNameLength.'s | Translated: %d/%d', $locale, $translation['translated'], $translation['total']).\PHP_EOL; + echo sprintf( + '| Locale: %-'.$longestLocaleNameLength.'s | Translated: %2d/%2d | Mismatches: %d |', + $locale, + $translation['translated'], + $translation['total'], + count($translation['mismatches']) + ).\PHP_EOL; textColorNormal(); + $shouldBeClosed = false; if (true === $verboseOutput && count($translation['missingKeys']) > 0) { - echo str_repeat('-', 80).\PHP_EOL; - echo '| Missing Translations:'.\PHP_EOL; + echo '| Missing Translations:'.\PHP_EOL; foreach ($translation['missingKeys'] as $id => $content) { - echo sprintf('| (id=%s) %s', $id, $content).\PHP_EOL; + echo sprintf('| (id=%s) %s', $id, $content).\PHP_EOL; } + $shouldBeClosed = true; + } + if (true === $verboseOutput && count($translation['mismatches']) > 0) { + echo '| Mismatches between trans-unit id and source:'.\PHP_EOL; + foreach ($translation['mismatches'] as $id => $content) { + echo sprintf('| (id=%s) Expected: %s', $id, $content['expected']).\PHP_EOL; + echo sprintf('| Found: %s', $content['found']).\PHP_EOL; + } + $shouldBeClosed = true; + } + if ($shouldBeClosed) { echo str_repeat('-', 80).\PHP_EOL; } } diff --git a/data/web/inc/lib/vendor/symfony/translation/Resources/data/parents.json b/data/web/inc/lib/vendor/symfony/translation/Resources/data/parents.json index a67458a1..288f1630 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Resources/data/parents.json +++ b/data/web/inc/lib/vendor/symfony/translation/Resources/data/parents.json @@ -12,7 +12,6 @@ "en_BS": "en_001", "en_BW": "en_001", "en_BZ": "en_001", - "en_CA": "en_001", "en_CC": "en_001", "en_CH": "en_150", "en_CK": "en_001", @@ -65,7 +64,6 @@ "en_NU": "en_001", "en_NZ": "en_001", "en_PG": "en_001", - "en_PH": "en_001", "en_PK": "en_001", "en_PN": "en_001", "en_PW": "en_001", diff --git a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderFactoryTestCase.php b/data/web/inc/lib/vendor/symfony/translation/Test/ProviderFactoryTestCase.php index 6d5f4b7b..d6510e0d 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderFactoryTestCase.php +++ b/data/web/inc/lib/vendor/symfony/translation/Test/ProviderFactoryTestCase.php @@ -33,7 +33,7 @@ abstract class ProviderFactoryTestCase extends TestCase { protected $client; protected $logger; - protected $defaultLocale; + protected string $defaultLocale; protected $loader; protected $xliffFileDumper; @@ -122,26 +122,26 @@ abstract class ProviderFactoryTestCase extends TestCase protected function getClient(): HttpClientInterface { - return $this->client ?? $this->client = new MockHttpClient(); + return $this->client ??= new MockHttpClient(); } protected function getLogger(): LoggerInterface { - return $this->logger ?? $this->logger = $this->createMock(LoggerInterface::class); + return $this->logger ??= $this->createMock(LoggerInterface::class); } protected function getDefaultLocale(): string { - return $this->defaultLocale ?? $this->defaultLocale = 'en'; + return $this->defaultLocale ??= 'en'; } protected function getLoader(): LoaderInterface { - return $this->loader ?? $this->loader = $this->createMock(LoaderInterface::class); + return $this->loader ??= $this->createMock(LoaderInterface::class); } protected function getXliffFileDumper(): XliffFileDumper { - return $this->xliffFileDumper ?? $this->xliffFileDumper = $this->createMock(XliffFileDumper::class); + return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); } } diff --git a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderTestCase.php b/data/web/inc/lib/vendor/symfony/translation/Test/ProviderTestCase.php index 238fd967..5ae26829 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderTestCase.php +++ b/data/web/inc/lib/vendor/symfony/translation/Test/ProviderTestCase.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Translation\Test; -use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\MockHttpClient; @@ -31,7 +30,7 @@ abstract class ProviderTestCase extends TestCase { protected $client; protected $logger; - protected $defaultLocale; + protected string $defaultLocale; protected $loader; protected $xliffFileDumper; @@ -52,35 +51,26 @@ abstract class ProviderTestCase extends TestCase protected function getClient(): MockHttpClient { - return $this->client ?? $this->client = new MockHttpClient(); + return $this->client ??= new MockHttpClient(); } - /** - * @return LoaderInterface&MockObject - */ protected function getLoader(): LoaderInterface { - return $this->loader ?? $this->loader = $this->createMock(LoaderInterface::class); + return $this->loader ??= $this->createMock(LoaderInterface::class); } - /** - * @return LoaderInterface&MockObject - */ protected function getLogger(): LoggerInterface { - return $this->logger ?? $this->logger = $this->createMock(LoggerInterface::class); + return $this->logger ??= $this->createMock(LoggerInterface::class); } protected function getDefaultLocale(): string { - return $this->defaultLocale ?? $this->defaultLocale = 'en'; + return $this->defaultLocale ??= 'en'; } - /** - * @return LoaderInterface&MockObject - */ protected function getXliffFileDumper(): XliffFileDumper { - return $this->xliffFileDumper ?? $this->xliffFileDumper = $this->createMock(XliffFileDumper::class); + return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); } } diff --git a/data/web/inc/lib/vendor/symfony/translation/TranslatableMessage.php b/data/web/inc/lib/vendor/symfony/translation/TranslatableMessage.php index 82ae6d72..b1a3b6b1 100644 --- a/data/web/inc/lib/vendor/symfony/translation/TranslatableMessage.php +++ b/data/web/inc/lib/vendor/symfony/translation/TranslatableMessage.php @@ -19,9 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class TranslatableMessage implements TranslatableInterface { - private $message; - private $parameters; - private $domain; + private string $message; + private array $parameters; + private ?string $domain; public function __construct(string $message, array $parameters = [], string $domain = null) { @@ -52,6 +52,11 @@ class TranslatableMessage implements TranslatableInterface public function trans(TranslatorInterface $translator, string $locale = null): string { - return $translator->trans($this->getMessage(), $this->getParameters(), $this->getDomain(), $locale); + return $translator->trans($this->getMessage(), array_map( + static function ($parameter) use ($translator, $locale) { + return $parameter instanceof TranslatableInterface ? $parameter->trans($translator, $locale) : $parameter; + }, + $this->getParameters() + ), $this->getDomain(), $locale); } } diff --git a/data/web/inc/lib/vendor/symfony/translation/Translator.php b/data/web/inc/lib/vendor/symfony/translation/Translator.php index 9a639561..05e84d0c 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Translator.php +++ b/data/web/inc/lib/vendor/symfony/translation/Translator.php @@ -37,54 +37,33 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA */ protected $catalogues = []; - /** - * @var string - */ - private $locale; + private string $locale; /** - * @var array + * @var string[] */ - private $fallbackLocales = []; + private array $fallbackLocales = []; /** * @var LoaderInterface[] */ - private $loaders = []; + private array $loaders = []; - /** - * @var array - */ - private $resources = []; + private array $resources = []; - /** - * @var MessageFormatterInterface - */ private $formatter; - /** - * @var string - */ - private $cacheDir; + private ?string $cacheDir; - /** - * @var bool - */ - private $debug; + private bool $debug; - private $cacheVary; + private array $cacheVary; - /** - * @var ConfigCacheFactoryInterface|null - */ private $configCacheFactory; - /** - * @var array|null - */ - private $parentLocales; + private array $parentLocales; - private $hasIntlFormatter; + private bool $hasIntlFormatter; /** * @throws InvalidArgumentException If a locale contains invalid characters @@ -127,7 +106,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function addResource(string $format, $resource, string $locale, string $domain = null) + public function addResource(string $format, mixed $resource, string $locale, string $domain = null) { if (null === $domain) { $domain = 'messages'; @@ -157,7 +136,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * {@inheritdoc} */ - public function getLocale() + public function getLocale(): string { return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); } @@ -165,6 +144,8 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * Sets the fallback locales. * + * @param string[] $locales + * * @throws InvalidArgumentException If a locale contains invalid characters */ public function setFallbackLocales(array $locales) @@ -192,7 +173,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * {@inheritdoc} */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string { if (null === $id || '' === $id) { return ''; @@ -227,7 +208,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { if (!$locale) { $locale = $this->getLocale(); @@ -253,9 +234,9 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * Gets the loaders. * - * @return array LoaderInterface[] + * @return LoaderInterface[] */ - protected function getLoaders() + protected function getLoaders(): array { return $this->loaders; } @@ -407,18 +388,10 @@ EOF protected function computeFallbackLocales(string $locale) { - if (null === $this->parentLocales) { - $this->parentLocales = json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); - } + $this->parentLocales ??= json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); + $originLocale = $locale; $locales = []; - foreach ($this->fallbackLocales as $fallback) { - if ($fallback === $locale) { - continue; - } - - $locales[] = $fallback; - } while ($locale) { $parent = $this->parentLocales[$locale] ?? null; @@ -439,10 +412,18 @@ EOF } if (null !== $locale) { - array_unshift($locales, $locale); + $locales[] = $locale; } } + foreach ($this->fallbackLocales as $fallback) { + if ($fallback === $originLocale) { + continue; + } + + $locales[] = $fallback; + } + return array_unique($locales); } @@ -453,7 +434,7 @@ EOF */ protected function assertValidLocale(string $locale) { - if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', (string) $locale)) { + if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale)); } } @@ -464,9 +445,7 @@ EOF */ private function getConfigCacheFactory(): ConfigCacheFactoryInterface { - if (!$this->configCacheFactory) { - $this->configCacheFactory = new ConfigCacheFactory($this->debug); - } + $this->configCacheFactory ??= new ConfigCacheFactory($this->debug); return $this->configCacheFactory; } diff --git a/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php b/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php index c6555782..ffd109f1 100644 --- a/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php +++ b/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php @@ -17,7 +17,7 @@ use Symfony\Component\Translation\Catalogue\TargetOperation; final class TranslatorBag implements TranslatorBagInterface { /** @var MessageCatalogue[] */ - private $catalogues = []; + private array $catalogues = []; public function addCatalogue(MessageCatalogue $catalogue): void { @@ -38,7 +38,7 @@ final class TranslatorBag implements TranslatorBagInterface /** * {@inheritdoc} */ - public function getCatalogue(string $locale = null) + public function getCatalogue(string $locale = null): MessageCatalogueInterface { if (null === $locale || !isset($this->catalogues[$locale])) { $this->catalogues[$locale] = new MessageCatalogue($locale); diff --git a/data/web/inc/lib/vendor/symfony/translation/TranslatorBagInterface.php b/data/web/inc/lib/vendor/symfony/translation/TranslatorBagInterface.php index 42289773..a787acf1 100644 --- a/data/web/inc/lib/vendor/symfony/translation/TranslatorBagInterface.php +++ b/data/web/inc/lib/vendor/symfony/translation/TranslatorBagInterface.php @@ -14,10 +14,6 @@ namespace Symfony\Component\Translation; use Symfony\Component\Translation\Exception\InvalidArgumentException; /** - * TranslatorBagInterface. - * - * @method MessageCatalogueInterface[] getCatalogues() Returns all catalogues of the instance - * * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> */ interface TranslatorBagInterface @@ -27,9 +23,14 @@ interface TranslatorBagInterface * * @param string|null $locale The locale or null to use the default * - * @return MessageCatalogueInterface - * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function getCatalogue(string $locale = null); + public function getCatalogue(string $locale = null): MessageCatalogueInterface; + + /** + * Returns all catalogues of the instance. + * + * @return MessageCatalogueInterface[] + */ + public function getCatalogues(): array; } diff --git a/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php b/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php index acfbfc36..60b8be6e 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php +++ b/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php @@ -30,10 +30,8 @@ class ArrayConverter * For example this array('foo.bar' => 'value') will be converted to ['foo' => ['bar' => 'value']]. * * @param array $messages Linear messages array - * - * @return array Tree-like messages array */ - public static function expandToTree(array $messages) + public static function expandToTree(array $messages): array { $tree = []; diff --git a/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php b/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php index e4373a7d..85ecc850 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php +++ b/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php @@ -85,11 +85,6 @@ class XliffUtils private static function shouldEnableEntityLoader(): bool { - // Version prior to 8.0 can be enabled without deprecation - if (\PHP_VERSION_ID < 80000) { - return true; - } - static $dom, $schema; if (null === $dom) { $dom = new \DOMDocument(); diff --git a/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriter.php b/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriter.php index 0a349b82..5dd3a5c4 100644 --- a/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriter.php +++ b/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriter.php @@ -23,7 +23,10 @@ use Symfony\Component\Translation\MessageCatalogue; */ class TranslationWriter implements TranslationWriterInterface { - private $dumpers = []; + /** + * @var array<string, DumperInterface> + */ + private array $dumpers = []; /** * Adds a dumper to the writer. @@ -35,10 +38,8 @@ class TranslationWriter implements TranslationWriterInterface /** * Obtains the list of supported formats. - * - * @return array */ - public function getFormats() + public function getFormats(): array { return array_keys($this->dumpers); } diff --git a/data/web/inc/lib/vendor/symfony/translation/composer.json b/data/web/inc/lib/vendor/symfony/translation/composer.json index de84e165..abe8b972 100644 --- a/data/web/inc/lib/vendor/symfony/translation/composer.json +++ b/data/web/inc/lib/vendor/symfony/translation/composer.json @@ -16,33 +16,33 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "require-dev": { - "symfony/config": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/intl": "^4.4|^5.0", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", "psr/log": "^1|^2|^3" }, "conflict": { - "symfony/config": "<4.4", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4", + "symfony/console": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "suggest": { "symfony/config": "", diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md b/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md index f3956e6a..f58ed317 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md +++ b/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +5.4 +--- + + * Add ability to style integer and double values independently + * Add casters for Symfony's UUIDs and ULIDs + * Add support for `Fiber` + 5.2.0 ----- diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php index f8b485bd..a89a71b1 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php @@ -20,7 +20,7 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class ArgsStub extends EnumStub { - private static $parameters = []; + private static array $parameters = []; public function __construct(array $args, string $function, ?string $class) { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php index 612b21f8..53f4461d 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php @@ -41,8 +41,6 @@ class Caster * Casts objects to arrays and adds the dynamic property prefix. * * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not - * - * @return array The array-cast of the object, with prefixed dynamic properties */ public static function castObject(object $obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array { @@ -118,8 +116,6 @@ class Caster * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set * @param int &$count Set to the number of removed properties - * - * @return array The filtered array */ public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php index 48f84835..1ac6d0ac 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php @@ -24,7 +24,7 @@ class ClassStub extends ConstStub * @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name * @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier */ - public function __construct(string $identifier, $callable = null) + public function __construct(string $identifier, callable|array|string $callable = null) { $this->value = $identifier; @@ -87,7 +87,7 @@ class ClassStub extends ConstStub } } - public static function wrapCallable($callable) + public static function wrapCallable(mixed $callable) { if (\is_object($callable) || !\is_callable($callable)) { return $callable; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php index 8b017974..d7d1812b 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php @@ -20,16 +20,13 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class ConstStub extends Stub { - public function __construct(string $name, $value = null) + public function __construct(string $name, string|int|float $value = null) { $this->class = $name; $this->value = 1 < \func_num_args() ? $value : $name; } - /** - * @return string - */ - public function __toString() + public function __toString(): string { return (string) $this->value; } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php index 464c6dbd..b5a96a02 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php @@ -20,7 +20,7 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class CutStub extends Stub { - public function __construct($value) + public function __construct(mixed $value) { $this->value = $value; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php index 1f61c327..99f53849 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php @@ -49,7 +49,7 @@ class DateCaster public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter) { - $now = new \DateTimeImmutable(); + $now = new \DateTimeImmutable('@0', new \DateTimeZone('UTC')); $numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp(); $title = number_format($numberOfSeconds, 0, '.', ' ').'s'; @@ -63,7 +63,8 @@ class DateCaster $format = '%R '; if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) { - $i = date_diff($d = new \DateTime(), date_add(clone $d, $i)); // recalculate carry over points + $d = new \DateTimeImmutable('@0', new \DateTimeZone('UTC')); + $i = $d->diff($d->add($i)); // recalculate carry over points $format .= 0 < $i->days ? '%ad ' : ''; } else { $format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : ''); diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php index a1dcc156..22112af9 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php @@ -18,7 +18,7 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class DsPairStub extends Stub { - public function __construct($key, $value) + public function __construct(string|int $key, mixed $value) { $this->value = [ Caster::PREFIX_VIRTUAL.'key' => $key, diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index baa7a180..8e517e07 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -24,9 +24,9 @@ use Symfony\Component\VarDumper\Exception\ThrowingCasterException; */ class ExceptionCaster { - public static $srcContext = 1; - public static $traceArgs = true; - public static $errorTypes = [ + public static int $srcContext = 1; + public static bool $traceArgs = true; + public static array $errorTypes = [ \E_DEPRECATED => 'E_DEPRECATED', \E_USER_DEPRECATED => 'E_USER_DEPRECATED', \E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', @@ -44,7 +44,7 @@ class ExceptionCaster \E_STRICT => 'E_STRICT', ]; - private static $framesCache = []; + private static array $framesCache = []; public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0) { @@ -214,18 +214,24 @@ class ExceptionCaster if (is_file($f['file']) && 0 <= self::$srcContext) { if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) { - $template = $f['object'] ?? unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class'])); - - $ellipsis = 0; - $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); - $templateInfo = $template->getDebugInfo(); - if (isset($templateInfo[$f['line']])) { - if (!method_exists($template, 'getSourceContext') || !is_file($templatePath = $template->getSourceContext()->getPath())) { - $templatePath = null; - } - if ($templateSrc) { - $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f); - $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']]; + $template = null; + if (isset($f['object'])) { + $template = $f['object']; + } elseif ((new \ReflectionClass($f['class']))->isInstantiable()) { + $template = unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class'])); + } + if (null !== $template) { + $ellipsis = 0; + $templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : ''); + $templateInfo = $template->getDebugInfo(); + if (isset($templateInfo[$f['line']])) { + if (!method_exists($template, 'getSourceContext') || !is_file($templatePath = $template->getSourceContext()->getPath())) { + $templatePath = null; + } + if ($templateSrc) { + $src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f); + $srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']]; + } } } } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FiberCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FiberCaster.php new file mode 100644 index 00000000..c74a9e59 --- /dev/null +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FiberCaster.php @@ -0,0 +1,43 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * Casts Fiber related classes to array representation. + * + * @author Grégoire Pineau <lyrixx@lyrixx.info> + */ +final class FiberCaster +{ + public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0) + { + $prefix = Caster::PREFIX_VIRTUAL; + + if ($fiber->isTerminated()) { + $status = 'terminated'; + } elseif ($fiber->isRunning()) { + $status = 'running'; + } elseif ($fiber->isSuspended()) { + $status = 'suspended'; + } elseif ($fiber->isStarted()) { + $status = 'started'; + } else { + $status = 'not started'; + } + + $a[$prefix.'status'] = $status; + + return $a; + } +} diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php index 7e078033..36e0d3cb 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php @@ -20,8 +20,8 @@ class LinkStub extends ConstStub { public $inVendor = false; - private static $vendorRoots; - private static $composerRoots; + private static array $vendorRoots; + private static array $composerRoots = []; public function __construct(string $label, int $line = 0, string $href = null) { @@ -65,7 +65,7 @@ class LinkStub extends ConstStub private function getComposerRoot(string $file, bool &$inVendor) { - if (null === self::$vendorRoots) { + if (!isset(self::$vendorRoots)) { self::$vendorRoots = []; foreach (get_declared_classes() as $class) { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php index cfef19ac..d6baa251 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php @@ -20,8 +20,8 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class MemcachedCaster { - private static $optionConstants; - private static $defaultOptions; + private static array $optionConstants; + private static array $defaultOptions; public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested) { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MysqliCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MysqliCaster.php new file mode 100644 index 00000000..bfe6f082 --- /dev/null +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MysqliCaster.php @@ -0,0 +1,33 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\VarDumper\Caster; + +use Symfony\Component\VarDumper\Cloner\Stub; + +/** + * @author Nicolas Grekas <p@tchwork.com> + * + * @internal + */ +final class MysqliCaster +{ + public static function castMysqliDriver(\mysqli_driver $c, array $a, Stub $stub, bool $isNested): array + { + foreach ($a as $k => $v) { + if (isset($c->$k)) { + $a[$k] = $c->$k; + } + } + + return $a; + } +} diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php index db4bba8d..80533639 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php @@ -166,7 +166,7 @@ class RdKafkaCaster return $a; } - private static function extractMetadata($c) + private static function extractMetadata(KafkaConsumer|\RdKafka $c) { $prefix = Caster::PREFIX_VIRTUAL; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php index 8f97eaad..eac25a12 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php @@ -102,10 +102,7 @@ class RedisCaster return $a; } - /** - * @param \Redis|\RedisArray|\RedisCluster $redis - */ - private static function getRedisOptions($redis, array $options = []): EnumStub + private static function getRedisOptions(\Redis|\RedisArray|\RedisCluster $redis, array $options = []): EnumStub { $serializer = $redis->getOption(\Redis::OPT_SERIALIZER); if (\is_array($serializer)) { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index 1781f469..86d439f2 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -96,7 +96,7 @@ class ReflectionCaster { $prefix = Caster::PREFIX_VIRTUAL; - if ($c instanceof \ReflectionNamedType || \PHP_VERSION_ID < 80000) { + if ($c instanceof \ReflectionNamedType) { $a += [ $prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c, $prefix.'allowsNull' => $c->allowsNull(), @@ -144,7 +144,7 @@ class ReflectionCaster array_unshift($trace, [ 'function' => 'yield', 'file' => $function->getExecutingFile(), - 'line' => $function->getExecutingLine() - 1, + 'line' => $function->getExecutingLine() - (int) (\PHP_VERSION_ID < 80100), ]); $trace[] = $frame; $a[$prefix.'trace'] = new TraceStub($trace, false, 0, -1, -1); @@ -289,15 +289,17 @@ class ReflectionCaster unset($a[$prefix.'allowsNull']); } - try { - $a[$prefix.'default'] = $v = $c->getDefaultValue(); - if ($c->isDefaultValueConstant()) { - $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v); + if ($c->isOptional()) { + try { + $a[$prefix.'default'] = $v = $c->getDefaultValue(); + if ($c->isDefaultValueConstant()) { + $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v); + } + if (null === $v) { + unset($a[$prefix.'allowsNull']); + } + } catch (\ReflectionException $e) { } - if (null === $v) { - unset($a[$prefix.'allowsNull']); - } - } catch (\ReflectionException $e) { } return $a; @@ -384,6 +386,8 @@ class ReflectionCaster $signature .= 10 > \strlen($v) && !str_contains($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; } elseif (\is_bool($v)) { $signature .= $v ? 'true' : 'false'; + } elseif (\is_object($v)) { + $signature .= 'new '.substr(strrchr('\\'.get_debug_type($v), '\\'), 1); } else { $signature .= $v; } @@ -417,7 +421,7 @@ class ReflectionCaster private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL) { foreach ($map as $k => $m) { - if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) { + if ('isDisabled' === $k) { continue; } @@ -429,10 +433,8 @@ class ReflectionCaster private static function addAttributes(array &$a, \Reflector $c, string $prefix = Caster::PREFIX_VIRTUAL): void { - if (\PHP_VERSION_ID >= 80000) { - foreach ($c->getAttributes() as $n) { - $a[$prefix.'attributes'][] = $n; - } + foreach ($c->getAttributes() as $n) { + $a[$prefix.'attributes'][] = $n; } } } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php index 6ae90852..4e597f86 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php @@ -22,12 +22,7 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class ResourceCaster { - /** - * @param \CurlHandle|resource $h - * - * @return array - */ - public static function castCurl($h, array $a, Stub $stub, bool $isNested) + public static function castCurl(\CurlHandle $h, array $a, Stub $stub, bool $isNested): array { return curl_getinfo($h); } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php index 07f44511..a51cace1 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php @@ -94,32 +94,24 @@ class SplCaster unset($a["\0SplFileInfo\0fileName"]); unset($a["\0SplFileInfo\0pathName"]); - if (\PHP_VERSION_ID < 80000) { - if (false === $c->getPathname()) { - $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; - - return $a; + try { + $c->isReadable(); + } catch (\RuntimeException $e) { + if ('Object not initialized' !== $e->getMessage()) { + throw $e; } - } else { - try { - $c->isReadable(); - } catch (\RuntimeException $e) { - if ('Object not initialized' !== $e->getMessage()) { - throw $e; - } - $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; + $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; - return $a; - } catch (\Error $e) { - if ('Object not initialized' !== $e->getMessage()) { - throw $e; - } - - $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; - - return $a; + return $a; + } catch (\Error $e) { + if ('Object not initialized' !== $e->getMessage()) { + throw $e; } + + $a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state'; + + return $a; } foreach ($map as $key => $accessor) { @@ -219,7 +211,7 @@ class SplCaster return $a; } - private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array + private static function castSplArray(\ArrayObject|\ArrayIterator $c, array $a, Stub $stub, bool $isNested): array { $prefix = Caster::PREFIX_VIRTUAL; $flags = $c->getFlags(); @@ -229,9 +221,6 @@ class SplCaster $a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class); $c->setFlags($flags); } - if (\PHP_VERSION_ID < 70400) { - $a[$prefix.'storage'] = $c->getArrayCopy(); - } $a += [ $prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST), $prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS), diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php index b7e1dd43..08428b92 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php @@ -12,6 +12,8 @@ namespace Symfony\Component\VarDumper\Caster; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Uid\Ulid; +use Symfony\Component\Uid\Uuid; use Symfony\Component\VarDumper\Cloner\Stub; /** @@ -66,4 +68,30 @@ class SymfonyCaster return $a; } + + public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested) + { + $a[Caster::PREFIX_VIRTUAL.'toBase58'] = $uuid->toBase58(); + $a[Caster::PREFIX_VIRTUAL.'toBase32'] = $uuid->toBase32(); + + // symfony/uid >= 5.3 + if (method_exists($uuid, 'getDateTime')) { + $a[Caster::PREFIX_VIRTUAL.'time'] = $uuid->getDateTime()->format('Y-m-d H:i:s.u \U\T\C'); + } + + return $a; + } + + public static function castUlid(Ulid $ulid, array $a, Stub $stub, bool $isNested) + { + $a[Caster::PREFIX_VIRTUAL.'toBase58'] = $ulid->toBase58(); + $a[Caster::PREFIX_VIRTUAL.'toRfc4122'] = $ulid->toRfc4122(); + + // symfony/uid >= 5.3 + if (method_exists($ulid, 'getDateTime')) { + $a[Caster::PREFIX_VIRTUAL.'time'] = $ulid->getDateTime()->format('Y-m-d H:i:s.v \U\T\C'); + } + + return $a; + } } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php index fa0b55dc..721513c5 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php @@ -44,6 +44,22 @@ class XmlReaderCaster public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested) { + try { + $properties = [ + 'LOADDTD' => @$reader->getParserProperty(\XMLReader::LOADDTD), + 'DEFAULTATTRS' => @$reader->getParserProperty(\XMLReader::DEFAULTATTRS), + 'VALIDATE' => @$reader->getParserProperty(\XMLReader::VALIDATE), + 'SUBST_ENTITIES' => @$reader->getParserProperty(\XMLReader::SUBST_ENTITIES), + ]; + } catch (\Error $e) { + $properties = [ + 'LOADDTD' => false, + 'DEFAULTATTRS' => false, + 'VALIDATE' => false, + 'SUBST_ENTITIES' => false, + ]; + } + $props = Caster::PREFIX_VIRTUAL.'parserProperties'; $info = [ 'localName' => $reader->localName, @@ -57,12 +73,7 @@ class XmlReaderCaster 'value' => $reader->value, 'namespaceURI' => $reader->namespaceURI, 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, - $props => [ - 'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD), - 'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS), - 'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE), - 'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES), - ], + $props => $properties, ]; if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index ac55da55..b835c033 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -29,6 +29,8 @@ abstract class AbstractCloner implements ClonerInterface 'Symfony\Component\VarDumper\Caster\ConstStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'], 'Symfony\Component\VarDumper\Caster\EnumStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castEnum'], + 'Fiber' => ['Symfony\Component\VarDumper\Caster\FiberCaster', 'castFiber'], + 'Closure' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClosure'], 'Generator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castGenerator'], 'ReflectionType' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castType'], @@ -81,11 +83,15 @@ abstract class AbstractCloner implements ClonerInterface 'Symfony\Bridge\Monolog\Logger' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], 'Symfony\Component\EventDispatcher\EventDispatcherInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'], + 'Symfony\Component\HttpClient\AmpHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], 'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], 'Symfony\Component\HttpClient\NativeHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'], + 'Symfony\Component\HttpClient\Response\AmpResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], 'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], 'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'], 'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'], + 'Symfony\Component\Uid\Ulid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUlid'], + 'Symfony\Component\Uid\Uuid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUuid'], 'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'], 'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'], 'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'], @@ -147,8 +153,9 @@ abstract class AbstractCloner implements ClonerInterface 'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'], 'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'], + 'mysqli_driver' => ['Symfony\Component\VarDumper\Caster\MysqliCaster', 'castMysqliDriver'], + 'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], - ':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'], ':dba' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'], ':dba persistent' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'], @@ -190,10 +197,18 @@ abstract class AbstractCloner implements ClonerInterface protected $maxString = -1; protected $minDepth = 1; - private $casters = []; + /** + * @var array<string, list<callable>> + */ + private array $casters = []; + + /** + * @var callable|null + */ private $prevErrorHandler; - private $classInfo = []; - private $filter = 0; + + private array $classInfo = []; + private int $filter = 0; /** * @param callable[]|null $casters A map of casters @@ -253,12 +268,9 @@ abstract class AbstractCloner implements ClonerInterface /** * Clones a PHP variable. * - * @param mixed $var Any PHP variable - * @param int $filter A bit field of Caster::EXCLUDE_* constants - * - * @return Data The cloned variable represented by a Data object + * @param int $filter A bit field of Caster::EXCLUDE_* constants */ - public function cloneVar($var, int $filter = 0) + public function cloneVar(mixed $var, int $filter = 0): Data { $this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) { if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) { @@ -290,26 +302,20 @@ abstract class AbstractCloner implements ClonerInterface /** * Effectively clones the PHP variable. - * - * @param mixed $var Any PHP variable - * - * @return array The cloned variable represented in an array */ - abstract protected function doClone($var); + abstract protected function doClone(mixed $var): array; /** * Casts an object to an array representation. * * @param bool $isNested True if the object is nested in the dumped structure - * - * @return array The object casted as array */ - protected function castObject(Stub $stub, bool $isNested) + protected function castObject(Stub $stub, bool $isNested): array { $obj = $stub->value; $class = $stub->class; - if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : str_contains($class, "@anonymous\0")) { + if (str_contains($class, "@anonymous\0")) { $stub->class = get_debug_type($obj); } if (isset($this->classInfo[$class])) { @@ -360,10 +366,8 @@ abstract class AbstractCloner implements ClonerInterface * Casts a resource to an array representation. * * @param bool $isNested True if the object is nested in the dumped structure - * - * @return array The resource casted as array */ - protected function castResource(Stub $stub, bool $isNested) + protected function castResource(Stub $stub, bool $isNested): array { $a = []; $res = $stub->value; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/ClonerInterface.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/ClonerInterface.php index 7ed287a2..5a8e2e4c 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/ClonerInterface.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/ClonerInterface.php @@ -18,10 +18,6 @@ interface ClonerInterface { /** * Clones a PHP variable. - * - * @param mixed $var Any PHP variable - * - * @return Data The cloned variable represented by a Data object */ - public function cloneVar($var); + public function cloneVar(mixed $var): Data; } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php index c8688622..6ecb883e 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php @@ -19,13 +19,13 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider; */ class Data implements \ArrayAccess, \Countable, \IteratorAggregate { - private $data; - private $position = 0; - private $key = 0; - private $maxDepth = 20; - private $maxItemsPerDepth = -1; - private $useRefHandles = -1; - private $context = []; + private array $data; + private int $position = 0; + private int|string $key = 0; + private int $maxDepth = 20; + private int $maxItemsPerDepth = -1; + private int $useRefHandles = -1; + private array $context = []; /** * @param array $data An array as returned by ClonerInterface::cloneVar() @@ -35,10 +35,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate $this->data = $data; } - /** - * @return string|null The type of the value - */ - public function getType() + public function getType(): ?string { $item = $this->data[$this->position][$this->key]; @@ -65,11 +62,13 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate } /** + * Returns a native representation of the original value. + * * @param array|bool $recursive Whether values should be resolved recursively or not * - * @return string|int|float|bool|array|Data[]|null A native representation of the original value + * @return string|int|float|bool|array|Data[]|null */ - public function getValue($recursive = false) + public function getValue(array|bool $recursive = false): string|int|float|bool|array|null { $item = $this->data[$this->position][$this->key]; @@ -108,18 +107,12 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate return $children; } - /** - * @return int - */ - public function count() + public function count(): int { return \count($this->getValue()); } - /** - * @return \Traversable - */ - public function getIterator() + public function getIterator(): \Traversable { if (!\is_array($value = $this->getValue())) { throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, get_debug_type($value))); @@ -139,50 +132,32 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate return null; } - /** - * @return bool - */ - public function __isset(string $key) + public function __isset(string $key): bool { return null !== $this->seek($key); } - /** - * @return bool - */ - public function offsetExists($key) + public function offsetExists(mixed $key): bool { return $this->__isset($key); } - /** - * @return mixed - */ - public function offsetGet($key) + public function offsetGet(mixed $key): mixed { return $this->__get($key); } - /** - * @return void - */ - public function offsetSet($key, $value) + public function offsetSet(mixed $key, mixed $value): void { throw new \BadMethodCallException(self::class.' objects are immutable.'); } - /** - * @return void - */ - public function offsetUnset($key) + public function offsetUnset(mixed $key): void { throw new \BadMethodCallException(self::class.' objects are immutable.'); } - /** - * @return string - */ - public function __toString() + public function __toString(): string { $value = $this->getValue(); @@ -195,26 +170,22 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate /** * Returns a depth limited clone of $this. - * - * @return static */ - public function withMaxDepth(int $maxDepth) + public function withMaxDepth(int $maxDepth): static { $data = clone $this; - $data->maxDepth = (int) $maxDepth; + $data->maxDepth = $maxDepth; return $data; } /** * Limits the number of elements per depth level. - * - * @return static */ - public function withMaxItemsPerDepth(int $maxItemsPerDepth) + public function withMaxItemsPerDepth(int $maxItemsPerDepth): static { $data = clone $this; - $data->maxItemsPerDepth = (int) $maxItemsPerDepth; + $data->maxItemsPerDepth = $maxItemsPerDepth; return $data; } @@ -223,10 +194,8 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate * Enables/disables objects' identifiers tracking. * * @param bool $useRefHandles False to hide global ref. handles - * - * @return static */ - public function withRefHandles(bool $useRefHandles) + public function withRefHandles(bool $useRefHandles): static { $data = clone $this; $data->useRefHandles = $useRefHandles ? -1 : 0; @@ -234,10 +203,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate return $data; } - /** - * @return static - */ - public function withContext(array $context) + public function withContext(array $context): static { $data = clone $this; $data->context = $context; @@ -247,12 +213,8 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate /** * Seeks to a specific key in nested data structures. - * - * @param string|int $key The key to seek to - * - * @return static|null Null if the key is not set */ - public function seek($key) + public function seek(string|int $key): ?static { $item = $this->data[$this->position][$this->key]; @@ -318,7 +280,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate * * @param mixed $item A Stub object or the original value being dumped */ - private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, $item) + private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, mixed $item) { $cursor->refIndex = 0; $cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0; @@ -440,7 +402,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate return $hashCut; } - private function getStub($item) + private function getStub(mixed $item) { if (!$item || !\is_array($item)) { return $item; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php index 6d60b723..61d02d24 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php @@ -20,11 +20,8 @@ interface DumperInterface { /** * Dumps a scalar value. - * - * @param string $type The PHP type of the value being dumped - * @param string|int|float|bool $value The scalar value being dumped */ - public function dumpScalar(Cursor $cursor, string $type, $value); + public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value); /** * Dumps a string. @@ -38,19 +35,19 @@ interface DumperInterface /** * Dumps while entering an hash. * - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string|int $class The object class, resource type or array count - * @param bool $hasChild When the dump of the hash has child item + * @param int $type A Cursor::HASH_* const for the type of hash + * @param string|int|null $class The object class, resource type or array count + * @param bool $hasChild When the dump of the hash has child item */ - public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild); + public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild); /** * Dumps while leaving an hash. * - * @param int $type A Cursor::HASH_* const for the type of hash - * @param string|int $class The object class, resource type or array count - * @param bool $hasChild When the dump of the hash has child item - * @param int $cut The number of items the hash has been cut by + * @param int $type A Cursor::HASH_* const for the type of hash + * @param string|int|null $class The object class, resource type or array count + * @param bool $hasChild When the dump of the hash has child item + * @param int $cut The number of items the hash has been cut by */ - public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut); + public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut); } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php index 073c56ef..1c5b8871 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php @@ -39,7 +39,7 @@ class Stub public $position = 0; public $attr = []; - private static $defaultProperties = []; + private static array $defaultProperties = []; /** * @internal diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php index 90d5ac9b..9afcc348 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php @@ -16,23 +16,23 @@ namespace Symfony\Component\VarDumper\Cloner; */ class VarCloner extends AbstractCloner { - private static $gid; - private static $arrayCache = []; + private static string $gid; + private static array $arrayCache = []; /** * {@inheritdoc} */ - protected function doClone($var) + protected function doClone(mixed $var): array { $len = 1; // Length of $queue $pos = 0; // Number of cloned items past the minimum depth $refsCounter = 0; // Hard references counter - $queue = [[$var]]; // This breadth-first queue is the return value - $hardRefs = []; // Map of original zval ids to stub objects - $objRefs = []; // Map of original object handles to their stub object counterpart - $objects = []; // Keep a ref to objects to ensure their handle cannot be reused while cloning - $resRefs = []; // Map of original resource handles to their stub object counterpart - $values = []; // Map of stub objects' ids to original values + $queue = [[$var]]; // This breadth-first queue is the return value + $hardRefs = []; // Map of original zval ids to stub objects + $objRefs = []; // Map of original object handles to their stub object counterpart + $objects = []; // Keep a ref to objects to ensure their handle cannot be reused while cloning + $resRefs = []; // Map of original resource handles to their stub object counterpart + $values = []; // Map of stub objects' ids to original values $maxItems = $this->maxItems; $maxString = $this->maxString; $minDepth = $this->minDepth; @@ -44,9 +44,7 @@ class VarCloner extends AbstractCloner $stub = null; // Stub capturing the main properties of an original item value // or null if the original value is used directly - if (!$gid = self::$gid) { - $gid = self::$gid = md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable - } + $gid = self::$gid ??= md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable $arrayStub = new Stub(); $arrayStub->type = Stub::TYPE_ARRAY; $fromObjCast = false; @@ -65,32 +63,25 @@ class VarCloner extends AbstractCloner foreach ($vals as $k => $v) { // $v is the original value or a stub object in case of hard references - if (\PHP_VERSION_ID >= 70400) { - $zvalIsRef = null !== \ReflectionReference::fromArrayElement($vals, $k); - } else { - $refs[$k] = $cookie; - $zvalIsRef = $vals[$k] === $cookie; - } + $zvalRef = ($r = \ReflectionReference::fromArrayElement($vals, $k)) ? $r->getId() : null; - if ($zvalIsRef) { + if ($zvalRef) { $vals[$k] = &$stub; // Break hard references to make $queue completely unset($stub); // independent from the original structure - if ($v instanceof Stub && isset($hardRefs[spl_object_id($v)])) { - $vals[$k] = $refs[$k] = $v; + if (null !== $vals[$k] = $hardRefs[$zvalRef] ?? null) { + $v = $vals[$k]; if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) { ++$v->value->refCount; } ++$v->refCount; continue; } - $refs[$k] = $vals[$k] = new Stub(); - $refs[$k]->value = $v; - $h = spl_object_id($refs[$k]); - $hardRefs[$h] = &$refs[$k]; - $values[$h] = $v; + $vals[$k] = new Stub(); + $vals[$k]->value = $v; $vals[$k]->handle = ++$refsCounter; + $hardRefs[$zvalRef] = $vals[$k]; } - // Create $stub when the original value $v can not be used directly + // Create $stub when the original value $v cannot be used directly // If $v is a nested structure, put that structure in array $a switch (true) { case null === $v: @@ -129,39 +120,46 @@ class VarCloner extends AbstractCloner continue 2; } $stub = $arrayStub; + + if (\PHP_VERSION_ID >= 80100) { + $stub->class = array_is_list($v) ? Stub::ARRAY_INDEXED : Stub::ARRAY_ASSOC; + $a = $v; + break; + } + $stub->class = Stub::ARRAY_INDEXED; $j = -1; foreach ($v as $gk => $gv) { if ($gk !== ++$j) { $stub->class = Stub::ARRAY_ASSOC; + $a = $v; + $a[$gid] = true; break; } } - $a = $v; - if (Stub::ARRAY_ASSOC === $stub->class) { - // Copies of $GLOBALS have very strange behavior, - // let's detect them with some black magic - if (\PHP_VERSION_ID < 80100 && ($a[$gid] = true) && isset($v[$gid])) { - unset($v[$gid]); - $a = []; - foreach ($v as $gk => &$gv) { - if ($v === $gv) { - unset($v); - $v = new Stub(); - $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0]; - $v->handle = -1; - $gv = &$hardRefs[spl_object_id($v)]; - $gv = $v; - } - - $a[$gk] = &$gv; + // Copies of $GLOBALS have very strange behavior, + // let's detect them with some black magic + if (isset($v[$gid])) { + unset($v[$gid]); + $a = []; + foreach ($v as $gk => &$gv) { + if ($v === $gv && !isset($hardRefs[\ReflectionReference::fromArrayElement($v, $gk)->getId()])) { + unset($v); + $v = new Stub(); + $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0]; + $v->handle = -1; + $gv = &$a[$gk]; + $hardRefs[\ReflectionReference::fromArrayElement($a, $gk)->getId()] = &$gv; + $gv = $v; } - unset($gv); - } else { - $a = $v; + + $a[$gk] = &$gv; } + unset($gv); + } else { + $a = $v; } break; @@ -251,10 +249,10 @@ class VarCloner extends AbstractCloner } } - if ($zvalIsRef) { - $refs[$k]->value = $stub; - } else { + if (!$zvalRef) { $vals[$k] = $stub; + } else { + $hardRefs[$zvalRef]->value = $stub; } } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php index 7d9ec0e7..e3d5f1d1 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php @@ -11,7 +11,6 @@ namespace Symfony\Component\VarDumper\Command\Descriptor; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; @@ -28,13 +27,11 @@ use Symfony\Component\VarDumper\Dumper\CliDumper; class CliDescriptor implements DumpDescriptorInterface { private $dumper; - private $lastIdentifier; - private $supportsHref; + private mixed $lastIdentifier = null; public function __construct(CliDumper $dumper) { $this->dumper = $dumper; - $this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref'); } public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void @@ -66,8 +63,7 @@ class CliDescriptor implements DumpDescriptorInterface if (isset($context['source'])) { $source = $context['source']; $sourceInfo = sprintf('%s on line %d', $source['name'], $source['line']); - $fileLink = $source['file_link'] ?? null; - if ($this->supportsHref && $fileLink) { + if ($fileLink = $source['file_link'] ?? null) { $sourceInfo = sprintf('<href=%s>%s</>', $fileLink, $sourceInfo); } $rows[] = ['source', $sourceInfo]; @@ -77,11 +73,6 @@ class CliDescriptor implements DumpDescriptorInterface $io->table([], $rows); - if (!$this->supportsHref && isset($fileLink)) { - $io->writeln(['<info>Open source in your IDE/browser:</info>', $fileLink]); - $io->newLine(); - } - $this->dumper->dump($data); $io->newLine(); } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php index 636b6182..1c0d80a0 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php @@ -25,7 +25,7 @@ use Symfony\Component\VarDumper\Dumper\HtmlDumper; class HtmlDescriptor implements DumpDescriptorInterface { private $dumper; - private $initialized = false; + private bool $initialized = false; public function __construct(HtmlDumper $dumper) { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php index ead9d5bd..13dd475b 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php @@ -11,7 +11,10 @@ namespace Symfony\Component\VarDumper\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -32,15 +35,13 @@ use Symfony\Component\VarDumper\Server\DumpServer; * * @final */ +#[AsCommand(name: 'server:dump', description: 'Start a dump server that collects and displays dumps in a single place')] class ServerDumpCommand extends Command { - protected static $defaultName = 'server:dump'; - protected static $defaultDescription = 'Start a dump server that collects and displays dumps in a single place'; - private $server; /** @var DumpDescriptorInterface[] */ - private $descriptors; + private array $descriptors; public function __construct(DumpServer $server, array $descriptors = []) { @@ -55,11 +56,8 @@ class ServerDumpCommand extends Command protected function configure() { - $availableFormats = implode(', ', array_keys($this->descriptors)); - $this - ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli') - ->setDescription(self::$defaultDescription) + ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', implode(', ', $this->getAvailableFormats())), 'cli') ->setHelp(<<<'EOF' <info>%command.name%</info> starts a dump server that collects and displays dumps in a single place for debugging you application: @@ -99,4 +97,16 @@ EOF return 0; } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues($this->getAvailableFormats()); + } + } + + private function getAvailableFormats(): array + { + return array_keys($this->descriptors); + } } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index 6064ea99..6ac38083 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -35,7 +35,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface protected $indentPad = ' '; protected $flags; - private $charset = ''; + private string $charset = ''; /** * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput @@ -84,7 +84,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface * * @return string The previous charset */ - public function setCharset(string $charset) + public function setCharset(string $charset): string { $prev = $this->charset; @@ -103,7 +103,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface * * @return string The previous indent pad */ - public function setIndentPad(string $pad) + public function setIndentPad(string $pad): string { $prev = $this->indentPad; $this->indentPad = $pad; @@ -118,7 +118,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface * * @return string|null The dump as string when $output is true */ - public function dump(Data $data, $output = null) + public function dump(Data $data, $output = null): ?string { $this->decimalPoint = localeconv(); $this->decimalPoint = $this->decimalPoint['decimal_point']; @@ -179,10 +179,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface /** * Converts a non-UTF-8 string to UTF-8. - * - * @return string|null The string converted to UTF-8 */ - protected function utf8Encode(?string $s) + protected function utf8Encode(?string $s): ?string { if (null === $s || preg_match('//u', $s)) { return $s; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php index c1539ee0..f6e290ca 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -55,11 +55,11 @@ class CliDumper extends AbstractDumper protected $collapseNextHash = false; protected $expandNextHash = false; - private $displayOptions = [ + private array $displayOptions = [ 'fileLinkFormat' => null, ]; - private $handlesHrefGracefully; + private bool $handlesHrefGracefully; /** * {@inheritdoc} @@ -125,7 +125,7 @@ class CliDumper extends AbstractDumper /** * {@inheritdoc} */ - public function dumpScalar(Cursor $cursor, string $type, $value) + public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value) { $this->dumpKey($cursor); @@ -139,11 +139,20 @@ class CliDumper extends AbstractDumper case 'integer': $style = 'num'; + + if (isset($this->styles['integer'])) { + $style = 'integer'; + } + break; case 'double': $style = 'num'; + if (isset($this->styles['float'])) { + $style = 'float'; + } + switch (true) { case \INF === $value: $value = 'INF'; break; case -\INF === $value: $value = '-INF'; break; @@ -267,7 +276,7 @@ class CliDumper extends AbstractDumper /** * {@inheritdoc} */ - public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild) + public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) { if (null === $this->colors) { $this->colors = $this->supportsColors(); @@ -308,7 +317,7 @@ class CliDumper extends AbstractDumper /** * {@inheritdoc} */ - public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut) + public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut) { if (empty($cursor->attr['cut_hash'])) { $this->dumpEllipsis($cursor, $hasChild, $cut); @@ -425,19 +434,15 @@ class CliDumper extends AbstractDumper * @param string $style The type of style being applied * @param string $value The value being styled * @param array $attr Optional context information - * - * @return string The value with style decoration */ - protected function style(string $style, string $value, array $attr = []) + protected function style(string $style, string $value, array $attr = []): string { if (null === $this->colors) { $this->colors = $this->supportsColors(); } - if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); - } + $this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { $prefix = substr($value, 0, -$attr['ellipsis']); @@ -501,10 +506,7 @@ class CliDumper extends AbstractDumper return $value; } - /** - * @return bool Tells if the current output stream supports ANSI colors or not - */ - protected function supportsColors() + protected function supportsColors(): bool { if ($this->outputStream !== static::$defaultOutput) { return $this->hasColorSupport($this->outputStream); @@ -576,10 +578,8 @@ class CliDumper extends AbstractDumper * * Reference: Composer\XdebugHandler\Process::supportsColor * https://github.com/composer/xdebug-handler - * - * @param mixed $stream A CLI output stream */ - private function hasColorSupport($stream): bool + private function hasColorSupport(mixed $stream): bool { if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { return false; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php index 38ef3b0f..532aa0f9 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php @@ -18,8 +18,5 @@ namespace Symfony\Component\VarDumper\Dumper\ContextProvider; */ interface ContextProviderInterface { - /** - * @return array|null Context data or null if unable to provide any context - */ public function getContext(): ?array; } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php index 2e2c8181..8ef6e360 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php @@ -25,9 +25,9 @@ use Twig\Template; */ final class SourceContextProvider implements ContextProviderInterface { - private $limit; - private $charset; - private $projectDir; + private int $limit; + private ?string $charset; + private ?string $projectDir; private $fileLinkFormatter; public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9) diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php index 76384176..18ab56eb 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php @@ -20,7 +20,7 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; class ContextualizedDumper implements DataDumperInterface { private $wrappedDumper; - private $contextProviders; + private array $contextProviders; /** * @param ContextProviderInterface[] $contextProviders diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 6c3abaa2..40e97a53 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -67,12 +67,12 @@ class HtmlDumper extends CliDumper protected $lastDepth = -1; protected $styles; - private $displayOptions = [ + private array $displayOptions = [ 'maxDepth' => 1, 'maxStringLength' => 160, 'fileLinkFormat' => null, ]; - private $extraDisplayOptions = []; + private array $extraDisplayOptions = []; /** * {@inheritdoc} @@ -134,7 +134,7 @@ class HtmlDumper extends CliDumper /** * {@inheritdoc} */ - public function dump(Data $data, $output = null, array $extraDisplayOptions = []) + public function dump(Data $data, $output = null, array $extraDisplayOptions = []): ?string { $this->extraDisplayOptions = $extraDisplayOptions; $result = parent::dump($data, $output); @@ -803,7 +803,7 @@ EOHTML /** * {@inheritdoc} */ - public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild) + public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild) { if (Cursor::HASH_OBJECT === $type) { $cursor->attr['depth'] = $cursor->depth; @@ -834,7 +834,7 @@ EOHTML /** * {@inheritdoc} */ - public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut) + public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut) { $this->dumpEllipsis($cursor, $hasChild, $cut); if ($hasChild) { @@ -846,7 +846,7 @@ EOHTML /** * {@inheritdoc} */ - protected function style(string $style, string $value, array $attr = []) + protected function style(string $style, string $value, array $attr = []): string { if ('' === $value) { return ''; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE b/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE index c1f0aac1..a843ec12 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE +++ b/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2021 Fabien Potencier +Copyright (c) 2014-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/README.md b/data/web/inc/lib/vendor/symfony/var-dumper/README.md index bdac2447..a0da8c9a 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/README.md +++ b/data/web/inc/lib/vendor/symfony/var-dumper/README.md @@ -3,7 +3,7 @@ VarDumper Component The VarDumper component provides mechanisms for walking through any arbitrary PHP variable. It provides a better `dump()` function that you can use instead -of `var_dump`. +of `var_dump()`. Resources --------- diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php b/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php index a485d573..6221a4d1 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php @@ -15,7 +15,7 @@ if (!function_exists('dump')) { /** * @author Nicolas Grekas <p@tchwork.com> */ - function dump($var, ...$moreVars) + function dump(mixed $var, mixed ...$moreVars): mixed { VarDumper::dump($var); @@ -32,8 +32,15 @@ if (!function_exists('dump')) { } if (!function_exists('dd')) { - function dd(...$vars) + /** + * @return never + */ + function dd(...$vars): void { + if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + foreach ($vars as $v) { VarDumper::dump($v); } diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php b/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php index 55d9214d..97b5b94f 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php @@ -21,8 +21,12 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface; */ class Connection { - private $host; - private $contextProviders; + private string $host; + private array $contextProviders; + + /** + * @var resource|null + */ private $socket; /** diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php b/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php index 7cb5bf0c..6a43c120 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php @@ -24,10 +24,14 @@ use Symfony\Component\VarDumper\Cloner\Stub; */ class DumpServer { - private $host; - private $socket; + private string $host; private $logger; + /** + * @var resource|null + */ + private $socket; + public function __construct(string $host, LoggerInterface $logger = null) { if (!str_contains($host, '://')) { diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php b/data/web/inc/lib/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php index 33d60c02..a202185e 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php @@ -22,7 +22,7 @@ trait VarDumperTestTrait /** * @internal */ - private $varDumperConfig = [ + private array $varDumperConfig = [ 'casters' => [], 'flags' => null, ]; @@ -42,17 +42,17 @@ trait VarDumperTestTrait $this->varDumperConfig['flags'] = null; } - public function assertDumpEquals($expected, $data, int $filter = 0, string $message = '') + public function assertDumpEquals(mixed $expected, mixed $data, int $filter = 0, string $message = '') { $this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); } - public function assertDumpMatchesFormat($expected, $data, int $filter = 0, string $message = '') + public function assertDumpMatchesFormat(mixed $expected, mixed $data, int $filter = 0, string $message = '') { $this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message); } - protected function getDump($data, $key = null, int $filter = 0): ?string + protected function getDump(mixed $data, string|int $key = null, int $filter = 0): ?string { if (null === $flags = $this->varDumperConfig['flags']) { $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; @@ -73,7 +73,7 @@ trait VarDumperTestTrait return rtrim($dumper->dump($data, true)); } - private function prepareExpectation($expected, int $filter): string + private function prepareExpectation(mixed $expected, int $filter): string { if (!\is_string($expected)) { $expected = $this->getDump($expected, null, $filter); diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php index b223e065..dfef9f41 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php +++ b/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php @@ -32,9 +32,12 @@ require_once __DIR__.'/Resources/functions/dump.php'; */ class VarDumper { + /** + * @var callable|null + */ private static $handler; - public static function dump($var) + public static function dump(mixed $var) { if (null === self::$handler) { self::register(); @@ -43,7 +46,7 @@ class VarDumper return (self::$handler)($var); } - public static function setHandler(callable $callable = null) + public static function setHandler(callable $callable = null): ?callable { $prevHandler = self::$handler; diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/composer.json b/data/web/inc/lib/vendor/symfony/var-dumper/composer.json index 2d4889d0..db04f588 100644 --- a/data/web/inc/lib/vendor/symfony/var-dumper/composer.json +++ b/data/web/inc/lib/vendor/symfony/var-dumper/composer.json @@ -16,19 +16,19 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "ext-iconv": "*", - "symfony/console": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", + "symfony/console": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/uid": "^5.4|^6.0", "twig/twig": "^2.13|^3.0.4" }, "conflict": { "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" + "symfony/console": "<5.4" }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", diff --git a/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml b/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml index c4f275b9..2a0d42f9 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml +++ b/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml @@ -1,13 +1,16 @@ name: Run tests -on: [push, pull_request] +on: + push: + branches: [laravel-9-ongoing, laravel-8-ongoing] + pull_request: jobs: tests: strategy: matrix: os: [Ubuntu, macOS] - php: [7.2, 7.3, 7.4, 8.0] + php: [7.3, 7.4, 8.0, 8.1] include: - os: Ubuntu diff --git a/data/web/inc/lib/vendor/tightenco/collect/branch-commit-push.sh b/data/web/inc/lib/vendor/tightenco/collect/branch-commit-push.sh new file mode 100755 index 00000000..124e5833 --- /dev/null +++ b/data/web/inc/lib/vendor/tightenco/collect/branch-commit-push.sh @@ -0,0 +1,67 @@ +#!/bin/bash + + +GREEN='\033[0;32m' +RED='\033[0;31m' +WHITE='\033[0;37m' +RESET='\033[0m' + +function validateVersion() +{ + echo "" + passedVersion=$1 + echo -e "${WHITE}-- Validating tag '$passedVersion'...${RESET}" + + # Todo: validate the version here using a regex; if fail, just exit + # ... expect 8.75.0, with no v in front of it + + if [[ $passedVersion == '' ]]; then + echo -e "\n-- Invalid tag. Tags should be structured without v; e.g. 8.57.0" + exit + fi + + echo -e "${WHITE}-- Tag valid.${RESET}" + echo "" +} + +# Exit script if any command fails (e.g. phpunit) +set -e + + +# Require confirmation it's set up corrctly +echo +echo -e "${WHITE}-- This script is meant to be run after running upgrade.sh, BEFORE committing to Git.${RESET}" + +while true; do + echo -e "${GREEN}-- Is that the current state of your local project?${RESET}" + read -p "-- (y/n) " yn + case $yn in + [Yy]* ) break;; + [Nn]* ) exit;; + * ) echo "Please answer y or n.";; + esac +done + +# Get the version and exit if not valid +validateVersion $1 + +# Create official v prefaced version +version="v$1" + +# Run tests (and bail if they fail) +phpunit +echo -e "\n${WHITE}-- Tests succeeded.${RESET}" + +# Branch +echo -e "\n${WHITE}-- Creating a Git branch '$version-changes'...${RESET}\n" +git checkout -b $version-changes + +# Add and commit, with "v8.57.0 changes" as the commit name +git add -A +git commit -m "$version changes" + +echo +echo -e "${WHITE}-- Git committed.${RESET}" + +# Push +git push -u origin $version-changes diff --git a/data/web/inc/lib/vendor/tightenco/collect/composer.json b/data/web/inc/lib/vendor/tightenco/collect/composer.json index 58e5f6c0..88ebb77a 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/composer.json +++ b/data/web/inc/lib/vendor/tightenco/collect/composer.json @@ -10,8 +10,8 @@ } ], "require": { - "php": "^7.2|^8.0", - "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" + "php": "^7.3|^8.0", + "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { "mockery/mockery": "^1.0", @@ -33,7 +33,11 @@ "tests/files/Support/HtmlString.php", "tests/files/Support/HigherOrderTapProxy.php", "tests/files/Support/Str.php", - "tests/files/Support/Stringable.php" + "tests/files/Support/Traits/Conditionable.php", + "tests/files/Support/Stringable.php", + "tests/files/Support/ItemNotFoundException.php", + "tests/files/Support/MultipleItemsFoundException.php", + "tests/Support/Concerns/CountsEnumerations.php" ] }, "scripts": { diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Contracts/Support/CanBeEscapedWhenCastToString.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Contracts/Support/CanBeEscapedWhenCastToString.php new file mode 100644 index 00000000..6f3ba002 --- /dev/null +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Contracts/Support/CanBeEscapedWhenCastToString.php @@ -0,0 +1,14 @@ +<?php + +namespace Tightenco\Collect\Contracts\Support; + +interface CanBeEscapedWhenCastToString +{ + /** + * Indicate that the object's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true); +} diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php index b99db01f..57350cca 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php @@ -121,6 +121,23 @@ class Arr return $results; } + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @param iterable $array + * @return array + */ + public static function undot($array) + { + $results = []; + + foreach ($array as $key => $value) { + static::set($results, $key, $value); + } + + return $results; + } + /** * Get all of the given array except for a specified array of keys. * @@ -393,6 +410,19 @@ class Arr return array_keys($keys) !== $keys; } + /** + * Determines if an array is a list. + * + * An array is a "list" if all array keys are sequential integers starting from 0 with no gaps in between. + * + * @param array $array + * @return bool + */ + public static function isList($array) + { + return ! self::isAssoc($array); + } + /** * Get a subset of the items from the given array. * @@ -493,6 +523,17 @@ class Arr return $value; } + /** + * Convert the array into a query string. + * + * @param array $array + * @return string + */ + public static function query($array) + { + return http_build_query($array, '', '&', PHP_QUERY_RFC3986); + } + /** * Get one or a specified number of random values from an array. * @@ -642,14 +683,26 @@ class Arr } /** - * Convert the array into a query string. + * Conditionally compile classes from an array into a CSS class list. * * @param array $array * @return string */ - public static function query($array) + public static function toCssClasses($array) { - return http_build_query($array, '', '&', PHP_QUERY_RFC3986); + $classList = static::wrap($array); + + $classes = []; + + foreach ($classList as $class => $constraint) { + if (is_numeric($class)) { + $classes[] = $constraint; + } elseif ($constraint) { + $classes[] = $class; + } + } + + return implode(' ', $classes); } /** @@ -664,6 +717,19 @@ class Arr return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH); } + /** + * Filter items where the value is not null. + * + * @param array $array + * @return array + */ + public static function whereNotNull($array) + { + return static::where($array, function ($value) { + return ! is_null($value); + }); + } + /** * If the given value is not an array and not null, wrap it in one. * diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php index 3a0bfbff..577e3515 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php @@ -4,11 +4,12 @@ namespace Tightenco\Collect\Support; use ArrayAccess; use ArrayIterator; +use Tightenco\Collect\Contracts\Support\CanBeEscapedWhenCastToString; use Tightenco\Collect\Support\Traits\EnumeratesValues; use Tightenco\Collect\Support\Traits\Macroable; use stdClass; -class Collection implements ArrayAccess, Enumerable +class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable { use EnumeratesValues, Macroable; @@ -175,6 +176,19 @@ class Collection implements ArrayAccess, Enumerable return $this->contains($this->operatorForWhere(...func_get_args())); } + /** + * Determine if an item is not contained in the collection. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContain($key, $operator = null, $value = null) + { + return ! $this->contains(...func_get_args()); + } + /** * Cross join with the given lists, returning all possible permutations. * @@ -260,7 +274,7 @@ class Collection implements ArrayAccess, Enumerable /** * Retrieve duplicate items from the collection. * - * @param callable|null $callback + * @param callable|string|null $callback * @param bool $strict * @return static */ @@ -288,7 +302,7 @@ class Collection implements ArrayAccess, Enumerable /** * Retrieve duplicate items from the collection using strict comparison. * - * @param callable|null $callback + * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null) @@ -383,7 +397,7 @@ class Collection implements ArrayAccess, Enumerable /** * Remove an item from the collection by key. * - * @param string|array $keys + * @param string|int|array $keys * @return $this */ public function forget($keys) @@ -411,6 +425,24 @@ class Collection implements ArrayAccess, Enumerable return value($default); } + /** + * Get an item from the collection by key or add it to collection if it does not exist. + * + * @param mixed $key + * @param mixed $value + * @return mixed + */ + public function getOrPut($key, $value) + { + if (array_key_exists($key, $this->items)) { + return $this->items[$key]; + } + + $this->offsetSet($key, $value = value($value)); + + return $value; + } + /** * Group an associative array by a field or using a callback. * @@ -501,6 +533,29 @@ class Collection implements ArrayAccess, Enumerable return true; } + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key) + { + if ($this->isEmpty()) { + return false; + } + + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if ($this->has($value)) { + return true; + } + } + + return false; + } + /** * Concatenate values of a given key as a string. * @@ -513,10 +568,10 @@ class Collection implements ArrayAccess, Enumerable $first = $this->first(); if (is_array($first) || (is_object($first) && ! $first instanceof \Illuminate\Support\Stringable)) { - return implode($glue, $this->pluck($value)->all()); + return implode($glue ?? '', $this->pluck($value)->all()); } - return implode($value, $this->items); + return implode($value ?? '', $this->items); } /** @@ -784,13 +839,30 @@ class Collection implements ArrayAccess, Enumerable } /** - * Get and remove the last item from the collection. + * Get and remove the last N items from the collection. * + * @param int $count * @return mixed */ - public function pop() + public function pop($count = 1) { - return array_pop($this->items); + if ($count === 1) { + return array_pop($this->items); + } + + if ($this->isEmpty()) { + return new static; + } + + $results = []; + + $collectionCount = $this->count(); + + foreach (range(1, min($count, $collectionCount)) as $item) { + array_push($results, array_pop($this->items)); + } + + return new static($results); } /** @@ -810,7 +882,7 @@ class Collection implements ArrayAccess, Enumerable /** * Push one or more items onto the end of the collection. * - * @param mixed $values [optional] + * @param mixed $values * @return $this */ public function push(...$values) @@ -937,13 +1009,30 @@ class Collection implements ArrayAccess, Enumerable } /** - * Get and remove the first item from the collection. + * Get and remove the first N items from the collection. * + * @param int $count * @return mixed */ - public function shift() + public function shift($count = 1) { - return array_shift($this->items); + if ($count === 1) { + return array_shift($this->items); + } + + if ($this->isEmpty()) { + return new static; + } + + $results = []; + + $collectionCount = $this->count(); + + foreach (range(1, min($count, $collectionCount)) as $item) { + array_push($results, array_shift($this->items)); + } + + return new static($results); } /** @@ -957,6 +1046,22 @@ class Collection implements ArrayAccess, Enumerable return new static(Arr::shuffle($this->items, $seed)); } + /** + * Create chunks representing a "sliding window" view of the items in the collection. + * + * @param int $size + * @param int $step + * @return static + */ + public function sliding($size = 2, $step = 1) + { + $chunks = floor(($this->count() - $size) / $step) + 1; + + return static::times($chunks, function ($number) use ($size, $step) { + return $this->slice(($number - 1) * $step, $size); + }); + } + /** * Skip the first {$count} items. * @@ -1050,6 +1155,63 @@ class Collection implements ArrayAccess, Enumerable return $this->chunk(ceil($this->count() / $numberOfGroups)); } + /** + * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return mixed + * + * @throws \Tightenco\Collect\Support\ItemNotFoundException + * @throws \Tightenco\Collect\Support\MultipleItemsFoundException + */ + public function sole($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + $items = $this->when($filter)->filter($filter); + + if ($items->isEmpty()) { + throw new ItemNotFoundException; + } + + if ($items->count() > 1) { + throw new MultipleItemsFoundException; + } + + return $items->first(); + } + + /** + * Get the first item in the collection but throw an exception if no matching items exist. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return mixed + * + * @throws \Tightenco\Collect\Support\ItemNotFoundException + */ + public function firstOrFail($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + $placeholder = new stdClass(); + + $item = $this->first($filter, $placeholder); + + if ($item === $placeholder) { + throw new ItemNotFoundException; + } + + return $item; + } + /** * Chunk the collection into chunks of the given size. * @@ -1136,7 +1298,7 @@ class Collection implements ArrayAccess, Enumerable // First we will loop through the items and get the comparator from a callback // function which we were given. Then, we will sort the returned values and - // and grab the corresponding values for the sorted keys from this array. + // grab all the corresponding values for the sorted keys from this array. foreach ($this->items as $key => $value) { $results[$key] = $callback($value, $key); } @@ -1175,7 +1337,7 @@ class Collection implements ArrayAccess, Enumerable $result = 0; - if (is_callable($prop)) { + if (! is_string($prop) && is_callable($prop)) { $result = $prop($a, $b); } else { $values = [data_get($a, $prop), data_get($b, $prop)]; @@ -1237,6 +1399,21 @@ class Collection implements ArrayAccess, Enumerable return $this->sortKeys($options, true); } + /** + * Sort the collection keys using a callback. + * + * @param callable $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + $items = $this->items; + + uksort($items, $callback); + + return new static($items); + } + /** * Splice a portion of the underlying collection array. * @@ -1251,7 +1428,7 @@ class Collection implements ArrayAccess, Enumerable return new static(array_splice($this->items, $offset)); } - return new static(array_splice($this->items, $offset, $length, $replacement)); + return new static(array_splice($this->items, $offset, $length, $this->getArrayableItems($replacement))); } /** @@ -1304,6 +1481,42 @@ class Collection implements ArrayAccess, Enumerable return $this; } + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @return static + */ + public function undot() + { + return new static(Arr::undot($this->all())); + } + + /** + * Return only unique items from the collection array. + * + * @param string|callable|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false) + { + if (is_null($key) && $strict === false) { + return new static(array_unique($this->items, SORT_REGULAR)); + } + + $callback = $this->valueRetriever($key); + + $exists = []; + + return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { + if (in_array($id = $callback($item, $key), $exists, $strict)) { + return true; + } + + $exists[] = $id; + }); + } + /** * Reset the keys on the underlying array. * @@ -1353,6 +1566,7 @@ class Collection implements ArrayAccess, Enumerable * * @return \ArrayIterator */ + #[\ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->items); @@ -1363,6 +1577,7 @@ class Collection implements ArrayAccess, Enumerable * * @return int */ + #[\ReturnTypeWillChange] public function count() { return count($this->items); @@ -1408,6 +1623,7 @@ class Collection implements ArrayAccess, Enumerable * @param mixed $key * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($key) { return isset($this->items[$key]); @@ -1419,6 +1635,7 @@ class Collection implements ArrayAccess, Enumerable * @param mixed $key * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($key) { return $this->items[$key]; @@ -1431,6 +1648,7 @@ class Collection implements ArrayAccess, Enumerable * @param mixed $value * @return void */ + #[\ReturnTypeWillChange] public function offsetSet($key, $value) { if (is_null($key)) { @@ -1443,9 +1661,10 @@ class Collection implements ArrayAccess, Enumerable /** * Unset the item at a given offset. * - * @param string $key + * @param mixed $key * @return void */ + #[\ReturnTypeWillChange] public function offsetUnset($key) { unset($this->items[$key]); diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php index f189c459..60af386c 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php @@ -211,7 +211,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Retrieve duplicate items. * - * @param callable|null $callback + * @param callable|string|null $callback * @param bool $strict * @return static */ @@ -220,7 +220,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, /** * Retrieve duplicate items using strict comparison. * - * @param callable|null $callback + * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null); diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php index da73cb20..464cee1b 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php @@ -5,12 +5,13 @@ namespace Tightenco\Collect\Support; use ArrayIterator; use Closure; use DateTimeInterface; +use Tightenco\Collect\Contracts\Support\CanBeEscapedWhenCastToString; use Tightenco\Collect\Support\Traits\EnumeratesValues; use Tightenco\Collect\Support\Traits\Macroable; use IteratorAggregate; use stdClass; -class LazyCollection implements Enumerable +class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable { use EnumeratesValues, Macroable; @@ -204,6 +205,19 @@ class LazyCollection implements Enumerable return $this->contains($this->operatorForWhere(...func_get_args())); } + /** + * Determine if an item is not contained in the enumerable. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContain($key, $operator = null, $value = null) + { + return ! $this->contains(...func_get_args()); + } + /** * Cross join the given iterables, returning all possible permutations. * @@ -316,7 +330,7 @@ class LazyCollection implements Enumerable /** * Retrieve duplicate items. * - * @param callable|null $callback + * @param callable|string|null $callback * @param bool $strict * @return static */ @@ -328,7 +342,7 @@ class LazyCollection implements Enumerable /** * Retrieve duplicate items using strict comparison. * - * @param callable|null $callback + * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null) @@ -512,6 +526,25 @@ class LazyCollection implements Enumerable return false; } + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key) + { + $keys = array_flip(is_array($key) ? $key : func_get_args()); + + foreach ($this as $key => $value) { + if (array_key_exists($key, $keys)) { + return true; + } + } + + return false; + } + /** * Concatenate values of a given key as a string. * @@ -920,6 +953,45 @@ class LazyCollection implements Enumerable return $this->passthru('shuffle', func_get_args()); } + /** + * Create chunks representing a "sliding window" view of the items in the collection. + * + * @param int $size + * @param int $step + * @return static + */ + public function sliding($size = 2, $step = 1) + { + return new static(function () use ($size, $step) { + $iterator = $this->getIterator(); + + $chunk = []; + + while ($iterator->valid()) { + $chunk[$iterator->key()] = $iterator->current(); + + if (count($chunk) == $size) { + yield tap(new static($chunk), function () use (&$chunk, $step) { + $chunk = array_slice($chunk, $step, null, true); + }); + + // If the $step between chunks is bigger than each chunk's $size + // we will skip the extra items (which should never be in any + // chunk) before we continue to the next chunk in the loop. + if ($step > $size) { + $skip = $step - $size; + + for ($i = 0; $i < $skip && $iterator->valid(); $i++) { + $iterator->next(); + } + } + } + + $iterator->next(); + } + }); + } + /** * Skip the first {$count} items. * @@ -1010,6 +1082,55 @@ class LazyCollection implements Enumerable return $this->passthru('split', func_get_args()); } + /** + * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return mixed + * + * @throws \Tightenco\Collect\Support\ItemNotFoundException + * @throws \Tightenco\Collect\Support\MultipleItemsFoundException + */ + public function sole($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + return $this + ->when($filter) + ->filter($filter) + ->take(2) + ->collect() + ->sole(); + } + + /** + * Get the first item in the collection but throw an exception if no matching items exist. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return mixed + * + * @throws \Tightenco\Collect\Support\ItemNotFoundException + */ + public function firstOrFail($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + return $this + ->when($filter) + ->filter($filter) + ->take(1) + ->collect() + ->firstOrFail(); + } + /** * Chunk the collection into chunks of the given size. * @@ -1167,6 +1288,17 @@ class LazyCollection implements Enumerable return $this->passthru('sortKeysDesc', func_get_args()); } + /** + * Sort the collection keys using a callback. + * + * @param callable $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + return $this->passthru('sortKeysUsing', func_get_args()); + } + /** * Take the first or last {$limit} items. * @@ -1264,6 +1396,40 @@ class LazyCollection implements Enumerable }); } + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @return static + */ + public function undot() + { + return $this->passthru('undot', []); + } + + /** + * Return only unique items from the collection array. + * + * @param string|callable|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false) + { + $callback = $this->valueRetriever($key); + + return new static(function () use ($callback, $strict) { + $exists = []; + + foreach ($this as $key => $item) { + if (! in_array($id = $callback($item, $key), $exists, $strict)) { + yield $key => $item; + + $exists[] = $id; + } + } + }); + } + /** * Reset the keys on the underlying array. * @@ -1337,6 +1503,7 @@ class LazyCollection implements Enumerable * * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { return $this->makeIterator($this->source); @@ -1347,6 +1514,7 @@ class LazyCollection implements Enumerable * * @return int */ + #[\ReturnTypeWillChange] public function count() { if (is_array($this->source)) { diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php index 2ff7d361..2600a223 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php @@ -15,11 +15,13 @@ use Tightenco\Collect\Support\HigherOrderWhenProxy; use JsonSerializable; use Symfony\Component\VarDumper\VarDumper; use Traversable; +use UnexpectedValueException; /** * @property-read HigherOrderCollectionProxy $average * @property-read HigherOrderCollectionProxy $avg * @property-read HigherOrderCollectionProxy $contains + * @property-read HigherOrderCollectionProxy $doesntContain * @property-read HigherOrderCollectionProxy $each * @property-read HigherOrderCollectionProxy $every * @property-read HigherOrderCollectionProxy $filter @@ -45,6 +47,13 @@ use Traversable; */ trait EnumeratesValues { + /** + * Indicates that the object's string representation should be escaped when __toString is invoked. + * + * @var bool + */ + protected $escapeWhenCastingToString = false; + /** * The methods that can be proxied. * @@ -54,6 +63,7 @@ trait EnumeratesValues 'average', 'avg', 'contains', + 'doesntContain', 'each', 'every', 'filter', @@ -713,6 +723,22 @@ trait EnumeratesValues return new $class($this); } + /** + * Pass the collection through a series of callable pipes and return the result. + * + * @param array<callable> $pipes + * @return mixed + */ + public function pipeThrough($pipes) + { + return static::make($pipes)->reduce( + function ($carry, $pipe) { + return $pipe($carry); + }, + $this, + ); + } + /** * Pass the collection to the given callback and then return it. * @@ -730,7 +756,7 @@ trait EnumeratesValues * Reduce the collection to a single value. * * @param callable $callback - * @param mixed $initial + * @param mixed $initial * @return mixed */ public function reduce(callable $callback, $initial = null) @@ -745,23 +771,60 @@ trait EnumeratesValues } /** - * Reduce an associative collection to a single value. + * Reduce the collection to multiple aggregate values. * * @param callable $callback - * @param mixed $initial - * @return mixed + * @param mixed ...$initial + * @return array + * + * @deprecated Use "reduceSpread" instead + * + * @throws \UnexpectedValueException */ - public function reduceWithKeys(callable $callback, $initial = null) + public function reduceMany(callable $callback, ...$initial) + { + return $this->reduceSpread($callback, ...$initial); + } + + /** + * Reduce the collection to multiple aggregate values. + * + * @param callable $callback + * @param mixed ...$initial + * @return array + * + * @throws \UnexpectedValueException + */ + public function reduceSpread(callable $callback, ...$initial) { $result = $initial; foreach ($this as $key => $value) { - $result = $callback($result, $value, $key); + $result = call_user_func_array($callback, array_merge($result, [$value, $key])); + + if (! is_array($result)) { + throw new UnexpectedValueException(sprintf( + "%s::reduceMany expects reducer to return an array, but got a '%s' instead.", + class_basename(static::class), gettype($result) + )); + } } return $result; } + /** + * Reduce an associative collection to a single value. + * + * @param callable $callback + * @param mixed $initial + * @return mixed + */ + public function reduceWithKeys(callable $callback, $initial = null) + { + return $this->reduce($callback, $initial); + } + /** * Create a collection of all elements that do not pass a given truth test. * @@ -779,28 +842,6 @@ trait EnumeratesValues }); } - /** - * Return only unique items from the collection array. - * - * @param string|callable|null $key - * @param bool $strict - * @return static - */ - public function unique($key = null, $strict = false) - { - $callback = $this->valueRetriever($key); - - $exists = []; - - return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { - if (in_array($id = $callback($item, $key), $exists, $strict)) { - return true; - } - - $exists[] = $id; - }); - } - /** * Return only unique items from the collection array using strict comparison. * @@ -839,6 +880,7 @@ trait EnumeratesValues * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return array_map(function ($value) { @@ -883,7 +925,22 @@ trait EnumeratesValues */ public function __toString() { - return $this->toJson(); + return $this->escapeWhenCastingToString + ? e($this->toJson()) + : $this->toJson(); + } + + /** + * Indicate that the model's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true) + { + $this->escapeWhenCastingToString = $escape; + + return $this; } /** diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php index d9b5fe7f..7e9fbd51 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php @@ -62,6 +62,16 @@ trait Macroable return isset(static::$macros[$name]); } + /** + * Flush the existing macros. + * + * @return void + */ + public static function flushMacros() + { + static::$macros = []; + } + /** * Dynamically handle calls to the class. * diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Tappable.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Tappable.php index 17e6b9e8..9d75d26f 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Tappable.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Tappable.php @@ -8,7 +8,7 @@ trait Tappable * Call the given Closure with this instance then return the instance. * * @param callable|null $callback - * @return mixed + * @return $this|\Tightenco\Collect\Support\HigherOrderTapProxy */ public function tap($callback = null) { diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php index 1ecffd3a..a9c04063 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php @@ -4,6 +4,7 @@ $aliases = [ Tightenco\Collect\Contracts\Support\Arrayable::class => Illuminate\Contracts\Support\Arrayable::class, Tightenco\Collect\Contracts\Support\Jsonable::class => Illuminate\Contracts\Support\Jsonable::class, Tightenco\Collect\Contracts\Support\Htmlable::class => Illuminate\Contracts\Support\Htmlable::class, + Tightenco\Collect\Contracts\Support\CanBeEscapedWhenCastToString::class => Illuminate\Contracts\Support\CanBeEscapedWhenCastToString::class, Tightenco\Collect\Support\Arr::class => Illuminate\Support\Arr::class, Tightenco\Collect\Support\Collection::class => Illuminate\Support\Collection::class, Tightenco\Collect\Support\Enumerable::class => Illuminate\Support\Enumerable::class, @@ -13,8 +14,11 @@ $aliases = [ Tightenco\Collect\Support\Traits\EnumeratesValues::class => Illuminate\Support\Traits\EnumeratesValues::class, ]; +# echo "\n\n-- Aliasing....\n---------------------------------------------\n\n"; + foreach ($aliases as $tighten => $illuminate) { if (! class_exists($illuminate) && ! interface_exists($illuminate) && ! trait_exists($illuminate)) { + # echo "Aliasing {$tighten} to {$illuminate}.\n"; class_alias($tighten, $illuminate); } } diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php index d7f9e0ef..886a1414 100644 --- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php +++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php @@ -6,19 +6,6 @@ use Tightenco\Collect\Support\HigherOrderTapProxy; use Symfony\Component\VarDumper\VarDumper; if (! class_exists(Illuminate\Support\Collection::class)) { - if (! function_exists('array_wrap')) { - /** - * If the given value is not an array, wrap it in one. - * - * @param mixed $value - * @return array - */ - function array_wrap($value) - { - return ! is_array($value) ? [$value] : $value; - } - } - if (! function_exists('collect')) { /** * Create a collection from the given value. @@ -39,9 +26,9 @@ if (! class_exists(Illuminate\Support\Collection::class)) { * @param mixed $value * @return mixed */ - function value($value) + function value($value, ...$args) { - return $value instanceof Closure ? $value() : $value; + return $value instanceof Closure ? $value(...$args) : $value; } } @@ -49,9 +36,9 @@ if (! class_exists(Illuminate\Support\Collection::class)) { /** * Get an item from an array or object using "dot" notation. * - * @param mixed $target - * @param string|array $key - * @param mixed $default + * @param mixed $target + * @param string|array|int|null $key + * @param mixed $default * @return mixed */ function data_get($target, $key, $default = null) @@ -62,7 +49,13 @@ if (! class_exists(Illuminate\Support\Collection::class)) { $key = is_array($key) ? $key : explode('.', $key); - while (($segment = array_shift($key)) !== null) { + foreach ($key as $i => $segment) { + unset($key[$i]); + + if (is_null($segment)) { + return $target; + } + if ($segment === '*') { if ($target instanceof Collection) { $target = $target->all(); @@ -70,7 +63,11 @@ if (! class_exists(Illuminate\Support\Collection::class)) { return value($default); } - $result = Arr::pluck($target, $key); + $result = []; + + foreach ($target as $item) { + $result[] = data_get($item, $key); + } return in_array('*', $key) ? Arr::collapse($result) : $result; } @@ -108,32 +105,18 @@ if (! class_exists(Illuminate\Support\Collection::class)) { } } - if (! function_exists('with')) { + if (! function_exists('class_basename')) { /** - * Return the given object. Useful for chaining. + * Get the class "basename" of the given object / class. * - * @param mixed $object - * @return mixed + * @param string|object $class + * @return string */ - function with($object) + function class_basename($class) { - return $object; - } - } + $class = is_object($class) ? get_class($class) : $class; - if (! function_exists('dd')) { - /** - * Dump the passed variables and end the script. - * - * @param mixed - * @return void - */ - function dd(...$args) - { - foreach ($args as $x) { - VarDumper::dump($x); - } - die(1); + return basename(str_replace('\\', '/', $class)); } } } diff --git a/data/web/inc/lib/vendor/twig/twig/.gitattributes b/data/web/inc/lib/vendor/twig/twig/.gitattributes index 75e18f85..1ce832b5 100644 --- a/data/web/inc/lib/vendor/twig/twig/.gitattributes +++ b/data/web/inc/lib/vendor/twig/twig/.gitattributes @@ -1,3 +1,4 @@ +/doc/** export-ignore /extra/** export-ignore /tests export-ignore /phpunit.xml.dist export-ignore diff --git a/data/web/inc/lib/vendor/twig/twig/.github/workflows/ci.yml b/data/web/inc/lib/vendor/twig/twig/.github/workflows/ci.yml index dfc40c30..140483cc 100644 --- a/data/web/inc/lib/vendor/twig/twig/.github/workflows/ci.yml +++ b/data/web/inc/lib/vendor/twig/twig/.github/workflows/ci.yml @@ -24,10 +24,9 @@ jobs: - '7.3' - '7.4' - '8.0' + - '8.1' composer-options: [''] experimental: [false] - include: - - { php-version: '8.1', experimental: true, composer-options: '--ignore-platform-req=php' } steps: - name: "Checkout code" @@ -83,6 +82,7 @@ jobs: - '7.3' - '7.4' - '8.0' + - '8.1' extension: - 'extra/cache-extra' - 'extra/cssinliner-extra' @@ -92,6 +92,8 @@ jobs: - 'extra/markdown-extra' - 'extra/string-extra' - 'extra/twig-extra-bundle' + composer-options: [''] + experimental: [false] steps: - name: "Checkout code" @@ -169,5 +171,5 @@ jobs: # ini-values: memory_limit=-1 # tools: composer:v2 # -# - run: ./drupal_test.sh +# - run: bash ./tests/drupal_test.sh # shell: "bash" diff --git a/data/web/inc/lib/vendor/twig/twig/CHANGELOG b/data/web/inc/lib/vendor/twig/twig/CHANGELOG index 832e639d..459c05af 100644 --- a/data/web/inc/lib/vendor/twig/twig/CHANGELOG +++ b/data/web/inc/lib/vendor/twig/twig/CHANGELOG @@ -1,3 +1,34 @@ +# 3.3.8 (2022-02-04) + + * Fix a security issue when in a sandbox: the `sort` filter must require a Closure for the `arrow` parameter + +# 3.3.7 (2022-01-03) + +* Allow more null support when Twig expects a string (for better 8.1 support) +* Only use Commonmark extensions if markdown enabled + +# 3.3.6 (2022-01-03) + +* Only use Commonmark extensions if markdown enabled + +# 3.3.5 (2022-01-03) + +* Allow CommonMark extensions to easily be added +* Allow null when Twig expects a string (for better 8.1 support) +* Make some performance optimizations +* Allow Symfony translation contract v3+ + +# 3.3.4 (2021-11-25) + + * Bump minimum supported Symfony component versions + * Fix a deprecated message + +# 3.3.3 (2021-09-17) + + * Allow Symfony 6 + * Improve compatibility with PHP 8.1 + * Explicitly specify the encoding for mb_ord in JS escaper + # 3.3.2 (2021-05-16) * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" @@ -87,1535 +118,3 @@ * removed the "base_template_class" option on Twig\Environment * bumped minimum PHP version to 7.2 * removed PSR-0 classes - -# 2.14.6 (2021-XX-XX) - - * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" - -# 2.14.5 (2021-05-12) - - * Fix PHP 8.1 compatibility - * Throw a proper exception when a template name is an absolute path (as it has never been supported) - -# 2.14.4 (2021-03-10) - - * Add the slug filter - -# 2.14.3 (2021-01-05) - - * Fix extra bundle compat with older versions of Symfony - -# 2.14.2 (2021-01-05) - - * Fix "odd" not working for negative numbers - -# 2.14.1 (2020-10-27) - -* Fix "include(template_from_string())" - -# 2.14.0 (2020-10-21) - - * Fix sandbox support when using "include(template_from_string())" - * Make round brackets optional for one argument tests like "same as" or "divisible by" - * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a } - * Drop PHP 7.1 support - -# 2.13.1 (2020-08-05) - - * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag - * Fix a regression when not using a space before an operator - * Restrict callables to closures in filters - * Allow trailing commas in argument lists (in calls as well as definitions) - -# 2.13.0 (2020-07-05) - - * Fix options not taken into account when using "Michelf\MarkdownExtra" - * Fix "Twig\Extra\Intl\IntlExtension::getCountryName()" to accept "null" as a first argument - * Drop support for PHP 7.0 - * Throw exception in case non-Traversable data is passed to "filter" - * Fix context optimization on PHP 7.4 - * Fix PHP 8 compatibility - * Fix ambiguous syntax parsing - -# 2.12.5 (2020-02-11) - - * Add a check to ensure that iconv() is defined - -# 2.12.4 (2020-02-11) - - * Avoid exceptions when an intl resource is not found - * Fix implementation of case-insensitivity for method names - -# 2.12.3 (2019-12-28) - - * fixed Symfony 5.0 support for the HTML extra extension - * fixed number formatter in Intl extra extension when using a formatter prototype - -# 2.12.2 (2019-11-11) - - * added supported for exponential numbers - -# 2.12.1 (2019-10-17) - - * added the String extension in the "extra" repositories: "u" filter - -# 2.12.0 (2019-10-05) - - * added the spaceship operator ("<=>"), useful when using an arrow function in the "sort" filter - * added support for an "arrow" function on the "sort" filter - * added the CssInliner extension in the "extra" repositories: "inline_css" - filter - * added the Inky extension in the "extra" repositories: "inky_to_html" filter - * added Intl extension in the "extra" repositories: "country_name", - "currency_name", "currency_symbol", "language_name", "locale_name", - "timezone_name", "format_currency", "format_number", - "format_*_number", "format_datetime", "format_date", and "format_time" - filters, and the "country_timezones" function - * added the Markdown extension in the "extra" repositories: "markdown_to_html", - and "html_to_markdown" filters - * added the HtmlExtension extension in the "extra" repositories: "date_uri" - filter, and "html_classes" function - * optimized "block('foo') ?? 'bar'" - * fixed the empty test on Traversable instances - * fixed array_key_exists() on objects - * fixed cache when opcache is installed but disabled - * fixed using macros in arrow functions - * fixed split filter on edge case - -# 2.11.3 (2019-06-18) - - * display partial output (PHP buffer) when an error occurs in debug mode - * fixed the filter filter (allow the result to be used several times) - * fixed macro auto-import when a template contains only macros - -# 2.11.2 (2019-06-05) - - * fixed macro auto-import - -# 2.11.1 (2019-06-04) - - * added support for "Twig\Markup" instances in the "in" test (again) - * allowed string operators as variables names in assignments - * fixed support for macros defined in parent templates - -# 2.11.0 (2019-05-31) - - * added the possibility to register classes/interfaces as being safe for the escaper ("EscaperExtension::addSafeClass()") - * deprecated CoreExtension::setEscaper() and CoreExtension::getEscapers() in favor of the same methods on EscaperExtension - * macros are now auto-imported in the template they are defined (under the ``_self`` variable) - * added support for macros on "is defined" tests - * fixed macros "import" when using the same name in the parent and child templates - * fixed recursive macros - * macros imported "globally" in a template are now available in macros without re-importing them - * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance) - * fixed a PHP fatal error when calling a macro imported in a block in a nested block - * fixed a PHP fatal error when calling a macro imported in the template in another macro - * fixed wrong error message on "import" and "from" - -# 2.10.0 (2019-05-14) - - * deprecated "if" conditions on "for" tags - * added "filter", "map", and "reduce" filters (and support for arrow functions) - * fixed partial output leak when a PHP fatal error occurs - * optimized context access on PHP 7.4 - -# 2.9.0 (2019-04-28) - - * deprecated returning "false" to remove a Node from NodeVisitorInterface::leaveNode() - * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) - * deprecated the "filter" tag (use the "apply" tag instead) - * added the "apply" tag as a replacement for the "filter" tag - * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning) - * added support for "Twig\Markup" instances in the "in" test - * fixed "import" when macros are stored in a template string - * fixed Lexer when using custom options containing the # char - * added template line number to twig_get_attribute() - -# 2.8.1 (2019-04-16) - - * fixed EscaperNodeVisitor - * deprecated passing a 3rd, 4th, and 5th arguments to the Sandbox exception classes - * deprecated Node::setTemplateName() in favor of Node::setSourceContext() - -# 2.8.0 (2019-04-16) - - * added Traversable support for the length filter - * fixed some wrong location in error messages - * made exception creation faster - * made escaping on ternary expressions (?: and ??) more fine-grained - * added the possibility to give a nice name to string templates (template_from_string function) - * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags) - * fixed "include" with "ignore missing" when an error loading occurs in the included template - * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) - * added the "column" filter - -# 2.7.4 (2019-03-23) - - * fixed variadic support - * fixed CheckToStringNode implementation (broken when a function/filter is variadic) - -# 2.7.3 (2019-03-21) - - * fixed the spaceless filter so that it behaves like the spaceless tag - * fixed BC break on Environment::resolveTemplate() - * allowed Traversable objects to be used in the "with" tag - * allowed Traversable objects to be used in the "with" tag - * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags - -# 2.7.2 (2019-03-12) - - * added TemplateWrapper::getTemplateName() - -# 2.7.1 (2019-03-12) - - * fixed class aliases - -# 2.7.0 (2019-03-12) - - * fixed sandbox security issue (under some circumstances, calling the - __toString() method on an object was possible even if not allowed by the - security policy) - * fixed batch filter clobbers array keys when fill parameter is used - * added preserveKeys support for the batch filter - * fixed "embed" support when used from "template_from_string" - * deprecated passing a Twig\Template to Twig\Environment::load()/Twig\Environment::resolveTemplate() - * added the possibility to pass a TemplateWrapper to Twig\Environment::load() - * marked Twig\Environment::getTemplateClass() as internal (implementation detail) - * improved the performance of the sandbox - * deprecated the spaceless tag - * added a spaceless filter - * added max value to the "random" function - * deprecated Twig\Extension\InitRuntimeInterface - * deprecated Twig\Loader\ExistsLoaderInterface - * deprecated PSR-0 classes in favor of namespaced ones - * made namespace classes the default classes (PSR-0 ones are aliases now) - * added Twig\Loader\ChainLoader::getLoaders() - * removed duplicated directory separator in FilesystemLoader - * deprecated the "base_template_class" option on Twig\Environment - * deprecated the Twig\Environment::getBaseTemplateClass() and - Twig\Environment::setBaseTemplateClass() methods - * changed internal code to use the namespaced classes as much as possible - * deprecated Twig_Parser::isReservedMacroName() - -# 2.6.2 (2019-01-14) - - * fixed regression (key exists check for non ArrayObject objects) - -# 2.6.1 (2019-01-14) - - * fixed ArrayObject access with a null value - * fixed embedded templates starting with a BOM - * fixed using a Twig_TemplateWrapper instance as an argument to extends - * fixed error location when calling an undefined block - * deprecated passing a string as a source on Twig_Error - * switched generated code to use the PHP short array notation - * fixed float representation in compiled templates - * added a second argument to the join filter (last separator configuration) - -# 2.6.0 (2018-12-16) - - * made sure twig_include returns a string - * fixed multi-byte UFT-8 in escape('html_attr') - * added the "deprecated" tag - * added support for dynamically named tests - * fixed GlobalsInterface extended class - * fixed filesystem loader throwing an exception instead of returning false - -# 2.5.0 (2018-07-13) - - * deprecated using the spaceless tag at the root level of a child template (noop anyway) - * deprecated the possibility to define a block in a non-capturing block in a child template - * added the Symfony ctype polyfill as a dependency - * fixed reporting the proper location for errors compiled in templates - * fixed the error handling for the optimized extension-based function calls - * ensured that syntax errors are triggered with the right line - * "js" filter now produces valid JSON - -# 2.4.8 (2018-04-02) - - * fixed a regression when using the "default" filter or the "defined" test on non-existing arrays - -# 2.4.7 (2018-03-20) - - * optimized runtime performance - * optimized parser performance by inlining the constant values - * fixed block names unicity - * fixed counting children of SimpleXMLElement objects - * added missing else clause to avoid infinite loops - * fixed .. (range operator) in sandbox policy - -# 2.4.6 (2018-03-03) - - * fixed a regression in the way the profiler is registered in templates - -# 2.4.5 (2018-03-02) - - * optimized the performance of calling an extension method at runtime - * optimized the performance of the dot operator for array and method calls - * added an exception when using "===" instead of "same as" - * fixed possible array to string conversion concealing actual error - * made variable names deterministic in compiled templates - * fixed length filter when passing an instance of IteratorAggregate - * fixed Environment::resolveTemplate to accept instances of TemplateWrapper - -# 2.4.4 (2017-09-27) - - * added Twig_Profiler_Profile::reset() - * fixed use TokenParser to return an empty Node - * added RuntimeExtensionInterface - * added circular reference detection when loading templates - * added support for runtime loaders in IntegrationTestCase - * fixed deprecation when using Twig_Profiler_Dumper_Html - * removed @final from Twig_Profiler_Dumper_Text - -# 2.4.3 (2017-06-07) - - * fixed namespaces introduction - -# 2.4.2 (2017-06-05) - - * fixed namespaces introduction - -# 2.4.1 (2017-06-05) - - * fixed namespaces introduction - -# 2.4.0 (2017-06-05) - - * added support for PHPUnit 6 when testing extensions - * fixed PHP 7.2 compatibility - * fixed template name generation in Twig_Environment::createTemplate() - * removed final tag on Twig_TokenParser_Include - * dropped HHVM support - * added namespaced aliases for all (non-deprecated) classes and interfaces - * marked Twig_Filter, Twig_Function, Twig_Test, Twig_Node_Module and Twig_Profiler_Profile as final via the @final annotation - -# 2.3.2 (2017-04-20) - - * fixed edge case in the method cache for Twig attributes - -# 2.3.1 (2017-04-18) - - * fixed the empty() test - -# 2.3.0 (2017-03-22) - - * fixed a race condition handling when writing cache files - * "length" filter now returns string length when applied to an object that does - not implement \Countable but provides __toString() - * "empty" test will now consider the return value of the __toString() method for - objects implement __toString() but not \Countable - * fixed JS escaping for unicode characters with higher code points - * added error message when calling `parent()` in a block that doesn't exist in the parent template - -# 2.2.0 (2017-02-26) - - * added a PSR-11 compatible runtime loader - * added `side` argument to `trim` to allow left or right trimming only. - -# 2.1.0 (2017-01-11) - - * fixed twig_get_attribute() - * added Twig_NodeCaptureInterface for nodes that capture all output - -# 2.0.0 (2017-01-05) - - * removed the C extension - * moved Twig_Environment::getAttribute() to twig_get_attribute() - * removed Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler() - * removed Twig_Compiler::getFilename() - * added hasser support in Twig_Template::getAttribute() - * sped up the json_encode filter - * removed reserved macro names; all names can be used as macro - * removed Twig_Template::getEnvironment() - * changed _self variable to return the current template name - * made the loader a required argument of Twig_Environment constructor - * removed Twig_Environment::clearTemplateCache() - * removed Twig_Autoloader (use Composer instead) - * removed `true` as an equivalent to `html` for the auto-escaping strategy - * removed pre-1.8 autoescape tag syntax - * dropped support for PHP 5.x - * removed the ability to register a global variable after the runtime or the extensions have been initialized - * improved the performance of the filesystem loader - * removed features that were deprecated in 1.x - -# 1.44.4 (2021-XX-XX) - - * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" - -# 1.44.3 (2021-05-12) - - * Fix PHP 8.1 compatibility - * Throw a proper exception when a template name is an absolute path (as it has never been supported) - -# 1.44.2 (2021-01-05) - - * Fix "odd" not working for negative numbers - -# 1.44.1 (2020-10-27) - - * Fix "include(template_from_string())" - -# 1.44.0 (2020-10-21) - - * Remove implicit dependency on ext/iconv in JS escaper - * Fix sandbox support when using "include(template_from_string())" - * Make round brackets optional for one argument tests like "same as" or "divisible by" - * Add support for ES2015 style object initialisation shortcut { a } is the same as { 'a': a } - * Fix filter(), map(), and reduce() to throw a RuntimeError instead of a PHP TypeError - * Drop PHP 7.1 support - -# 1.43.1 (2020-08-05) - - * Fix sandbox not disabled if syntax error occurs within {% sandbox %} tag - * Fix a regression when not using a space before an operator - * Restrict callables to closures in filters - * Allow trailing commas in argument lists (in calls as well as definitions) - -# 1.43.0 (2020-07-05) - - * Throw exception in case non-Traversable data is passed to "filter" - * Fix context optimization on PHP 7.4 - * Fix PHP 8 compatibility - * Drop PHP 5.5 5.6, and 7.0 support - * Fix ambiguous syntax parsing - * In sandbox, the `filter`, `map` and `reduce` filters require Closures in `arrow` parameter - -# 1.42.5 (2020-02-11) - - * Fix implementation of case-insensitivity for method names - -# 1.42.4 (2019-11-11) - - * optimized "block('foo') ?? 'bar" - * added supported for exponential numbers - -# 1.42.3 (2019-08-24) - - * fixed the "split" filter when the delimiter is "0" - * fixed the "empty" test on Traversable instances - * fixed cache when opcache is installed but disabled - * fixed PHP 7.4 compatibility - * bumped the minimal PHP version to 5.5 - -# 1.42.2 (2019-06-18) - - * Display partial output (PHP buffer) when an error occurs in debug mode - -# 1.42.1 (2019-06-04) - - * added support for "Twig\Markup" instances in the "in" test (again) - * allowed string operators as variables names in assignments - -# 1.42.0 (2019-05-31) - - * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance) - * fixed a PHP fatal error when calling a macro imported in a block in a nested block - * fixed a PHP fatal error when calling a macro imported in the template in another macro - * fixed wrong error message on "import" and "from" - -# 1.41.0 (2019-05-14) - - * fixed support for PHP 7.4 - * added "filter", "map", and "reduce" filters (and support for arrow functions) - * fixed partial output leak when a PHP fatal error occurs - * optimized context access on PHP 7.4 - -# 1.40.1 (2019-04-29) - -# fixed regression in NodeTraverser - -# 1.40.0 (2019-04-28) - - * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) - * added the "apply" tag as a replacement for the "filter" tag - * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning) - * added support for "Twig\Markup" instances in the "in" test - * fixed Lexer when using custom options containing the # char - * fixed "import" when macros are stored in a template string - -# 1.39.1 (2019-04-16) - - * fixed EscaperNodeVisitor - -# 1.39.0 (2019-04-16) - - * added Traversable support for the length filter - * fixed some wrong location in error messages - * made exception creation faster - * made escaping on ternary expressions (?: and ??) more fine-grained - * added the possibility to give a nice name to string templates (template_from_string function) - * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags) - * fixed "include" with "ignore missing" when an error loading occurs in the included template - * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) - -# 1.38.4 (2019-03-23) - - * fixed CheckToStringNode implementation (broken when a function/filter is variadic) - -# 1.38.3 (2019-03-21) - - * fixed the spaceless filter so that it behaves like the spaceless tag - * fixed BC break on Environment::resolveTemplate() - * fixed the bundled Autoloader to also load namespaced classes - * allowed Traversable objects to be used in the "with" tag - * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags - -# 1.38.2 (2019-03-12) - - * added TemplateWrapper::getTemplateName() - -# 1.38.1 (2019-03-12) - - * fixed class aliases - -# 1.38.0 (2019-03-12) - - * fixed sandbox security issue (under some circumstances, calling the - __toString() method on an object was possible even if not allowed by the - security policy) - * fixed batch filter clobbers array keys when fill parameter is used - * added preserveKeys support for the batch filter - * fixed "embed" support when used from "template_from_string" - * added the possibility to pass a TemplateWrapper to Twig\Environment::load() - * improved the performance of the sandbox - * added a spaceless filter - * added max value to the "random" function - * made namespace classes the default classes (PSR-0 ones are aliases now) - * removed duplicated directory separator in FilesystemLoader - * added Twig\Loader\ChainLoader::getLoaders() - * changed internal code to use the namespaced classes as much as possible - -# 1.37.1 (2019-01-14) - - * fixed regression (key exists check for non ArrayObject objects) - * fixed logic in TemplateWrapper - -# 1.37.0 (2019-01-14) - - * fixed ArrayObject access with a null value - * fixed embedded templates starting with a BOM - * fixed using a Twig_TemplateWrapper instance as an argument to extends - * switched generated code to use the PHP short array notation - * dropped PHP 5.3 support - * fixed float representation in compiled templates - * added a second argument to the join filter (last separator configuration) - -# 1.36.0 (2018-12-16) - - * made sure twig_include returns a string - * fixed multi-byte UFT-8 in escape('html_attr') - * added the "deprecated" tag - * added support for dynamically named tests - * fixed GlobalsInterface extended class - * fixed filesystem loader throwing an exception instead of returning false - -# 1.35.4 (2018-07-13) - - * ensured that syntax errors are triggered with the right line - * added the Symfony ctype polyfill as a dependency - * "js" filter now produces valid JSON - -# 1.35.3 (2018-03-20) - - * fixed block names unicity - * fixed counting children of SimpleXMLElement objects - * added missing else clause to avoid infinite loops - * fixed .. (range operator) in sandbox policy - -# 1.35.2 (2018-03-03) - - * fixed a regression in the way the profiler is registered in templates - -# 1.35.1 (2018-03-02) - - * added an exception when using "===" instead of "same as" - * fixed possible array to string conversion concealing actual error - * made variable names deterministic in compiled templates - * fixed length filter when passing an instance of IteratorAggregate - * fixed Environment::resolveTemplate to accept instances of TemplateWrapper - -# 1.35.0 (2017-09-27) - - * added Twig_Profiler_Profile::reset() - * fixed use TokenParser to return an empty Node - * added RuntimeExtensionInterface - * added circular reference detection when loading templates - -# 1.34.4 (2017-07-04) - - * added support for runtime loaders in IntegrationTestCase - * fixed deprecation when using Twig_Profiler_Dumper_Html - -# 1.34.3 (2017-06-07) - - * fixed namespaces introduction - -# 1.34.2 (2017-06-05) - - * fixed namespaces introduction - -# 1.34.1 (2017-06-05) - - * fixed namespaces introduction - -# 1.34.0 (2017-06-05) - - * added support for PHPUnit 6 when testing extensions - * fixed PHP 7.2 compatibility - * fixed template name generation in Twig_Environment::createTemplate() - * removed final tag on Twig_TokenParser_Include - * added namespaced aliases for all (non-deprecated) classes and interfaces - * dropped HHVM support - * dropped PHP 5.2 support - -# 1.33.2 (2017-04-20) - - * fixed edge case in the method cache for Twig attributes - -# 1.33.1 (2017-04-18) - - * fixed the empty() test - -# 1.33.0 (2017-03-22) - - * fixed a race condition handling when writing cache files - * "length" filter now returns string length when applied to an object that does - not implement \Countable but provides __toString() - * "empty" test will now consider the return value of the __toString() method for - objects implement __toString() but not \Countable - * fixed JS escaping for unicode characters with higher code points - -# 1.32.0 (2017-02-26) - - * fixed deprecation notice in Twig_Util_DeprecationCollector - * added a PSR-11 compatible runtime loader - * added `side` argument to `trim` to allow left or right trimming only. - -# 1.31.0 (2017-01-11) - - * added Twig_NodeCaptureInterface for nodes that capture all output - * fixed marking the environment as initialized too early - * fixed C89 compat for the C extension - * turned fatal error into exception when a previously generated cache is corrupted - * fixed offline cache warm-ups for embedded templates - -# 1.30.0 (2016-12-23) - - * added Twig_FactoryRuntimeLoader - * deprecated function/test/filter/tag overriding - * deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr - -# 1.29.0 (2016-12-13) - - * fixed sandbox being left enabled if an exception is thrown while rendering - * marked some classes as being final (via @final) - * made Twig_Error report real source path when possible - * added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 (replaces {{ _self.templateName }}) - * deprecated silent display of undefined blocks - * deprecated support for mbstring.func_overload != 0 - -# 1.28.2 (2016-11-23) - - * fixed precedence between getFoo() and isFoo() in Twig_Template::getAttribute() - * improved a deprecation message - -# 1.28.1 (2016-11-18) - - * fixed block() function when used with a template argument - -# 1.28.0 (2016-11-17) - - * added support for the PHP 7 null coalescing operator for the ?? Twig implementation - * exposed a way to access template data and methods in a portable way - * changed context access to use the PHP 7 null coalescing operator when available - * added the "with" tag - * added support for a custom template on the block() function - * added "is defined" support for block() and constant() - * optimized the way attributes are fetched - -# 1.27.0 (2016-10-25) - - * deprecated Twig_Parser::getEnvironment() - * deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor() - * deprecated Twig_Compiler::addIndentation() - * fixed regression when registering two extensions having the same class name - * deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead) - * fixed the filesystem loader with relative paths - * deprecated Twig_Node::getLine() in favor of Twig_Node::getTemplateLine() - * deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext() - * deprecated Twig_Node::getFilename() in favor of Twig_Node::getTemplateName() - * deprecated the "filename" escaping strategy (use "name" instead) - * added Twig_Source to hold information about the original template - * deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() in favor of Twig_Error::getTemplateName() and Twig_Error::setTemplateName() - * deprecated Parser::getFilename() - * fixed template paths when a template name contains a protocol like vfs:// - * improved debugging with Twig_Sandbox_SecurityError exceptions for disallowed methods and properties - -# 1.26.1 (2016-10-05) - - * removed template source code from generated template classes when debug is disabled - * fixed default implementation of Twig_Template::getDebugInfo() for better BC - * fixed regression on static calls for functions/filters/tests - -# 1.26.0 (2016-10-02) - - * added template cache invalidation based on more environment options - * added a missing deprecation notice - * fixed template paths when a template is stored in a PHAR file - * allowed filters/functions/tests implementation to use a different class than the extension they belong to - * deprecated Twig_ExtensionInterface::getName() - -# 1.25.0 (2016-09-21) - - * changed the way we store template source in template classes - * removed usage of realpath in cache keys - * fixed Twig cache sharing when used with different versions of PHP - * removed embed parent workaround for simple use cases - * deprecated the ability to store non Node instances in Node::$nodes - * deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler() - * deprecated Twig_Compiler::getFilename() - -# 1.24.2 (2016-09-01) - - * fixed static callables - * fixed a potential PHP warning when loading the cache - * fixed a case where the autoescaping does not work as expected - -# 1.24.1 (2016-05-30) - - * fixed reserved keywords (forbids true, false, null and none keywords for variables names) - * fixed support for PHP7 (Throwable support) - * marked the following methods as being internals on Twig_Environment: - getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(), - getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(), - getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension() - -# 1.24.0 (2016-01-25) - - * adding support for the ?? operator - * fixed the defined test when used on a constant, a map, or a sequence - * undeprecated _self (should only be used to get the template name, not the template instance) - * fixed parsing on PHP7 - -# 1.23.3 (2016-01-11) - - * fixed typo - -# 1.23.2 (2015-01-11) - - * added versions in deprecated messages - * made file cache tolerant for trailing (back)slashes on directory configuration - * deprecated unused Twig_Node_Expression_ExtensionReference class - -# 1.23.1 (2015-11-05) - - * fixed some exception messages which triggered PHP warnings - * fixed BC on Twig_Test_NodeTestCase - -# 1.23.0 (2015-10-29) - - * deprecated the possibility to override an extension by registering another one with the same name - * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC) - * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC) - * deprecated Twig_Environment::computeAlternatives() - -# 1.22.3 (2015-10-13) - - * fixed regression when using null as a cache strategy - * improved performance when checking template freshness - * fixed warnings when loaded templates do not exist - * fixed template class name generation to prevent possible collisions - * fixed logic for custom escapers to call them even on integers and null values - * changed template cache names to take into account the Twig C extension - -# 1.22.2 (2015-09-22) - - * fixed a race condition in template loading - -# 1.22.1 (2015-09-15) - - * fixed regression in template_from_string - -# 1.22.0 (2015-09-13) - - * made Twig_Test_IntegrationTestCase more flexible - * added an option to force PHP bytecode invalidation when writing a compiled template into the cache - * fixed the profiler duration for the root node - * changed template cache names to take into account enabled extensions - * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(), - Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix() - * added a way to override the filesystem template cache system - * added a way to get the original template source from Twig_Template - -# 1.21.2 (2015-09-09) - - * fixed variable names for the deprecation triggering code - * fixed escaping strategy detection based on filename - * added Traversable support for replace, merge, and sort - * deprecated support for character by character replacement for the "replace" filter - -# 1.21.1 (2015-08-26) - - * fixed regression when using the deprecated Twig_Test_* classes - -# 1.21.0 (2015-08-24) - - * added deprecation notices for deprecated features - * added a deprecation "framework" for filters/functions/tests and test fixtures - -# 1.20.0 (2015-08-12) - - * forbid access to the Twig environment from templates and internal parts of Twig_Template - * fixed limited RCEs when in sandbox mode - * deprecated Twig_Template::getEnvironment() - * deprecated the _self variable for usage outside of the from and import tags - * added Twig_BaseNodeVisitor to ease the compatibility of node visitors - between 1.x and 2.x - -# 1.19.0 (2015-07-31) - - * fixed wrong error message when including an undefined template in a child template - * added support for variadic filters, functions, and tests - * added support for extra positional arguments in macros - * added ignore_missing flag to the source function - * fixed batch filter with zero items - * deprecated Twig_Environment::clearTemplateCache() - * fixed sandbox disabling when using the include function - -# 1.18.2 (2015-06-06) - - * fixed template/line guessing in exceptions for nested templates - * optimized the number of inodes and the size of realpath cache when using the cache - -# 1.18.1 (2015-04-19) - - * fixed memory leaks in the C extension - * deprecated Twig_Loader_String - * fixed the slice filter when used with a SimpleXMLElement object - * fixed filesystem loader when trying to load non-files (like directories) - -# 1.18.0 (2015-01-25) - - * fixed some error messages where the line was wrong (unknown variables or argument names) - * added a new way to customize the main Module node (via empty nodes) - * added Twig_Environment::createTemplate() to create a template from a string - * added a profiler - * fixed filesystem loader cache when different file paths are used for the same template - -# 1.17.0 (2015-01-14) - - * added a 'filename' autoescaping strategy, which dynamically chooses the - autoescaping strategy for a template based on template file extension. - -# 1.16.3 (2014-12-25) - - * fixed regression for dynamic parent templates - * fixed cache management with statcache - * fixed a regression in the slice filter - -# 1.16.2 (2014-10-17) - - * fixed timezone on dates as strings - * fixed 2-words test names when a custom node class is not used - * fixed macros when using an argument named like a PHP super global (like GET or POST) - * fixed date_modify when working with DateTimeImmutable - * optimized for loops - * fixed multi-byte characters handling in the split filter - * fixed a regression in the in operator - * fixed a regression in the slice filter - -# 1.16.1 (2014-10-10) - - * improved error reporting in a sandboxed template - * fixed missing error file/line information under certain circumstances - * fixed wrong error line number in some error messages - * fixed the in operator to use strict comparisons - * sped up the slice filter - * fixed for mb function overload mb_substr acting different - * fixed the attribute() function when passing a variable for the arguments - -# 1.16.0 (2014-07-05) - - * changed url_encode to always encode according to RFC 3986 - * fixed inheritance in a 'use'-hierarchy - * removed the __toString policy check when the sandbox is disabled - * fixed recursively calling blocks in templates with inheritance - -# 1.15.1 (2014-02-13) - - * fixed the conversion of the special '0000-00-00 00:00' date - * added an error message when trying to import an undefined block from a trait - * fixed a C extension crash when accessing defined but uninitialized property. - -# 1.15.0 (2013-12-06) - - * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException - * added min and max functions - * added the round filter - * fixed a bug that prevented the optimizers to be enabled/disabled selectively - * fixed first and last filters for UTF-8 strings - * added a source function to include the content of a template without rendering it - * fixed the C extension sandbox behavior when get or set is prepend to method name - -# 1.14.2 (2013-10-30) - - * fixed error filename/line when an error occurs in an included file - * allowed operators that contain whitespaces to have more than one whitespace - * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by") - -# 1.14.1 (2013-10-15) - - * made it possible to use named operators as variables - * fixed the possibility to have a variable named 'matches' - * added support for PHP 5.5 DateTimeInterface - -# 1.14.0 (2013-10-03) - - * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy - * added new operators: ends with, starts with, and matches - * fixed some compatibility issues with HHVM - * added a way to add custom escaping strategies - * fixed the C extension compilation on Windows - * fixed the batch filter when using a fill argument with an exact match of elements to batch - * fixed the filesystem loader cache when a template name exists in several namespaces - * fixed template_from_string when the template includes or extends other ones - * fixed a crash of the C extension on an edge case - -# 1.13.2 (2013-08-03) - - * fixed the error line number for an error occurs in and embedded template - * fixed crashes of the C extension on some edge cases - -# 1.13.1 (2013-06-06) - - * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem - * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface - * adjusted backtrace call to reduce memory usage when an error occurs - * added support for object instances as the second argument of the constant test - * fixed the include function when used in an assignment - -# 1.13.0 (2013-05-10) - - * fixed getting a numeric-like item on a variable ('09' for instance) - * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access: - `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`) - * made the escape filter 20% faster for happy path (escaping string for html with UTF-8) - * changed ☃ to § in tests - * enforced usage of named arguments after positional ones - -# 1.12.3 (2013-04-08) - - * fixed a security issue in the filesystem loader where it was possible to include a template one - level above the configured path - * fixed fatal error that should be an exception when adding a filter/function/test too late - * added a batch filter - * added support for encoding an array as query string in the url_encode filter - -# 1.12.2 (2013-02-09) - - * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00) - * fixed globals when getGlobals is called early on - * added the first and last filter - -# 1.12.1 (2013-01-15) - - * added support for object instances as the second argument of the constant function - * relaxed globals management to avoid a BC break - * added support for {{ some_string[:2] }} - -# 1.12.0 (2013-01-08) - - * added verbatim as an alias for the raw tag to avoid confusion with the raw filter - * fixed registration of tests and functions as anonymous functions - * fixed globals management - -# 1.12.0-RC1 (2012-12-29) - - * added an include function (does the same as the include tag but in a more flexible way) - * added the ability to use any PHP callable to define filters, functions, and tests - * added a syntax error when using a loop variable that is not defined - * added the ability to set default values for macro arguments - * added support for named arguments for filters, tests, and functions - * moved filters/functions/tests syntax errors to the parser - * added support for extended ternary operator syntaxes - -# 1.11.1 (2012-11-11) - - * fixed debug info line numbering (was off by 2) - * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1) - * optimized variable access on PHP 5.4 - * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX) - -# 1.11.0 (2012-11-07) - - * fixed macro compilation when a variable name is a PHP reserved keyword - * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone - * fixed bitwise operator precedences - * added the template_from_string function - * fixed default timezone usage for the date function - * optimized the way Twig exceptions are managed (to make them faster) - * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster) - -# 1.10.3 (2012-10-19) - - * fixed wrong template location in some error messages - * reverted a BC break introduced in 1.10.2 - * added a split filter - -# 1.10.2 (2012-10-15) - - * fixed macro calls on PHP 5.4 - -# 1.10.1 (2012-10-15) - - * made a speed optimization to macro calls when imported via the "import" tag - * fixed C extension compilation on Windows - * fixed a segfault in the C extension when using DateTime objects - -# 1.10.0 (2012-09-28) - - * extracted functional tests framework to make it reusable for third-party extensions - * added namespaced templates support in Twig_Loader_Filesystem - * added Twig_Loader_Filesystem::prependPath() - * fixed an error when a token parser pass a closure as a test to the subparse() method - -# 1.9.2 (2012-08-25) - - * fixed the in operator for objects that contain circular references - * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface - -# 1.9.1 (2012-07-22) - - * optimized macro calls when auto-escaping is on - * fixed wrong parent class for Twig_Function_Node - * made Twig_Loader_Chain more explicit about problems - -# 1.9.0 (2012-07-13) - - * made the parsing independent of the template loaders - * fixed exception trace when an error occurs when rendering a child template - * added escaping strategies for CSS, URL, and HTML attributes - * fixed nested embed tag calls - * added the date_modify filter - -# 1.8.3 (2012-06-17) - - * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash - * fixed escaping when a project defines a function named html or js - * fixed chmod mode to apply the umask correctly - -# 1.8.2 (2012-05-30) - - * added the abs filter - * fixed a regression when using a number in template attributes - * fixed compiler when mbstring.func_overload is set to 2 - * fixed DateTimeZone support in date filter - -# 1.8.1 (2012-05-17) - - * fixed a regression when dealing with SimpleXMLElement instances in templates - * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini - * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ) - -# 1.8.0 (2012-05-08) - - * enforced interface when adding tests, filters, functions, and node visitors from extensions - * fixed a side-effect of the date filter where the timezone might be changed - * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer) - * added a way to dynamically change the auto-escaping strategy according to the template "filename" - * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html) - * added an embed tag - -# 1.7.0 (2012-04-24) - - * fixed a PHP warning when using CIFS - * fixed template line number in some exceptions - * added an iterable test - * added an error when defining two blocks with the same name in a template - * added the preserves_safety option for filters - * fixed a PHP notice when trying to access a key on a non-object/array variable - * enhanced error reporting when the template file is an instance of SplFileInfo - * added Twig_Environment::mergeGlobals() - * added compilation checks to avoid misuses of the sandbox tag - * fixed filesystem loader freshness logic for high traffic websites - * fixed random function when charset is null - -# 1.6.5 (2012-04-11) - - * fixed a regression when a template only extends another one without defining any blocks - -# 1.6.4 (2012-04-02) - - * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3 - * fixed performance when compiling large files - * optimized parent template creation when the template does not use dynamic inheritance - -# 1.6.3 (2012-03-22) - - * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension - * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot - * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate - -# 1.6.2 (2012-03-18) - - * fixed sandbox mode when used with inheritance - * added preserveKeys support for the slice filter - * fixed the date filter when a DateTime instance is passed with a specific timezone - * added a trim filter - -# 1.6.1 (2012-02-29) - - * fixed Twig C extension - * removed the creation of Twig_Markup instances when not needed - * added a way to set the default global timezone for dates - * fixed the slice filter on strings when the length is not specified - * fixed the creation of the cache directory in case of a race condition - -# 1.6.0 (2012-02-04) - - * fixed raw blocks when used with the whitespace trim option - * made a speed optimization to macro calls when imported via the "from" tag - * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added - * fixed the attribute function when passing arguments - * added slice notation support for the [] operator (syntactic sugar for the slice operator) - * added a slice filter - * added string support for the reverse filter - * fixed the empty test and the length filter for Twig_Markup instances - * added a date function to ease date comparison - * fixed unary operators precedence - * added recursive parsing support in the parser - * added string and integer handling for the random function - -# 1.5.1 (2012-01-05) - - * fixed a regression when parsing strings - -# 1.5.0 (2012-01-04) - - * added Traversable objects support for the join filter - -# 1.5.0-RC2 (2011-12-30) - - * added a way to set the default global date interval format - * fixed the date filter for DateInterval instances (setTimezone() does not exist for them) - * refactored Twig_Template::display() to ease its extension - * added a number_format filter - -# 1.5.0-RC1 (2011-12-26) - - * removed the need to quote hash keys - * allowed hash keys to be any expression - * added a do tag - * added a flush tag - * added support for dynamically named filters and functions - * added a dump function to help debugging templates - * added a nl2br filter - * added a random function - * added a way to change the default format for the date filter - * fixed the lexer when an operator ending with a letter ends a line - * added string interpolation support - * enhanced exceptions for unknown filters, functions, tests, and tags - -# 1.4.0 (2011-12-07) - - * fixed lexer when using big numbers (> PHP_INT_MAX) - * added missing preserveKeys argument to the reverse filter - * fixed macros containing filter tag calls - -# 1.4.0-RC2 (2011-11-27) - - * removed usage of Reflection in Twig_Template::getAttribute() - * added a C extension that can optionally replace Twig_Template::getAttribute() - * added negative timestamp support to the date filter - -# 1.4.0-RC1 (2011-11-20) - - * optimized variable access when using PHP 5.4 - * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby - * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders - * added Twig_Function_Node to allow more complex functions to have their own Node class - * added Twig_Filter_Node to allow more complex filters to have their own Node class - * added Twig_Test_Node to allow more complex tests to have their own Node class - * added a better error message when a template is empty but contain a BOM - * fixed "in" operator for empty strings - * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option) - * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order) - * added Twig_Environment::display() - * made the escape filter smarter when the encoding is not supported by PHP - * added a convert_encoding filter - * moved all node manipulations outside the compile() Node method - * made several speed optimizations - -# 1.3.0 (2011-10-08) - -no changes - -# 1.3.0-RC1 (2011-10-04) - - * added an optimization for the parent() function - * added cache reloading when auto_reload is true and an extension has been modified - * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup) - * allowed empty templates to be used as traits - * added traits support for the "parent" function - -# 1.2.0 (2011-09-13) - -no changes - -# 1.2.0-RC1 (2011-09-10) - - * enhanced the exception when a tag remains unclosed - * added support for empty Countable objects for the "empty" test - * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions) - * added better support for encoding problems when escaping a string (available as of PHP 5.4) - * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %}) - * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %}) - * added support for bitwise operators in expressions - * added the "attribute" function to allow getting dynamic attributes on variables - * added Twig_Loader_Chain - * added Twig_Loader_Array::setTemplate() - * added an optimization for the set tag when used to capture a large chunk of static text - * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros) - * removed the possibility to use the "extends" tag from a block - * added "if" modifier support to "for" loops - -# 1.1.2 (2011-07-30) - - * fixed json_encode filter on PHP 5.2 - * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }}) - * fixed inheritance when using conditional parents - * fixed compilation of templates when the body of a child template is not empty - * fixed output when a macro throws an exception - * fixed a parsing problem when a large chunk of text is enclosed in a comment tag - * added PHPDoc for all Token parsers and Core extension functions - -# 1.1.1 (2011-07-17) - - * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls) - * made some performance improvement for some edge cases - -# 1.1.0 (2011-06-28) - - * fixed json_encode filter - -# 1.1.0-RC3 (2011-06-24) - - * fixed method case-sensitivity when using the sandbox mode - * added timezone support for the date filter - * fixed possible security problems with NUL bytes - -# 1.1.0-RC2 (2011-06-16) - - * added an exception when the template passed to "use" is not a string - * made 'a.b is defined' not throw an exception if a is not defined (in strict mode) - * added {% line \d+ %} directive - -# 1.1.0-RC1 (2011-05-28) - -Flush your cache after upgrading. - - * fixed date filter when using a timestamp - * fixed the defined test for some cases - * fixed a parsing problem when a large chunk of text is enclosed in a raw tag - * added support for horizontal reuse of template blocks (see docs for more information) - * added whitespace control modifier to all tags (see docs for more information) - * added null as an alias for none (the null test is also an alias for the none test now) - * made TRUE, FALSE, NONE equivalent to their lowercase counterparts - * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line - * moved display() method to Twig_Template (generated templates should now use doDisplay() instead) - -# 1.0.0 (2011-03-27) - - * fixed output when using mbstring - * fixed duplicate call of methods when using the sandbox - * made the charset configurable for the escape filter - -# 1.0.0-RC2 (2011-02-21) - - * changed the way {% set %} works when capturing (the content is now marked as safe) - * added support for macro name in the endmacro tag - * make Twig_Error compatible with PHP 5.3.0 > - * fixed an infinite loop on some Windows configurations - * fixed the "length" filter for numbers - * fixed Template::getAttribute() as properties in PHP are case sensitive - * removed coupling between Twig_Node and Twig_Template - * fixed the ternary operator precedence rule - -# 1.0.0-RC1 (2011-01-09) - -Backward incompatibilities: - - * the "items" filter, which has been deprecated for quite a long time now, has been removed - * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10) - * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }} - * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }} - * the "for" tag does not support "joined by" anymore - * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off") - * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %}) - * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %}) - * removed the grammar and simple token parser (moved to the Twig Extensions repository) - -Changes: - - * added "needs_context" option for filters and functions (the context is then passed as a first argument) - * added global variables support - * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode) - * added the "from" tag to import macros as functions - * added support for functions (a function is just syntactic sugar for a getAttribute() call) - * made macros callable when sandbox mode is enabled - * added an exception when a macro uses a reserved name - * the "default" filter now uses the "empty" test instead of just checking for null - * added the "empty" test - -# 0.9.10 (2010-12-16) - -Backward incompatibilities: - - * The Escaper extension is enabled by default, which means that all displayed - variables are now automatically escaped. You can revert to the previous - behavior by removing the extension via $env->removeExtension('escaper') - or just set the 'autoescape' option to 'false'. - * removed the "without loop" attribute for the "for" tag (not needed anymore - as the Optimizer take care of that for most cases) - * arrays and hashes have now a different syntax - * arrays keep the same syntax with square brackets: [1, 2] - * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"}) - * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1}) - * the i18n extension is now part of the Twig Extensions repository - -Changes: - - * added the merge filter - * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead - * fixed usage of operators as method names (like is, in, and not) - * changed the order of execution for node visitors - * fixed default() filter behavior when used with strict_variables set to on - * fixed filesystem loader compatibility with PHAR files - * enhanced error messages when an unexpected token is parsed in an expression - * fixed filename not being added to syntax error messages - * added the autoescape option to enable/disable autoescaping - * removed the newline after a comment (mimics PHP behavior) - * added a syntax error exception when parent block is used on a template that does not extend another one - * made the Escaper extension enabled by default - * fixed sandbox extension when used with auto output escaping - * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved) - * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters) - * added priority to node visitors - -# 0.9.9 (2010-11-28) - -Backward incompatibilities: - * the self special variable has been renamed to _self - * the odd and even filters are now tests: - {{ foo|odd }} must now be written {{ foo is odd }} - * the "safe" filter has been renamed to "raw" - * in Node classes, - sub-nodes are now accessed via getNode() (instead of property access) - attributes via getAttribute() (instead of array access) - * the urlencode filter had been renamed to url_encode - * the include tag now merges the passed variables with the current context by default - (the old behavior is still possible by adding the "only" keyword) - * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime) - * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead) - * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }}) - -Changes: - * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template - * changed trans tag to accept any variable for the plural count - * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements) - * added the ** (power) operator - * changed the algorithm used for parsing expressions - * added the spaceless tag - * removed trim_blocks option - * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar()) - * changed all exceptions to extend Twig_Error - * fixed unary expressions ({{ not(1 or 0) }}) - * fixed child templates (with an extend tag) that uses one or more imports - * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }}) - * escaping has been rewritten - * the implementation of template inheritance has been rewritten - (blocks can now be called individually and still work with inheritance) - * fixed error handling for if tag when a syntax error occurs within a subparse process - * added a way to implement custom logic for resolving token parsers given a tag name - * fixed js escaper to be stricter (now uses a whilelist-based js escaper) - * added the following filers: "constant", "trans", "replace", "json_encode" - * added a "constant" test - * fixed objects with __toString() not being autoescaped - * fixed subscript expressions when calling __call() (methods now keep the case) - * added "test" feature (accessible via the "is" operator) - * removed the debug tag (should be done in an extension) - * fixed trans tag when no vars are used in plural form - * fixed race condition when writing template cache - * added the special _charset variable to reference the current charset - * added the special _context variable to reference the current context - * renamed self to _self (to avoid conflict) - * fixed Twig_Template::getAttribute() for protected properties - -# 0.9.8 (2010-06-28) - -Backward incompatibilities: - * the trans tag plural count is now attached to the plural tag: - old: `{% trans count %}...{% plural %}...{% endtrans %}` - new: `{% trans %}...{% plural count %}...{% endtrans %}` - - * added a way to translate strings coming from a variable ({% trans var %}) - * fixed trans tag when used with the Escaper extension - * fixed default cache umask - * removed Twig_Template instances from the debug tag output - * fixed objects with __isset() defined - * fixed set tag when used with a capture - * fixed type hinting for Twig_Environment::addFilter() method - -# 0.9.7 (2010-06-12) - -Backward incompatibilities: - * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %}) - * removed the sandboxed attribute of the include tag (use the new sandbox tag instead) - * refactored the Node system (if you have custom nodes, you will have to update them to use the new API) - - * added self as a special variable that refers to the current template (useful for importing macros from the current template) - * added Twig_Template instance support to the include tag - * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %}) - * added a grammar sub-framework to ease the creation of custom tags - * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface) - * removed the Twig_Resource::resolveMissingFilter() method - * fixed the filter tag which did not apply filtering to included files - * added a bunch of unit tests - * added a bunch of phpdoc - * added a sandbox tag in the sandbox extension - * changed the date filter to support any date format supported by DateTime - * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default) - * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor - * changed the cache option to only accepts an explicit path to a cache directory or false - * added a way to add token parsers, filters, and visitors without creating an extension - * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface - * changed the generated code to match the new coding standards - * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }}) - * added an exception when a child template has a non-empty body (as it is always ignored when rendering) - -# 0.9.6 (2010-05-12) - - * fixed variables defined outside a loop and for which the value changes in a for loop - * fixed the test suite for PHP 5.2 and older versions of PHPUnit - * added support for __call() in expression resolution - * fixed node visiting for macros (macros are now visited by visitors as any other node) - * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now) - * added the cycle filter - * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII - * added a long-syntax for the set tag ({% set foo %}...{% endset %}) - * unit tests are now powered by PHPUnit - * added support for gettext via the `i18n` extension - * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values - * added a more useful exception if an if tag is not closed properly - * added support for escaping strategy in the autoescape tag - * fixed lexer when a template has a big chunk of text between/in a block - -# 0.9.5 (2010-01-20) - -As for any new release, don't forget to remove all cached templates after -upgrading. - -If you have defined custom filters, you MUST upgrade them for this release. To -upgrade, replace "array" with "new Twig_Filter_Function", and replace the -environment constant by the "needs_environment" option: - - // before - 'even' => array('twig_is_even_filter', false), - 'escape' => array('twig_escape_filter', true), - - // after - 'even' => new Twig_Filter_Function('twig_is_even_filter'), - 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)), - -If you have created NodeTransformer classes, you will need to upgrade them to -the new interface (please note that the interface is not yet considered -stable). - - * fixed list nodes that did not extend the Twig_NodeListInterface - * added the "without loop" option to the for tag (it disables the generation of the loop variable) - * refactored node transformers to node visitors - * fixed automatic-escaping for blocks - * added a way to specify variables to pass to an included template - * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules) - * improved the filter system to allow object methods to be used as filters - * changed the Array and String loaders to actually make use of the cache mechanism - * included the default filter function definitions in the extension class files directly (Core, Escaper) - * added the // operator (like the floor() PHP function) - * added the .. operator (as a syntactic sugar for the range filter when the step is 1) - * added the in operator (as a syntactic sugar for the in filter) - * added the following filters in the Core extension: in, range - * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes) - * enhanced some error messages to provide better feedback in case of parsing errors - -# 0.9.4 (2009-12-02) - -If you have custom loaders, you MUST upgrade them for this release: The -Twig_Loader base class has been removed, and the Twig_LoaderInterface has also -been changed (see the source code for more information or the documentation). - - * added support for DateTime instances for the date filter - * fixed loop.last when the array only has one item - * made it possible to insert newlines in tag and variable blocks - * fixed a bug when a literal '\n' were present in a template text - * fixed bug when the filename of a template contains */ - * refactored loaders - -# 0.9.3 (2009-11-11) - -This release is NOT backward compatible with the previous releases. - - The loaders do not take the cache and autoReload arguments anymore. Instead, - the Twig_Environment class has two new options: cache and auto_reload. - Upgrading your code means changing this kind of code: - - $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true); - $twig = new Twig_Environment($loader); - - to something like this: - - $loader = new Twig_Loader_Filesystem('/path/to/templates'); - $twig = new Twig_Environment($loader, array( - 'cache' => '/path/to/compilation_cache', - 'auto_reload' => true, - )); - - * deprecated the "items" filter as it is not needed anymore - * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader - * optimized template loading speed - * removed output when an error occurs in a template and render() is used - * made major speed improvements for loops (up to 300% on even the smallest loops) - * added properties as part of the sandbox mode - * added public properties support (obj.item can now be the item property on the obj object) - * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} ) - * fixed bug when \ was used in HTML - -# 0.9.2 (2009-10-29) - - * made some speed optimizations - * changed the cache extension to .php - * added a js escaping strategy - * added support for short block tag - * changed the filter tag to allow chained filters - * made lexer more flexible as you can now change the default delimiters - * added set tag - * changed default directory permission when cache dir does not exist (more secure) - * added macro support - * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance - * made Twig_Autoloader::autoload() a static method - * avoid writing template file if an error occurs - * added $ escaping when outputting raw strings - * enhanced some error messages to ease debugging - * fixed empty cache files when the template contains an error - -# 0.9.1 (2009-10-14) - - * fixed a bug in PHP 5.2.6 - * fixed numbers with one than one decimal - * added support for method calls with arguments ({{ foo.bar('a', 43) }}) - * made small speed optimizations - * made minor tweaks to allow better extensibility and flexibility - -# 0.9.0 (2009-10-12) - - * Initial release diff --git a/data/web/inc/lib/vendor/twig/twig/LICENSE b/data/web/inc/lib/vendor/twig/twig/LICENSE index 4371e423..8711927f 100644 --- a/data/web/inc/lib/vendor/twig/twig/LICENSE +++ b/data/web/inc/lib/vendor/twig/twig/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2021 by the Twig Team. +Copyright (c) 2009-2022 by the Twig Team. All rights reserved. diff --git a/data/web/inc/lib/vendor/twig/twig/README.rst b/data/web/inc/lib/vendor/twig/twig/README.rst index d896ff50..fbe7e9a9 100644 --- a/data/web/inc/lib/vendor/twig/twig/README.rst +++ b/data/web/inc/lib/vendor/twig/twig/README.rst @@ -1,8 +1,7 @@ Twig, the flexible, fast, and secure template language for PHP ============================================================== -Twig is a template language for PHP, released under the new BSD license (code -and documentation). +Twig is a template language for PHP. Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. diff --git a/data/web/inc/lib/vendor/twig/twig/composer.json b/data/web/inc/lib/vendor/twig/twig/composer.json index c344849d..91ff912f 100644 --- a/data/web/inc/lib/vendor/twig/twig/composer.json +++ b/data/web/inc/lib/vendor/twig/twig/composer.json @@ -29,7 +29,7 @@ "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4.9|^5.0.9", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", "psr/container": "^1.0" }, "autoload": { diff --git a/data/web/inc/lib/vendor/twig/twig/doc/.doctor-rst.yaml b/data/web/inc/lib/vendor/twig/twig/doc/.doctor-rst.yaml deleted file mode 100644 index bfb40426..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/.doctor-rst.yaml +++ /dev/null @@ -1,54 +0,0 @@ -rules: - american_english: ~ - avoid_repetetive_words: ~ - blank_line_after_directive: ~ - blank_line_before_directive: ~ - composer_dev_option_not_at_the_end: ~ - correct_code_block_directive_based_on_the_content: ~ - deprecated_directive_should_have_version: ~ - ensure_order_of_code_blocks_in_configuration_block: ~ - extension_xlf_instead_of_xliff: ~ - indention: ~ - lowercase_as_in_use_statements: ~ - max_blank_lines: - max: 2 - no_blank_line_after_filepath_in_php_code_block: ~ - no_blank_line_after_filepath_in_twig_code_block: ~ - no_blank_line_after_filepath_in_xml_code_block: ~ - no_blank_line_after_filepath_in_yaml_code_block: ~ - no_composer_req: ~ - no_explicit_use_of_code_block_php: ~ - no_inheritdoc: ~ - no_namespace_after_use_statements: ~ - no_php_open_tag_in_code_block_php_directive: ~ - no_space_before_self_xml_closing_tag: ~ - ordered_use_statements: ~ - php_prefix_before_bin_console: ~ - replace_code_block_types: ~ - replacement: ~ - short_array_syntax: ~ - typo: ~ - unused_links: ~ - use_deprecated_directive_instead_of_versionadded: ~ - use_https_xsd_urls: ~ - valid_inline_highlighted_namespaces: ~ - valid_use_statements: ~ - versionadded_directive_should_have_version: ~ - yaml_instead_of_yml_suffix: ~ - yarn_dev_option_at_the_end: ~ - - versionadded_directive_major_version: - major_version: 3 - - versionadded_directive_min_version: - min_version: '3.0' - - deprecated_directive_major_version: - major_version: 3 - - deprecated_directive_min_version: - min_version: '3.0' - -whitelist: - lines: - - 'I like Twig.<br />' diff --git a/data/web/inc/lib/vendor/twig/twig/doc/_build/.requirements.txt b/data/web/inc/lib/vendor/twig/twig/doc/_build/.requirements.txt deleted file mode 100644 index 47f076e9..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/_build/.requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -docutils==0.13.1 -Pygments==2.2.0 -sphinx==1.8.5 -git+https://github.com/fabpot/sphinx-php.git@v2.0.0#egg_name=sphinx-php -jsx-lexer===0.0.8 -sphinx_rtd_theme==0.5.0 diff --git a/data/web/inc/lib/vendor/twig/twig/doc/_build/Makefile b/data/web/inc/lib/vendor/twig/twig/doc/_build/Makefile deleted file mode 100644 index 25b66005..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/_build/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = . - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -c $(BUILDDIR) -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ../ -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make <target>' where <target> is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Symfony.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Symfony.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Symfony" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Symfony" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/data/web/inc/lib/vendor/twig/twig/doc/_build/conf.py b/data/web/inc/lib/vendor/twig/twig/doc/_build/conf.py deleted file mode 100644 index 1e3a8abf..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/_build/conf.py +++ /dev/null @@ -1,271 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Symfony documentation build configuration file, created by -# sphinx-quickstart on Sat Jul 28 21:58:57 2012. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.append(os.path.abspath('_exts')) - -# adding PhpLexer -from sphinx.highlighting import lexers -from pygments.lexers.special import TextLexer -from pygments.lexers.text import RstLexer -from pygments.lexers.web import PhpLexer - -# -- General configuration ----------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.8.5' - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [ - 'sphinx.ext.autodoc', 'sphinx.ext.doctest', - 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', 'sphinx.ext.extlinks', - 'sensio.sphinx.codeblock', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode', 'sensio.sphinx.bestpractice' -] - -#spelling_show_sugestions=True -#spelling_lang='en_US' -#spelling_word_list_filename='_build/spelling_word_list.txt' - -# Add any paths that contain templates here, relative to this directory. -# templates_path = ['_theme/_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = 'Twig' -copyright = '' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -# version = '2.2' -# The full version, including alpha/beta/rc tags. -# release = '2.2.13' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -#pygments_style = 'symfonycom.sphinx.SensioStyle' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# -- Settings for symfony doc extension --------------------------------------------------- - -# enable highlighting for PHP code not between ``<?php ... ?>`` by default -lexers['php'] = PhpLexer(startinline=True) -lexers['rst'] = RstLexer() - -config_block = { - 'rst': 'reStructuredText', -} - -# don't enable Sphinx Domains -primary_domain = None - -# set url for API links -#api_url = 'https://github.com/symfony/symfony/blob/master/src/%s.php' - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "sphinx_rtd_theme" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - 'logo_only': True, - 'prev_next_buttons_location': None, - 'style_nav_header_background': '#f0f0f0' -} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# "<project> v<release> documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = '_static/symfony-logo.svg' - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['_static'] -#html_css_files = ['rtd_custom.css'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a <link> tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Twig' - - -# -- Options for LaTeX output -------------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -#latex_documents = [] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -#man_pages = [] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------------ - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -#texinfo_documents = [] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# Use PHP syntax highlighting in code examples by default -highlight_language='php' diff --git a/data/web/inc/lib/vendor/twig/twig/doc/advanced.rst b/data/web/inc/lib/vendor/twig/twig/doc/advanced.rst deleted file mode 100644 index f801348d..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/advanced.rst +++ /dev/null @@ -1,911 +0,0 @@ -Extending Twig -============== - -Twig can be extended in many ways; you can add extra tags, filters, tests, -operators, global variables, and functions. You can even extend the parser -itself with node visitors. - -.. note:: - - The first section of this chapter describes how to extend Twig. If you want - to reuse your changes in different projects or if you want to share them - with others, you should then create an extension as described in the - following section. - -.. caution:: - - When extending Twig without creating an extension, Twig won't be able to - recompile your templates when the PHP code is updated. To see your changes - in real-time, either disable template caching or package your code into an - extension (see the next section of this chapter). - -Before extending Twig, you must understand the differences between all the -different possible extension points and when to use them. - -First, remember that Twig has two main language constructs: - -* ``{{ }}``: used to print the result of an expression evaluation; - -* ``{% %}``: used to execute statements. - -To understand why Twig exposes so many extension points, let's see how to -implement a *Lorem ipsum* generator (it needs to know the number of words to -generate). - -You can use a ``lipsum`` *tag*: - -.. code-block:: twig - - {% lipsum 40 %} - -That works, but using a tag for ``lipsum`` is not a good idea for at least -three main reasons: - -* ``lipsum`` is not a language construct; -* The tag outputs something; -* The tag is not flexible as you cannot use it in an expression: - - .. code-block:: twig - - {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }} - -In fact, you rarely need to create tags; and that's good news because tags are -the most complex extension point. - -Now, let's use a ``lipsum`` *filter*: - -.. code-block:: twig - - {{ 40|lipsum }} - -Again, it works. But a filter should transform the passed value to something -else. Here, we use the value to indicate the number of words to generate (so, -``40`` is an argument of the filter, not the value we want to transform). - -Next, let's use a ``lipsum`` *function*: - -.. code-block:: twig - - {{ lipsum(40) }} - -Here we go. For this specific example, the creation of a function is the -extension point to use. And you can use it anywhere an expression is accepted: - -.. code-block:: twig - - {{ 'some text' ~ lipsum(40) ~ 'some more text' }} - - {% set lipsum = lipsum(40) %} - -Lastly, you can also use a *global* object with a method able to generate lorem -ipsum text: - -.. code-block:: twig - - {{ text.lipsum(40) }} - -As a rule of thumb, use functions for frequently used features and global -objects for everything else. - -Keep in mind the following when you want to extend Twig: - -========== ========================== ========== ========================= -What? Implementation difficulty? How often? When? -========== ========================== ========== ========================= -*macro* simple frequent Content generation -*global* simple frequent Helper object -*function* simple frequent Content generation -*filter* simple frequent Value transformation -*tag* complex rare DSL language construct -*test* simple rare Boolean decision -*operator* simple rare Values transformation -========== ========================== ========== ========================= - -Globals -------- - -A global variable is like any other template variable, except that it's -available in all templates and macros:: - - $twig = new \Twig\Environment($loader); - $twig->addGlobal('text', new Text()); - -You can then use the ``text`` variable anywhere in a template: - -.. code-block:: twig - - {{ text.lipsum(40) }} - -Filters -------- - -Creating a filter consists of associating a name with a PHP callable:: - - // an anonymous function - $filter = new \Twig\TwigFilter('rot13', function ($string) { - return str_rot13($string); - }); - - // or a simple PHP function - $filter = new \Twig\TwigFilter('rot13', 'str_rot13'); - - // or a class static method - $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']); - $filter = new \Twig\TwigFilter('rot13', 'SomeClass::rot13Filter'); - - // or a class method - $filter = new \Twig\TwigFilter('rot13', [$this, 'rot13Filter']); - // the one below needs a runtime implementation (see below for more information) - $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']); - -The first argument passed to the ``\Twig\TwigFilter`` constructor is the name of the -filter you will use in templates and the second one is the PHP callable to -associate with it. - -Then, add the filter to the Twig environment:: - - $twig = new \Twig\Environment($loader); - $twig->addFilter($filter); - -And here is how to use it in a template: - -.. code-block:: twig - - {{ 'Twig'|rot13 }} - - {# will output Gjvt #} - -When called by Twig, the PHP callable receives the left side of the filter -(before the pipe ``|``) as the first argument and the extra arguments passed -to the filter (within parentheses ``()``) as extra arguments. - -For instance, the following code: - -.. code-block:: twig - - {{ 'TWIG'|lower }} - {{ now|date('d/m/Y') }} - -is compiled to something like the following:: - - <?php echo strtolower('TWIG') ?> - <?php echo twig_date_format_filter($now, 'd/m/Y') ?> - -The ``\Twig\TwigFilter`` class takes an array of options as its last argument:: - - $filter = new \Twig\TwigFilter('rot13', 'str_rot13', $options); - -Environment-aware Filters -~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you want to access the current environment instance in your filter, set the -``needs_environment`` option to ``true``; Twig will pass the current -environment as the first argument to the filter call:: - - $filter = new \Twig\TwigFilter('rot13', function (\Twig\Environment $env, $string) { - // get the current charset for instance - $charset = $env->getCharset(); - - return str_rot13($string); - }, ['needs_environment' => true]); - -Context-aware Filters -~~~~~~~~~~~~~~~~~~~~~ - -If you want to access the current context in your filter, set the -``needs_context`` option to ``true``; Twig will pass the current context as -the first argument to the filter call (or the second one if -``needs_environment`` is also set to ``true``):: - - $filter = new \Twig\TwigFilter('rot13', function ($context, $string) { - // ... - }, ['needs_context' => true]); - - $filter = new \Twig\TwigFilter('rot13', function (\Twig\Environment $env, $context, $string) { - // ... - }, ['needs_context' => true, 'needs_environment' => true]); - -Automatic Escaping -~~~~~~~~~~~~~~~~~~ - -If automatic escaping is enabled, the output of the filter may be escaped -before printing. If your filter acts as an escaper (or explicitly outputs HTML -or JavaScript code), you will want the raw output to be printed. In such a -case, set the ``is_safe`` option:: - - $filter = new \Twig\TwigFilter('nl2br', 'nl2br', ['is_safe' => ['html']]); - -Some filters may need to work on input that is already escaped or safe, for -example when adding (safe) HTML tags to originally unsafe output. In such a -case, set the ``pre_escape`` option to escape the input data before it is run -through your filter:: - - $filter = new \Twig\TwigFilter('somefilter', 'somefilter', ['pre_escape' => 'html', 'is_safe' => ['html']]); - -Variadic Filters -~~~~~~~~~~~~~~~~ - -When a filter should accept an arbitrary number of arguments, set the -``is_variadic`` option to ``true``; Twig will pass the extra arguments as the -last argument to the filter call as an array:: - - $filter = new \Twig\TwigFilter('thumbnail', function ($file, array $options = []) { - // ... - }, ['is_variadic' => true]); - -Be warned that :ref:`named arguments <named-arguments>` passed to a variadic -filter cannot be checked for validity as they will automatically end up in the -option array. - -Dynamic Filters -~~~~~~~~~~~~~~~ - -A filter name containing the special ``*`` character is a dynamic filter and -the ``*`` part will match any string:: - - $filter = new \Twig\TwigFilter('*_path', function ($name, $arguments) { - // ... - }); - -The following filters are matched by the above defined dynamic filter: - -* ``product_path`` -* ``category_path`` - -A dynamic filter can define more than one dynamic parts:: - - $filter = new \Twig\TwigFilter('*_path_*', function ($name, $suffix, $arguments) { - // ... - }); - -The filter receives all dynamic part values before the normal filter arguments, -but after the environment and the context. For instance, a call to -``'foo'|a_path_b()`` will result in the following arguments to be passed to the -filter: ``('a', 'b', 'foo')``. - -Deprecated Filters -~~~~~~~~~~~~~~~~~~ - -You can mark a filter as being deprecated by setting the ``deprecated`` option -to ``true``. You can also give an alternative filter that replaces the -deprecated one when that makes sense:: - - $filter = new \Twig\TwigFilter('obsolete', function () { - // ... - }, ['deprecated' => true, 'alternative' => 'new_one']); - -When a filter is deprecated, Twig emits a deprecation notice when compiling a -template using it. See :ref:`deprecation-notices` for more information. - -Functions ---------- - -Functions are defined in the exact same way as filters, but you need to create -an instance of ``\Twig\TwigFunction``:: - - $twig = new \Twig\Environment($loader); - $function = new \Twig\TwigFunction('function_name', function () { - // ... - }); - $twig->addFunction($function); - -Functions support the same features as filters, except for the ``pre_escape`` -and ``preserves_safety`` options. - -Tests ------ - -Tests are defined in the exact same way as filters and functions, but you need -to create an instance of ``\Twig\TwigTest``:: - - $twig = new \Twig\Environment($loader); - $test = new \Twig\TwigTest('test_name', function () { - // ... - }); - $twig->addTest($test); - -Tests allow you to create custom application specific logic for evaluating -boolean conditions. As a simple example, let's create a Twig test that checks if -objects are 'red':: - - $twig = new \Twig\Environment($loader); - $test = new \Twig\TwigTest('red', function ($value) { - if (isset($value->color) && $value->color == 'red') { - return true; - } - if (isset($value->paint) && $value->paint == 'red') { - return true; - } - return false; - }); - $twig->addTest($test); - -Test functions must always return ``true``/``false``. - -When creating tests you can use the ``node_class`` option to provide custom test -compilation. This is useful if your test can be compiled into PHP primitives. -This is used by many of the tests built into Twig:: - - namespace App; - - use Twig\Environment; - use Twig\Node\Expression\TestExpression; - use Twig\TwigTest; - - $twig = new Environment($loader); - $test = new TwigTest( - 'odd', - null, - ['node_class' => OddTestExpression::class]); - $twig->addTest($test); - - class OddTestExpression extends TestExpression - { - public function compile(\Twig\Compiler $compiler) - { - $compiler - ->raw('(') - ->subcompile($this->getNode('node')) - ->raw(' % 2 != 0') - ->raw(')') - ; - } - } - -The above example shows how you can create tests that use a node class. The node -class has access to one sub-node called ``node``. This sub-node contains the -value that is being tested. When the ``odd`` filter is used in code such as: - -.. code-block:: twig - - {% if my_value is odd %} - -The ``node`` sub-node will contain an expression of ``my_value``. Node-based -tests also have access to the ``arguments`` node. This node will contain the -various other arguments that have been provided to your test. - -If you want to pass a variable number of positional or named arguments to the -test, set the ``is_variadic`` option to ``true``. Tests support dynamic -names (see dynamic filters for the syntax). - -Tags ----- - -One of the most exciting features of a template engine like Twig is the -possibility to define new **language constructs**. This is also the most complex -feature as you need to understand how Twig's internals work. - -Most of the time though, a tag is not needed: - -* If your tag generates some output, use a **function** instead. - -* If your tag modifies some content and returns it, use a **filter** instead. - - For instance, if you want to create a tag that converts a Markdown formatted - text to HTML, create a ``markdown`` filter instead: - - .. code-block:: twig - - {{ '**markdown** text'|markdown }} - - If you want use this filter on large amounts of text, wrap it with the - :doc:`apply <tags/apply>` tag: - - .. code-block:: twig - - {% apply markdown %} - Title - ===== - - Much better than creating a tag as you can **compose** filters. - {% endapply %} - -* If your tag does not output anything, but only exists because of a side - effect, create a **function** that returns nothing and call it via the - :doc:`filter <tags/do>` tag. - - For instance, if you want to create a tag that logs text, create a ``log`` - function instead and call it via the :doc:`do <tags/do>` tag: - - .. code-block:: twig - - {% do log('Log some things') %} - -If you still want to create a tag for a new language construct, great! - -Let's create a ``set`` tag that allows the definition of simple variables from -within a template. The tag can be used like follows: - -.. code-block:: twig - - {% set name = "value" %} - - {{ name }} - - {# should output value #} - -.. note:: - - The ``set`` tag is part of the Core extension and as such is always - available. The built-in version is slightly more powerful and supports - multiple assignments by default. - -Three steps are needed to define a new tag: - -* Defining a Token Parser class (responsible for parsing the template code); - -* Defining a Node class (responsible for converting the parsed code to PHP); - -* Registering the tag. - -Registering a new tag -~~~~~~~~~~~~~~~~~~~~~ - -Add a tag by calling the ``addTokenParser`` method on the ``\Twig\Environment`` -instance:: - - $twig = new \Twig\Environment($loader); - $twig->addTokenParser(new Project_Set_TokenParser()); - -Defining a Token Parser -~~~~~~~~~~~~~~~~~~~~~~~ - -Now, let's see the actual code of this class:: - - class Project_Set_TokenParser extends \Twig\TokenParser\AbstractTokenParser - { - public function parse(\Twig\Token $token) - { - $parser = $this->parser; - $stream = $parser->getStream(); - - $name = $stream->expect(\Twig\Token::NAME_TYPE)->getValue(); - $stream->expect(\Twig\Token::OPERATOR_TYPE, '='); - $value = $parser->getExpressionParser()->parseExpression(); - $stream->expect(\Twig\Token::BLOCK_END_TYPE); - - return new Project_Set_Node($name, $value, $token->getLine(), $this->getTag()); - } - - public function getTag() - { - return 'set'; - } - } - -The ``getTag()`` method must return the tag we want to parse, here ``set``. - -The ``parse()`` method is invoked whenever the parser encounters a ``set`` -tag. It should return a ``\Twig\Node\Node`` instance that represents the node (the -``Project_Set_Node`` calls creating is explained in the next section). - -The parsing process is simplified thanks to a bunch of methods you can call -from the token stream (``$this->parser->getStream()``): - -* ``getCurrent()``: Gets the current token in the stream. - -* ``next()``: Moves to the next token in the stream, *but returns the old one*. - -* ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether - the current token is of a particular type or value (or both). The value may be an - array of several possible values. - -* ``expect($type[, $value[, $message]])``: If the current token isn't of the given - type/value a syntax error is thrown. Otherwise, if the type and value are correct, - the token is returned and the stream moves to the next token. - -* ``look()``: Looks at the next token without consuming it. - -Parsing expressions is done by calling the ``parseExpression()`` like we did for -the ``set`` tag. - -.. tip:: - - Reading the existing ``TokenParser`` classes is the best way to learn all - the nitty-gritty details of the parsing process. - -Defining a Node -~~~~~~~~~~~~~~~ - -The ``Project_Set_Node`` class itself is quite short:: - - class Project_Set_Node extends \Twig\Node\Node - { - public function __construct($name, \Twig\Node\Expression\AbstractExpression $value, $line, $tag = null) - { - parent::__construct(['value' => $value], ['name' => $name], $line, $tag); - } - - public function compile(\Twig\Compiler $compiler) - { - $compiler - ->addDebugInfo($this) - ->write('$context[\''.$this->getAttribute('name').'\'] = ') - ->subcompile($this->getNode('value')) - ->raw(";\n") - ; - } - } - -The compiler implements a fluid interface and provides methods that helps the -developer generate beautiful and readable PHP code: - -* ``subcompile()``: Compiles a node. - -* ``raw()``: Writes the given string as is. - -* ``write()``: Writes the given string by adding indentation at the beginning - of each line. - -* ``string()``: Writes a quoted string. - -* ``repr()``: Writes a PHP representation of a given value (see - ``\Twig\Node\ForNode`` for a usage example). - -* ``addDebugInfo()``: Adds the line of the original template file related to - the current node as a comment. - -* ``indent()``: Indents the generated code (see ``\Twig\Node\BlockNode`` for a - usage example). - -* ``outdent()``: Outdents the generated code (see ``\Twig\Node\BlockNode`` for a - usage example). - -.. _creating_extensions: - -Creating an Extension ---------------------- - -The main motivation for writing an extension is to move often used code into a -reusable class like adding support for internationalization. An extension can -define tags, filters, tests, operators, functions, and node visitors. - -Most of the time, it is useful to create a single extension for your project, -to host all the specific tags and filters you want to add to Twig. - -.. tip:: - - When packaging your code into an extension, Twig is smart enough to - recompile your templates whenever you make a change to it (when - ``auto_reload`` is enabled). - -An extension is a class that implements the following interface:: - - interface \Twig\Extension\ExtensionInterface - { - /** - * Returns the token parser instances to add to the existing list. - * - * @return \Twig\TokenParser\TokenParserInterface[] - */ - public function getTokenParsers(); - - /** - * Returns the node visitor instances to add to the existing list. - * - * @return \Twig\NodeVisitor\NodeVisitorInterface[] - */ - public function getNodeVisitors(); - - /** - * Returns a list of filters to add to the existing list. - * - * @return \Twig\TwigFilter[] - */ - public function getFilters(); - - /** - * Returns a list of tests to add to the existing list. - * - * @return \Twig\TwigTest[] - */ - public function getTests(); - - /** - * Returns a list of functions to add to the existing list. - * - * @return \Twig\TwigFunction[] - */ - public function getFunctions(); - - /** - * Returns a list of operators to add to the existing list. - * - * @return array<array> First array of unary operators, second array of binary operators - */ - public function getOperators(); - } - -To keep your extension class clean and lean, inherit from the built-in -``\Twig\Extension\AbstractExtension`` class instead of implementing the interface as it provides -empty implementations for all methods:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - } - -This extension does nothing for now. We will customize it in the next sections. - -You can save your extension anywhere on the filesystem, as all extensions must -be registered explicitly to be available in your templates. - -You can register an extension by using the ``addExtension()`` method on your -main ``Environment`` object:: - - $twig = new \Twig\Environment($loader); - $twig->addExtension(new Project_Twig_Extension()); - -.. tip:: - - The Twig core extensions are great examples of how extensions work. - -Globals -~~~~~~~ - -Global variables can be registered in an extension via the ``getGlobals()`` -method:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension implements \Twig\Extension\GlobalsInterface - { - public function getGlobals(): array - { - return [ - 'text' => new Text(), - ]; - } - - // ... - } - -Functions -~~~~~~~~~ - -Functions can be registered in an extension via the ``getFunctions()`` -method:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFunctions() - { - return [ - new \Twig\TwigFunction('lipsum', 'generate_lipsum'), - ]; - } - - // ... - } - -Filters -~~~~~~~ - -To add a filter to an extension, you need to override the ``getFilters()`` -method. This method must return an array of filters to add to the Twig -environment:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFilters() - { - return [ - new \Twig\TwigFilter('rot13', 'str_rot13'), - ]; - } - - // ... - } - -Tags -~~~~ - -Adding a tag in an extension can be done by overriding the -``getTokenParsers()`` method. This method must return an array of tags to add -to the Twig environment:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getTokenParsers() - { - return [new Project_Set_TokenParser()]; - } - - // ... - } - -In the above code, we have added a single new tag, defined by the -``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is -responsible for parsing the tag and compiling it to PHP. - -Operators -~~~~~~~~~ - -The ``getOperators()`` methods lets you add new operators. Here is how to add -the ``!``, ``||``, and ``&&`` operators:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getOperators() - { - return [ - [ - '!' => ['precedence' => 50, 'class' => \Twig\Node\Expression\Unary\NotUnary::class], - ], - [ - '||' => ['precedence' => 10, 'class' => \Twig\Node\Expression\Binary\OrBinary::class, 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT], - '&&' => ['precedence' => 15, 'class' => \Twig\Node\Expression\Binary\AndBinary::class, 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT], - ], - ]; - } - - // ... - } - -Tests -~~~~~ - -The ``getTests()`` method lets you add new test functions:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getTests() - { - return [ - new \Twig\TwigTest('even', 'twig_test_even'), - ]; - } - - // ... - } - -Definition vs Runtime -~~~~~~~~~~~~~~~~~~~~~ - -Twig filters, functions, and tests runtime implementations can be defined as -any valid PHP callable: - -* **functions/static methods**: Simple to implement and fast (used by all Twig - core extensions); but it is hard for the runtime to depend on external - objects; - -* **closures**: Simple to implement; - -* **object methods**: More flexible and required if your runtime code depends - on external objects. - -The simplest way to use methods is to define them on the extension itself:: - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - private $rot13Provider; - - public function __construct($rot13Provider) - { - $this->rot13Provider = $rot13Provider; - } - - public function getFunctions() - { - return [ - new \Twig\TwigFunction('rot13', [$this, 'rot13']), - ]; - } - - public function rot13($value) - { - return $this->rot13Provider->rot13($value); - } - } - -This is very convenient but not recommended as it makes template compilation -depend on runtime dependencies even if they are not needed (think for instance -as a dependency that connects to a database engine). - -You can decouple the extension definitions from their runtime implementations by -registering a ``\Twig\RuntimeLoader\RuntimeLoaderInterface`` instance on the -environment that knows how to instantiate such runtime classes (runtime classes -must be autoload-able):: - - class RuntimeLoader implements \Twig\RuntimeLoader\RuntimeLoaderInterface - { - public function load($class) - { - // implement the logic to create an instance of $class - // and inject its dependencies - // most of the time, it means using your dependency injection container - if ('Project_Twig_RuntimeExtension' === $class) { - return new $class(new Rot13Provider()); - } else { - // ... - } - } - } - - $twig->addRuntimeLoader(new RuntimeLoader()); - -.. note:: - - Twig comes with a PSR-11 compatible runtime loader - (``\Twig\RuntimeLoader\ContainerRuntimeLoader``). - -It is now possible to move the runtime logic to a new -``Project_Twig_RuntimeExtension`` class and use it directly in the extension:: - - class Project_Twig_RuntimeExtension - { - private $rot13Provider; - - public function __construct($rot13Provider) - { - $this->rot13Provider = $rot13Provider; - } - - public function rot13($value) - { - return $this->rot13Provider->rot13($value); - } - } - - class Project_Twig_Extension extends \Twig\Extension\AbstractExtension - { - public function getFunctions() - { - return [ - new \Twig\TwigFunction('rot13', ['Project_Twig_RuntimeExtension', 'rot13']), - // or - new \Twig\TwigFunction('rot13', 'Project_Twig_RuntimeExtension::rot13'), - ]; - } - } - -Testing an Extension --------------------- - -Functional Tests -~~~~~~~~~~~~~~~~ - -You can create functional tests for extensions by creating the following file -structure in your test directory:: - - Fixtures/ - filters/ - foo.test - bar.test - functions/ - foo.test - bar.test - tags/ - foo.test - bar.test - IntegrationTest.php - -The ``IntegrationTest.php`` file should look like this:: - - use Twig\Test\IntegrationTestCase; - - class Project_Tests_IntegrationTest extends IntegrationTestCase - { - public function getExtensions() - { - return [ - new Project_Twig_Extension1(), - new Project_Twig_Extension2(), - ]; - } - - public function getFixturesDir() - { - return __DIR__.'/Fixtures/'; - } - } - -Fixtures examples can be found within the Twig repository -`tests/Twig/Fixtures`_ directory. - -Node Tests -~~~~~~~~~~ - -Testing the node visitors can be complex, so extend your test cases from -``\Twig\Test\NodeTestCase``. Examples can be found in the Twig repository -`tests/Twig/Node`_ directory. - -.. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/3.x/tests/Fixtures -.. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/3.x/tests/Node diff --git a/data/web/inc/lib/vendor/twig/twig/doc/api.rst b/data/web/inc/lib/vendor/twig/twig/doc/api.rst deleted file mode 100644 index 80dfaa58..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/api.rst +++ /dev/null @@ -1,583 +0,0 @@ -Twig for Developers -=================== - -This chapter describes the API to Twig and not the template language. It will -be most useful as reference to those implementing the template interface to -the application and not those who are creating Twig templates. - -Basics ------- - -Twig uses a central object called the **environment** (of class -``\Twig\Environment``). Instances of this class are used to store the -configuration and extensions, and are used to load templates. - -Most applications create one ``\Twig\Environment`` object on application -initialization and use that to load templates. In some cases, it might be useful -to have multiple environments side by side, with different configurations. - -The typical way to configure Twig to load templates for an application looks -roughly like this:: - - require_once '/path/to/vendor/autoload.php'; - - $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates'); - $twig = new \Twig\Environment($loader, [ - 'cache' => '/path/to/compilation_cache', - ]); - -This creates a template environment with a default configuration and a loader -that looks up templates in the ``/path/to/templates/`` directory. Different -loaders are available and you can also write your own if you want to load -templates from a database or other resources. - -.. note:: - - Notice that the second argument of the environment is an array of options. - The ``cache`` option is a compilation cache directory, where Twig caches - the compiled templates to avoid the parsing phase for sub-sequent - requests. It is very different from the cache you might want to add for - the evaluated templates. For such a need, you can use any available PHP - cache library. - -Rendering Templates -------------------- - -To load a template from a Twig environment, call the ``load()`` method which -returns a ``\Twig\TemplateWrapper`` instance:: - - $template = $twig->load('index.html'); - -To render the template with some variables, call the ``render()`` method:: - - echo $template->render(['the' => 'variables', 'go' => 'here']); - -.. note:: - - The ``display()`` method is a shortcut to output the rendered template. - -You can also load and render the template in one fell swoop:: - - echo $twig->render('index.html', ['the' => 'variables', 'go' => 'here']); - -If a template defines blocks, they can be rendered individually via the -``renderBlock()`` call:: - - echo $template->renderBlock('block_name', ['the' => 'variables', 'go' => 'here']); - -.. _environment_options: - -Environment Options -------------------- - -When creating a new ``\Twig\Environment`` instance, you can pass an array of -options as the constructor second argument:: - - $twig = new \Twig\Environment($loader, ['debug' => true]); - -The following options are available: - -* ``debug`` *boolean* - - When set to ``true``, the generated templates have a - ``__toString()`` method that you can use to display the generated nodes - (default to ``false``). - -* ``charset`` *string* (defaults to ``utf-8``) - - The charset used by the templates. - -* ``cache`` *string* or ``false`` - - An absolute path where to store the compiled templates, or - ``false`` to disable caching (which is the default). - -* ``auto_reload`` *boolean* - - When developing with Twig, it's useful to recompile the - template whenever the source code changes. If you don't provide a value for - the ``auto_reload`` option, it will be determined automatically based on the - ``debug`` value. - -* ``strict_variables`` *boolean* - - If set to ``false``, Twig will silently ignore invalid - variables (variables and or attributes/methods that do not exist) and - replace them with a ``null`` value. When set to ``true``, Twig throws an - exception instead (default to ``false``). - -* ``autoescape`` *string* - - Sets the default auto-escaping strategy (``name``, ``html``, ``js``, ``css``, - ``url``, ``html_attr``, or a PHP callback that takes the template "filename" - and returns the escaping strategy to use -- the callback cannot be a function - name to avoid collision with built-in escaping strategies); set it to - ``false`` to disable auto-escaping. The ``name`` escaping strategy determines - the escaping strategy to use for a template based on the template filename - extension (this strategy does not incur any overhead at runtime as - auto-escaping is done at compilation time.) - -* ``optimizations`` *integer* - - A flag that indicates which optimizations to apply - (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to - disable). - -Loaders -------- - -Loaders are responsible for loading templates from a resource such as the file -system. - -Compilation Cache -~~~~~~~~~~~~~~~~~ - -All template loaders can cache the compiled templates on the filesystem for -future reuse. It speeds up Twig a lot as templates are only compiled once. - -Built-in Loaders -~~~~~~~~~~~~~~~~ - -Here is a list of the built-in loaders: - -``\Twig\Loader\FilesystemLoader`` -................................. - -``\Twig\Loader\FilesystemLoader`` loads templates from the file system. This loader -can find templates in folders on the file system and is the preferred way to -load them:: - - $loader = new \Twig\Loader\FilesystemLoader($templateDir); - -It can also look for templates in an array of directories:: - - $loader = new \Twig\Loader\FilesystemLoader([$templateDir1, $templateDir2]); - -With such a configuration, Twig will first look for templates in -``$templateDir1`` and if they do not exist, it will fallback to look for them -in the ``$templateDir2``. - -You can add or prepend paths via the ``addPath()`` and ``prependPath()`` -methods:: - - $loader->addPath($templateDir3); - $loader->prependPath($templateDir4); - -The filesystem loader also supports namespaced templates. This allows to group -your templates under different namespaces which have their own template paths. - -When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods, -specify the namespace as the second argument (when not specified, these -methods act on the "main" namespace):: - - $loader->addPath($templateDir, 'admin'); - -Namespaced templates can be accessed via the special -``@namespace_name/template_path`` notation:: - - $twig->render('@admin/index.html', []); - -``\Twig\Loader\FilesystemLoader`` support absolute and relative paths. Using relative -paths is preferred as it makes the cache keys independent of the project root -directory (for instance, it allows warming the cache from a build server where -the directory might be different from the one used on production servers):: - - $loader = new \Twig\Loader\FilesystemLoader('templates', getcwd().'/..'); - -.. note:: - - When not passing the root path as a second argument, Twig uses ``getcwd()`` - for relative paths. - -``\Twig\Loader\ArrayLoader`` -............................ - -``\Twig\Loader\ArrayLoader`` loads a template from a PHP array. It is passed an -array of strings bound to template names:: - - $loader = new \Twig\Loader\ArrayLoader([ - 'index.html' => 'Hello {{ name }}!', - ]); - $twig = new \Twig\Environment($loader); - - echo $twig->render('index.html', ['name' => 'Fabien']); - -This loader is very useful for unit testing. It can also be used for small -projects where storing all templates in a single PHP file might make sense. - -.. tip:: - - When using the ``Array`` loader with a cache mechanism, you should know that - a new cache key is generated each time a template content "changes" (the - cache key being the source code of the template). If you don't want to see - your cache grows out of control, you need to take care of clearing the old - cache file by yourself. - -``\Twig\Loader\ChainLoader`` -............................ - -``\Twig\Loader\ChainLoader`` delegates the loading of templates to other loaders:: - - $loader1 = new \Twig\Loader\ArrayLoader([ - 'base.html' => '{% block content %}{% endblock %}', - ]); - $loader2 = new \Twig\Loader\ArrayLoader([ - 'index.html' => '{% extends "base.html" %}{% block content %}Hello {{ name }}{% endblock %}', - 'base.html' => 'Will never be loaded', - ]); - - $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]); - - $twig = new \Twig\Environment($loader); - -When looking for a template, Twig tries each loader in turn and returns as soon -as the template is found. When rendering the ``index.html`` template from the -above example, Twig will load it with ``$loader2`` but the ``base.html`` -template will be loaded from ``$loader1``. - -.. note:: - - You can also add loaders via the ``addLoader()`` method. - -Create your own Loader -~~~~~~~~~~~~~~~~~~~~~~ - -All loaders implement the ``\Twig\Loader\LoaderInterface``:: - - interface \Twig\Loader\LoaderInterface - { - /** - * Returns the source context for a given template logical name. - * - * @param string $name The template logical name - * - * @return \Twig\Source - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function getSourceContext($name); - - /** - * Gets the cache key to use for the cache for a given template name. - * - * @param string $name The name of the template to load - * - * @return string The cache key - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function getCacheKey($name); - - /** - * Returns true if the template is still fresh. - * - * @param string $name The template name - * @param timestamp $time The last modification time of the cached template - * - * @return bool true if the template is fresh, false otherwise - * - * @throws \Twig\Error\LoaderError When $name is not found - */ - public function isFresh($name, $time); - - /** - * Check if we have the source code of a template, given its name. - * - * @param string $name The name of the template to check if we can load - * - * @return bool If the template source code is handled by this loader or not - */ - public function exists($name); - } - -The ``isFresh()`` method must return ``true`` if the current cached template -is still fresh, given the last modification time, or ``false`` otherwise. - -The ``getSourceContext()`` method must return an instance of ``\Twig\Source``. - -Using Extensions ----------------- - -Twig extensions are packages that add new features to Twig. Register an -extension via the ``addExtension()`` method:: - - $twig->addExtension(new \Twig\Extension\SandboxExtension()); - -Twig comes bundled with the following extensions: - -* *Twig\Extension\CoreExtension*: Defines all the core features of Twig. - -* *Twig\Extension\DebugExtension*: Defines the ``dump`` function to help debug - template variables. - -* *Twig\Extension\EscaperExtension*: Adds automatic output-escaping and the - possibility to escape/unescape blocks of code. - -* *Twig\Extension\SandboxExtension*: Adds a sandbox mode to the default Twig - environment, making it safe to evaluate untrusted code. - -* *Twig\Extension\ProfilerExtension*: Enables the built-in Twig profiler. - -* *Twig\Extension\OptimizerExtension*: Optimizes the node tree before - compilation. - -* *Twig\Extension\StringLoaderExtension*: Defines the ``template_from_string`` - function to allow loading templates from string in a template. - -The Core, Escaper, and Optimizer extensions are registered by default. - -Built-in Extensions -------------------- - -This section describes the features added by the built-in extensions. - -.. tip:: - - Read the chapter about :doc:`extending Twig <advanced>` to learn how to - create your own extensions. - -Core Extension -~~~~~~~~~~~~~~ - -The ``core`` extension defines all the core features of Twig: - -* :doc:`Tags <tags/index>`; -* :doc:`Filters <filters/index>`; -* :doc:`Functions <functions/index>`; -* :doc:`Tests <tests/index>`. - -Escaper Extension -~~~~~~~~~~~~~~~~~ - -The ``escaper`` extension adds automatic output escaping to Twig. It defines a -tag, ``autoescape``, and a filter, ``raw``. - -When creating the escaper extension, you can switch on or off the global -output escaping strategy:: - - $escaper = new \Twig\Extension\EscaperExtension('html'); - $twig->addExtension($escaper); - -If set to ``html``, all variables in templates are escaped (using the ``html`` -escaping strategy), except those using the ``raw`` filter: - -.. code-block:: twig - - {{ article.to_html|raw }} - -You can also change the escaping mode locally by using the ``autoescape`` tag: - -.. code-block:: twig - - {% autoescape 'html' %} - {{ var }} - {{ var|raw }} {# var won't be escaped #} - {{ var|escape }} {# var won't be double-escaped #} - {% endautoescape %} - -.. warning:: - - The ``autoescape`` tag has no effect on included files. - -The escaping rules are implemented as follows: - -* Literals (integers, booleans, arrays, ...) used in the template directly as - variables or filter arguments are never automatically escaped: - - .. code-block:: html+twig - - {{ "Twig<br/>" }} {# won't be escaped #} - - {% set text = "Twig<br/>" %} - {{ text }} {# will be escaped #} - -* Expressions which the result is a literal or a variable marked safe - are never automatically escaped: - - .. code-block:: html+twig - - {{ foo ? "Twig<br/>" : "<br/>Twig" }} {# won't be escaped #} - - {% set text = "Twig<br/>" %} - {{ true ? text : "<br/>Twig" }} {# will be escaped #} - {{ false ? text : "<br/>Twig" }} {# won't be escaped #} - - {% set text = "Twig<br/>" %} - {{ foo ? text|raw : "<br/>Twig" }} {# won't be escaped #} - -* Objects with a ``__toString`` method are converted to strings and - escaped. You can mark some classes and/or interfaces as being safe for some - strategies via ``EscaperExtension::addSafeClass()``: - - .. code-block:: twig - - // mark object of class Foo as safe for the HTML strategy - $escaper->addSafeClass('Foo', ['html']); - - // mark object of interface Foo as safe for the HTML strategy - $escaper->addSafeClass('FooInterface', ['html']); - - // mark object of class Foo as safe for the HTML and JS strategies - $escaper->addSafeClass('Foo', ['html', 'js']); - - // mark object of class Foo as safe for all strategies - $escaper->addSafeClass('Foo', ['all']); - -* Escaping is applied before printing, after any other filter is applied: - - .. code-block:: twig - - {{ var|upper }} {# is equivalent to {{ var|upper|escape }} #} - -* The `raw` filter should only be used at the end of the filter chain: - - .. code-block:: twig - - {{ var|raw|upper }} {# will be escaped #} - - {{ var|upper|raw }} {# won't be escaped #} - -* Automatic escaping is not applied if the last filter in the chain is marked - safe for the current context (e.g. ``html`` or ``js``). ``escape`` and - ``escape('html')`` are marked safe for HTML, ``escape('js')`` is marked - safe for JavaScript, ``raw`` is marked safe for everything. - - .. code-block:: twig - - {% autoescape 'js' %} - {{ var|escape('html') }} {# will be escaped for HTML and JavaScript #} - {{ var }} {# will be escaped for JavaScript #} - {{ var|escape('js') }} {# won't be double-escaped #} - {% endautoescape %} - -.. note:: - - Note that autoescaping has some limitations as escaping is applied on - expressions after evaluation. For instance, when working with - concatenation, ``{{ foo|raw ~ bar }}`` won't give the expected result as - escaping is applied on the result of the concatenation, not on the - individual variables (so, the ``raw`` filter won't have any effect here). - -Sandbox Extension -~~~~~~~~~~~~~~~~~ - -The ``sandbox`` extension can be used to evaluate untrusted code. Access to -unsafe attributes and methods is prohibited. The sandbox security is managed -by a policy instance. By default, Twig comes with one policy class: -``\Twig\Sandbox\SecurityPolicy``. This class allows you to white-list some -tags, filters, properties, and methods:: - - $tags = ['if']; - $filters = ['upper']; - $methods = [ - 'Article' => ['getTitle', 'getBody'], - ]; - $properties = [ - 'Article' => ['title', 'body'], - ]; - $functions = ['range']; - $policy = new \Twig\Sandbox\SecurityPolicy($tags, $filters, $methods, $properties, $functions); - -With the previous configuration, the security policy will only allow usage of -the ``if`` tag, and the ``upper`` filter. Moreover, the templates will only be -able to call the ``getTitle()`` and ``getBody()`` methods on ``Article`` -objects, and the ``title`` and ``body`` public properties. Everything else -won't be allowed and will generate a ``\Twig\Sandbox\SecurityError`` exception. - -The policy object is the first argument of the sandbox constructor:: - - $sandbox = new \Twig\Extension\SandboxExtension($policy); - $twig->addExtension($sandbox); - -By default, the sandbox mode is disabled and should be enabled when including -untrusted template code by using the ``sandbox`` tag: - -.. code-block:: twig - - {% sandbox %} - {% include 'user.html' %} - {% endsandbox %} - -You can sandbox all templates by passing ``true`` as the second argument of -the extension constructor:: - - $sandbox = new \Twig\Extension\SandboxExtension($policy, true); - -Profiler Extension -~~~~~~~~~~~~~~~~~~ - -The ``profiler`` extension enables a profiler for Twig templates; it should -only be used on your development machines as it adds some overhead:: - - $profile = new \Twig\Profiler\Profile(); - $twig->addExtension(new \Twig\Extension\ProfilerExtension($profile)); - - $dumper = new \Twig\Profiler\Dumper\TextDumper(); - echo $dumper->dump($profile); - -A profile contains information about time and memory consumption for template, -block, and macro executions. - -You can also dump the data in a `Blackfire.io <https://blackfire.io/>`_ -compatible format:: - - $dumper = new \Twig\Profiler\Dumper\BlackfireDumper(); - file_put_contents('/path/to/profile.prof', $dumper->dump($profile)); - -Upload the profile to visualize it (create a `free account -<https://blackfire.io/signup?utm_source=twig&utm_medium=doc&utm_campaign=profiler>`_ -first): - -.. code-block:: sh - - blackfire --slot=7 upload /path/to/profile.prof - -Optimizer Extension -~~~~~~~~~~~~~~~~~~~ - -The ``optimizer`` extension optimizes the node tree before compilation:: - - $twig->addExtension(new \Twig\Extension\OptimizerExtension()); - -By default, all optimizations are turned on. You can select the ones you want -to enable by passing them to the constructor:: - - $optimizer = new \Twig\Extension\OptimizerExtension(\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR); - - $twig->addExtension($optimizer); - -Twig supports the following optimizations: - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_ALL``, enables all optimizations - (this is the default value). - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_NONE``, disables all optimizations. - This reduces the compilation time, but it can increase the execution time - and the consumed memory. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR``, optimizes the ``for`` tag by - removing the ``loop`` variable creation whenever possible. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_RAW_FILTER``, removes the ``raw`` - filter whenever possible. - -* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_VAR_ACCESS``, simplifies the creation - and access of variables in the compiled templates whenever possible. - -Exceptions ----------- - -Twig can throw exceptions: - -* ``\Twig\Error\Error``: The base exception for all errors. - -* ``\Twig\Error\SyntaxError``: Thrown to tell the user that there is a problem with - the template syntax. - -* ``\Twig\Error\RuntimeError``: Thrown when an error occurs at runtime (when a filter - does not exist for instance). - -* ``\Twig\Error\LoaderError``: Thrown when an error occurs during template loading. - -* ``\Twig\Sandbox\SecurityError``: Thrown when an unallowed tag, filter, or - method is called in a sandboxed template. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/coding_standards.rst b/data/web/inc/lib/vendor/twig/twig/doc/coding_standards.rst deleted file mode 100644 index 721b0f13..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/coding_standards.rst +++ /dev/null @@ -1,101 +0,0 @@ -Coding Standards -================ - -When writing Twig templates, we recommend you to follow these official coding -standards: - -* Put one (and only one) space after the start of a delimiter (``{{``, ``{%``, - and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``): - - .. code-block:: twig - - {{ foo }} - {# comment #} - {% if foo %}{% endif %} - - When using the whitespace control character, do not put any spaces between - it and the delimiter: - - .. code-block:: twig - - {{- foo -}} - {#- comment -#} - {%- if foo -%}{%- endif -%} - -* Put one (and only one) space before and after the following operators: - comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math - operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic - operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary - operator (``?:``): - - .. code-block:: twig - - {{ 1 + 2 }} - {{ foo ~ bar }} - {{ true ? true : false }} - -* Put one (and only one) space after the ``:`` sign in hashes and ``,`` in - arrays and hashes: - - .. code-block:: twig - - {{ [1, 2, 3] }} - {{ {'foo': 'bar'} }} - -* Do not put any spaces after an opening parenthesis and before a closing - parenthesis in expressions: - - .. code-block:: twig - - {{ 1 + (2 * 3) }} - -* Do not put any spaces before and after string delimiters: - - .. code-block:: twig - - {{ 'foo' }} - {{ "foo" }} - -* Do not put any spaces before and after the following operators: ``|``, - ``.``, ``..``, ``[]``: - - .. code-block:: twig - - {{ foo|upper|lower }} - {{ user.name }} - {{ user[name] }} - {% for i in 1..12 %}{% endfor %} - -* Do not put any spaces before and after the parenthesis used for filter and - function calls: - - .. code-block:: twig - - {{ foo|default('foo') }} - {{ range(1..10) }} - -* Do not put any spaces before and after the opening and the closing of arrays - and hashes: - - .. code-block:: twig - - {{ [1, 2, 3] }} - {{ {'foo': 'bar'} }} - -* Use lower cased and underscored variable names: - - .. code-block:: twig - - {% set foo = 'foo' %} - {% set foo_bar = 'foo' %} - -* Indent your code inside tags (use the same indentation as the one used for - the target language of the rendered template): - - .. code-block:: twig - - {% block foo %} - {% if true %} - true - {% endif %} - {% endblock %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/deprecated.rst b/data/web/inc/lib/vendor/twig/twig/doc/deprecated.rst deleted file mode 100644 index ac22338e..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/deprecated.rst +++ /dev/null @@ -1,6 +0,0 @@ -Deprecated Features -=================== - -This document lists deprecated features in Twig 3.x. Deprecated features are -kept for backward compatibility and removed in the next major release (a -feature that was deprecated in Twig 3.x is removed in Twig 4.0). diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/abs.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/abs.rst deleted file mode 100644 index 77d5cf05..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/abs.rst +++ /dev/null @@ -1,18 +0,0 @@ -``abs`` -======= - -The ``abs`` filter returns the absolute value. - -.. code-block:: twig - - {# number = -5 #} - - {{ number|abs }} - - {# outputs 5 #} - -.. note:: - - Internally, Twig uses the PHP `abs`_ function. - -.. _`abs`: https://secure.php.net/abs diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/batch.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/batch.rst deleted file mode 100644 index 18a227fe..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/batch.rst +++ /dev/null @@ -1,44 +0,0 @@ -``batch`` -========= - -The ``batch`` filter "batches" items by returning a list of lists with the -given number of items. A second parameter can be provided and used to fill in -missing items: - -.. code-block:: html+twig - - {% set items = ['a', 'b', 'c', 'd'] %} - - <table> - {% for row in items|batch(3, 'No item') %} - <tr> - {% for column in row %} - <td>{{ column }}</td> - {% endfor %} - </tr> - {% endfor %} - </table> - -The above example will be rendered as: - -.. code-block:: html+twig - - <table> - <tr> - <td>a</td> - <td>b</td> - <td>c</td> - </tr> - <tr> - <td>d</td> - <td>No item</td> - <td>No item</td> - </tr> - </table> - -Arguments ---------- - -* ``size``: The size of the batch; fractional numbers will be rounded up -* ``fill``: Used to fill in missing items -* ``preserve_keys``: Whether to preserve keys or not diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/capitalize.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/capitalize.rst deleted file mode 100644 index 2353658b..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/capitalize.rst +++ /dev/null @@ -1,11 +0,0 @@ -``capitalize`` -============== - -The ``capitalize`` filter capitalizes a value. The first character will be -uppercase, all others lowercase: - -.. code-block:: twig - - {{ 'my first car'|capitalize }} - - {# outputs 'My first car' #} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/column.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/column.rst deleted file mode 100644 index 5b6769b8..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/column.rst +++ /dev/null @@ -1,24 +0,0 @@ -``column`` -========== - -The ``column`` filter returns the values from a single column in the input -array. - -.. code-block:: twig - - {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %} - - {% set fruits = items|column('fruit') %} - - {# fruits now contains ['apple', 'orange'] #} - -.. note:: - - Internally, Twig uses the PHP `array_column`_ function. - -Arguments ---------- - -* ``name``: The column name to extract - -.. _`array_column`: https://secure.php.net/array_column diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/convert_encoding.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/convert_encoding.rst deleted file mode 100644 index d977c752..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/convert_encoding.rst +++ /dev/null @@ -1,22 +0,0 @@ -``convert_encoding`` -==================== - -The ``convert_encoding`` filter converts a string from one encoding to -another. The first argument is the expected output charset and the second one -is the input charset: - -.. code-block:: twig - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - -.. note:: - - This filter relies on the `iconv`_ extension. - -Arguments ---------- - -* ``to``: The output charset -* ``from``: The input charset - -.. _`iconv`: https://secure.php.net/iconv diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/country_name.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/country_name.rst deleted file mode 100644 index 434b0bda..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/country_name.rst +++ /dev/null @@ -1,44 +0,0 @@ -``country_name`` -================ - -The ``country_name`` filter returns the country name given its ISO-3166 -two-letter code: - -.. code-block:: twig - - {# France #} - {{ 'FR'|country_name }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# États-Unis #} - {{ 'US'|country_name('fr') }} - -.. note:: - - The ``country_name`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/currency_name.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/currency_name.rst deleted file mode 100644 index a35c4999..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/currency_name.rst +++ /dev/null @@ -1,47 +0,0 @@ -``currency_name`` -================= - -The ``currency_name`` filter returns the currency name given its three-letter -code: - -.. code-block:: twig - - {# Euro #} - {{ 'EUR'|currency_name }} - - {# Japanese Yen #} - {{ 'JPY'|currency_name }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# yen japonais #} - {{ 'JPY'|currency_name('fr_FR') }} - -.. note:: - - The ``currency_name`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/currency_symbol.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/currency_symbol.rst deleted file mode 100644 index 84a048ed..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/currency_symbol.rst +++ /dev/null @@ -1,47 +0,0 @@ -``currency_symbol`` -=================== - -The ``currency_symbol`` filter returns the currency symbol given its three-letter -code: - -.. code-block:: twig - - {# € #} - {{ 'EUR'|currency_symbol }} - - {# ¥ #} - {{ 'JPY'|currency_symbol }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# ¥ #} - {{ 'JPY'|currency_symbol('fr') }} - -.. note:: - - The ``currency_symbol`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/data_uri.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/data_uri.rst deleted file mode 100644 index e008266b..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/data_uri.rst +++ /dev/null @@ -1,55 +0,0 @@ -``data_uri`` -============ - -The ``data_uri`` filter generates a URL using the data scheme as defined in -`RFC 2397`_: - -.. code-block:: html+twig - - {{ image_data|data_uri }} - - {{ source('path_to_image')|data_uri }} - - {# force the mime type, disable the guessing of the mime type #} - {{ image_data|data_uri(mime="image/svg") }} - - {# also works with plain text #} - {{ '<b>foobar</b>'|data_uri(mime="text/html") }} - - {# add some extra parameters #} - {{ '<b>foobar</b>'|data_uri(mime="text/html", parameters={charset: "ascii"}) }} - -.. note:: - - The ``data_uri`` filter is part of the ``HtmlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/html-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Html\HtmlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new HtmlExtension()); - -.. note:: - - The filter does not perform any length validation on purpose (limit depends - on the usage context), validation should be done before calling this filter. - -Arguments ---------- - -* ``mime``: The mime type -* ``parameters``: An array of parameters - -.. _RFC 2397: https://tools.ietf.org/html/rfc2397 diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/date.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/date.rst deleted file mode 100644 index ec08d556..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/date.rst +++ /dev/null @@ -1,78 +0,0 @@ -``date`` -======== - -The ``date`` filter formats a date to a given format: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y") }} - -The format specifier is the same as supported by `date`_, -except when the filtered data is of type `DateInterval`_, when the format must conform to -`DateInterval::format`_ instead. - -The ``date`` filter accepts strings (it must be in a format supported by the -`strtotime`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For -instance, to display the current date, filter the word "now": - -.. code-block:: twig - - {{ "now"|date("m/d/Y") }} - -To escape words and characters in the date format use ``\\`` in front of each -character: - -.. code-block:: twig - - {{ post.published_at|date("F jS \\a\\t g:ia") }} - -If the value passed to the ``date`` filter is ``null``, it will return the -current date by default. If an empty string is desired instead of the current -date, use a ternary operator: - -.. code-block:: twig - - {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }} - -If no format is provided, Twig will use the default one: ``F j, Y H:i``. This -default can be changed by calling the ``setDateFormat()`` method on the -``core`` extension instance. The first argument is the default format for -dates and the second one is the default format for date intervals:: - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setDateFormat('d/m/Y', '%d days'); - -Timezone --------- - -By default, the date is displayed by applying the default timezone (the one -specified in php.ini or declared in Twig -- see below), but you can override -it by explicitly specifying a timezone: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y", "Europe/Paris") }} - -If the date is already a DateTime object, and if you want to keep its current -timezone, pass ``false`` as the timezone value: - -.. code-block:: twig - - {{ post.published_at|date("m/d/Y", false) }} - -The default timezone can also be set globally by calling ``setTimezone()``:: - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris'); - -Arguments ---------- - -* ``format``: The date format -* ``timezone``: The date timezone - -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime -.. _`DateInterval`: https://secure.php.net/DateInterval -.. _`date`: https://secure.php.net/date -.. _`DateInterval::format`: https://secure.php.net/DateInterval.format diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/date_modify.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/date_modify.rst deleted file mode 100644 index cc5d6df1..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/date_modify.rst +++ /dev/null @@ -1,20 +0,0 @@ -``date_modify`` -=============== - -The ``date_modify`` filter modifies a date with a given modifier string: - -.. code-block:: twig - - {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }} - -The ``date_modify`` filter accepts strings (it must be in a format supported -by the `strtotime`_ function) or `DateTime`_ instances. You can combine -it with the :doc:`date<date>` filter for formatting. - -Arguments ---------- - -* ``modifier``: The modifier - -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/default.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/default.rst deleted file mode 100644 index 2376fe7a..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/default.rst +++ /dev/null @@ -1,42 +0,0 @@ -``default`` -=========== - -The ``default`` filter returns the passed default value if the value is -undefined or empty, otherwise the value of the variable: - -.. code-block:: twig - - {{ var|default('var is not defined') }} - - {{ var.foo|default('foo item on var is not defined') }} - - {{ var['foo']|default('foo item on var is not defined') }} - - {{ ''|default('passed var is empty') }} - -When using the ``default`` filter on an expression that uses variables in some -method calls, be sure to use the ``default`` filter whenever a variable can be -undefined: - -.. code-block:: twig - - {{ var.method(foo|default('foo'))|default('foo') }} - -Using the ``default`` filter on a boolean variable might trigger unexpected behavior, as -``false`` is treated as an empty value. Consider using ``??`` instead: - -.. code-block:: twig - - {% set foo = false %} - {{ foo|default(true) }} {# true #} - {{ foo ?? true }} {# false #} - -.. note:: - - Read the documentation for the :doc:`defined<../tests/defined>` and - :doc:`empty<../tests/empty>` tests to learn more about their semantics. - -Arguments ---------- - -* ``default``: The default value diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/escape.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/escape.rst deleted file mode 100644 index f105d97a..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/escape.rst +++ /dev/null @@ -1,117 +0,0 @@ -``escape`` -========== - -The ``escape`` filter escapes a string using strategies that depend on the -context. - -By default, it uses the HTML escaping strategy: - -.. code-block:: html+twig - - <p> - {{ user.username|escape }} - </p> - -For convenience, the ``e`` filter is defined as an alias: - -.. code-block:: html+twig - - <p> - {{ user.username|e }} - </p> - -The ``escape`` filter can also be used in other contexts than HTML thanks to -an optional argument which defines the escaping strategy to use: - -.. code-block:: twig - - {{ user.username|e }} - {# is equivalent to #} - {{ user.username|e('html') }} - -And here is how to escape variables included in JavaScript code: - -.. code-block:: twig - - {{ user.username|escape('js') }} - {{ user.username|e('js') }} - -The ``escape`` filter supports the following escaping strategies for HTML -documents: - -* ``html``: escapes a string for the **HTML body** context. - -* ``js``: escapes a string for the **JavaScript** context. - -* ``css``: escapes a string for the **CSS** context. CSS escaping can be - applied to any string being inserted into CSS and escapes everything except - alphanumerics. - -* ``url``: escapes a string for the **URI or parameter** contexts. This should - not be used to escape an entire URI; only a subcomponent being inserted. - -* ``html_attr``: escapes a string for the **HTML attribute** context. - -Note that doing contextual escaping in HTML documents is hard and choosing the -right escaping strategy depends on a lot of factors. Please, read related -documentation like `the OWASP prevention cheat sheet -<https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md>`_ -to learn more about this topic. - -.. note:: - - Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function - for the HTML escaping strategy. - -.. caution:: - - When using automatic escaping, Twig tries to not double-escape a variable - when the automatic escaping strategy is the same as the one applied by the - escape filter; but that does not work when using a variable as the - escaping strategy: - - .. code-block:: twig - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape('html') }} {# won't be double-escaped #} - {{ var|escape(strategy) }} {# will be double-escaped #} - {% endautoescape %} - - When using a variable as the escaping strategy, you should disable - automatic escaping: - - .. code-block:: twig - - {% set strategy = 'html' %} - - {% autoescape 'html' %} - {{ var|escape(strategy)|raw }} {# won't be double-escaped #} - {% endautoescape %} - -Custom Escapers ---------------- - -You can define custom escapers by calling the ``setEscaper()`` method on the -escaper extension instance. The first argument is the escaper name (to be -used in the ``escape`` call) and the second one must be a valid PHP callable:: - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\EscaperExtension::class)->setEscaper('csv', 'csv_escaper'); - -When called by Twig, the callable receives the Twig environment instance, the -string to escape, and the charset. - -.. note:: - - Built-in escapers cannot be overridden mainly because they should be - considered as the final implementation and also for better performance. - -Arguments ---------- - -* ``strategy``: The escaping strategy -* ``charset``: The string charset - -.. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/filter.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/filter.rst deleted file mode 100644 index 257421f6..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/filter.rst +++ /dev/null @@ -1,55 +0,0 @@ -``filter`` -========== - -The ``filter`` filter filters elements of a sequence or a mapping using an arrow -function. The arrow function receives the value of the sequence or mapping: - -.. code-block:: twig - - {% set sizes = [34, 36, 38, 40, 42] %} - - {{ sizes|filter(v => v > 38)|join(', ') }} - {# output 40, 42 #} - -Combined with the ``for`` tag, it allows to filter the items to iterate over: - -.. code-block:: twig - - {% for v in sizes|filter(v => v > 38) -%} - {{ v }} - {% endfor %} - {# output 40 42 #} - -It also works with mappings: - -.. code-block:: twig - - {% set sizes = { - xs: 34, - s: 36, - m: 38, - l: 40, - xl: 42, - } %} - - {% for k, v in sizes|filter(v => v > 38) -%} - {{ k }} = {{ v }} - {% endfor %} - {# output l = 40 xl = 42 #} - -The arrow function also receives the key as a second argument: - -.. code-block:: twig - - {% for k, v in sizes|filter((v, k) => v > 38 and k != "xl") -%} - {{ k }} = {{ v }} - {% endfor %} - {# output l = 40 #} - -Note that the arrow function has access to the current context. - -Arguments ---------- - -* ``array``: The sequence or mapping -* ``arrow``: The arrow function diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/first.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/first.rst deleted file mode 100644 index 8d7081a5..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/first.rst +++ /dev/null @@ -1,22 +0,0 @@ -``first`` -========= - -The ``first`` filter returns the first "element" of a sequence, a mapping, or -a string: - -.. code-block:: twig - - {{ [1, 2, 3, 4]|first }} - {# outputs 1 #} - - {{ { a: 1, b: 2, c: 3, d: 4 }|first }} - {# outputs 1 #} - - {{ '1234'|first }} - {# outputs 1 #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/format.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/format.rst deleted file mode 100644 index 782ea75c..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/format.rst +++ /dev/null @@ -1,18 +0,0 @@ -``format`` -========== - -The ``format`` filter formats a given string by replacing the placeholders -(placeholders follows the `sprintf`_ notation): - -.. code-block:: twig - - {{ "I like %s and %s."|format(foo, "bar") }} - - {# outputs I like foo and bar - if the foo parameter equals to the foo string. #} - -.. seealso:: - - :doc:`replace<replace>` - -.. _`sprintf`: https://secure.php.net/sprintf diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_currency.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/format_currency.rst deleted file mode 100644 index 8b649bf5..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_currency.rst +++ /dev/null @@ -1,77 +0,0 @@ -``format_currency`` -=================== - -The ``format_currency`` filter formats a number as a currency: - -.. code-block:: twig - - {# €1,000,000.00 #} - {{ '1000000'|format_currency('EUR') }} - -You can pass attributes to tweak the output: - -.. code-block:: twig - - {# €12.34 #} - {{ '12.345'|format_currency('EUR', {rounding_mode: 'floor'}) }} - - {# €1,000,000.0000 #} - {{ '1000000'|format_currency('EUR', {fraction_digit: 4}) }} - -The list of supported options: - -* ``grouping_used``; -* ``decimal_always_shown``; -* ``max_integer_digit``; -* ``min_integer_digit``; -* ``integer_digit``; -* ``max_fraction_digit``; -* ``min_fraction_digit``; -* ``fraction_digit``; -* ``multiplier``; -* ``grouping_size``; -* ``rounding_mode``; -* ``rounding_increment``; -* ``format_width``; -* ``padding_position``; -* ``secondary_grouping_size``; -* ``significant_digits_used``; -* ``min_significant_digits_used``; -* ``max_significant_digits_used``; -* ``lenient_parse``. - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# 1.000.000,00 € #} - {{ '1000000'|format_currency('EUR', locale='de') }} - -.. note:: - - The ``format_currency`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``currency``: The currency -* ``attrs``: A map of attributes -* ``locale``: The locale diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_date.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/format_date.rst deleted file mode 100644 index c4a900a4..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_date.rst +++ /dev/null @@ -1,36 +0,0 @@ -``format_date`` -=============== - -The ``format_date`` filter formats a date. It behaves in the exact same way as -the :doc:`format_datetime<format_datetime>` filter, but without the time. - -.. note:: - - The ``format_date`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``dateFormat``: The date format -* ``pattern``: A date time pattern -* ``timezone``: The date timezone -* ``calendar``: The calendar (Gregorian by default) diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_datetime.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/format_datetime.rst deleted file mode 100644 index 1fdaa1ed..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_datetime.rst +++ /dev/null @@ -1,73 +0,0 @@ -``format_datetime`` -=================== - -The ``format_datetime`` filter formats a date time: - -.. code-block:: twig - - {# Aug 7, 2019, 11:39:12 PM #} - {{ '2019-08-07 23:39:12'|format_datetime() }} - -You can tweak the output for the date part and the time part: - -.. code-block:: twig - - {# 23:39 #} - {{ '2019-08-07 23:39:12'|format_datetime('none', 'short', locale='fr') }} - - {# 07/08/2019 #} - {{ '2019-08-07 23:39:12'|format_datetime('short', 'none', locale='fr') }} - - {# mercredi 7 août 2019 23:39:12 UTC #} - {{ '2019-08-07 23:39:12'|format_datetime('full', 'full', locale='fr') }} - -Supported values are: ``none``, ``short``, ``medium``, ``long``, and ``full``. - -For greater flexiblity, you can even define your own pattern (see the `ICU user -guide -<https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax>`_ -for supported patterns). - -.. code-block:: twig - - {# 11 oclock PM, GMT #} - {{ '2019-08-07 23:39:12'|format_datetime(pattern="hh 'oclock' a, zzzz") }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# 7 août 2019 23:39:12 #} - {{ '2019-08-07 23:39:12'|format_datetime(locale='fr') }} - -.. note:: - - The ``format_datetime`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``dateFormat``: The date format -* ``timeFormat``: The time format -* ``pattern``: A date time pattern -* ``timezone``: The date timezone -* ``calendar``: The calendar (Gregorian by default) diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_number.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/format_number.rst deleted file mode 100644 index a1c2804a..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_number.rst +++ /dev/null @@ -1,117 +0,0 @@ -``format_number`` -================= - -The ``format_number`` filter formats a number: - -.. code-block:: twig - - {{ '12.345'|format_number }} - -You can pass attributes to tweak the output: - -.. code-block:: twig - - {# 12.34 #} - {{ '12.345'|format_number({rounding_mode: 'floor'}) }} - - {# 1000000.0000 #} - {{ '1000000'|format_number({fraction_digit: 4}) }} - -The list of supported options: - -* ``grouping_used``; -* ``decimal_always_shown``; -* ``max_integer_digit``; -* ``min_integer_digit``; -* ``integer_digit``; -* ``max_fraction_digit``; -* ``min_fraction_digit``; -* ``fraction_digit``; -* ``multiplier``; -* ``grouping_size``; -* ``rounding_mode``; -* ``rounding_increment``; -* ``format_width``; -* ``padding_position``; -* ``secondary_grouping_size``; -* ``significant_digits_used``; -* ``min_significant_digits_used``; -* ``max_significant_digits_used``; -* ``lenient_parse``. - -Besides plain numbers, the filter can also format numbers in various styles: - -.. code-block:: twig - - {# 1,234% #} - {{ '12.345'|format_number(style='percent') }} - - {# twelve point three four five #} - {{ '12.345'|format_number(style='spellout') }} - - {# 12 sec. #} - {{ '12'|format_duration_number }} - -The list of supported styles: - -* ``decimal``; -* ``currency``; -* ``percent``; -* ``scientific``; -* ``spellout``; -* ``ordinal``; -* ``duration``. - -As a shortcut, you can use the ``format_*_number`` filters by replacing `*` with -a style: - -.. code-block:: twig - - {# 1,234% #} - {{ '12.345'|format_percent_number }} - - {# twelve point three four five #} - {{ '12.345'|format_spellout_number }} - -You can pass attributes to tweak the output: - -.. code-block:: twig - - {# 12.3% #} - {{ '0.12345'|format_percent_number({rounding_mode: 'floor', fraction_digit: 1}) }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# 12,345 #} - {{ '12.345'|format_number(locale='fr') }} - -.. note:: - - The ``format_number`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``attrs``: A map of attributes -* ``style``: The style of the number output diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_time.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/format_time.rst deleted file mode 100644 index 417b8a9c..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/format_time.rst +++ /dev/null @@ -1,36 +0,0 @@ -``format_time`` -=============== - -The ``format_time`` filter formats a time. It behaves in the exact same way as -the :doc:`format_datetime<format_datetime>` filter, but without the date. - -.. note:: - - The ``format_time`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale -* ``timeFormat``: The time format -* ``pattern``: A date time pattern -* ``timezone``: The date timezone -* ``calendar``: The calendar (Gregorian by default) diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/html_to_markdown.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/html_to_markdown.rst deleted file mode 100644 index 80145df5..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/html_to_markdown.rst +++ /dev/null @@ -1,77 +0,0 @@ -``html_to_markdown`` -==================== - -The ``html_to_markdown`` filter converts a block of HTML to Markdown: - -.. code-block:: html+twig - - {% apply html_to_markdown %} - <html> - <h1>Hello!</h1> - </html> - {% endapply %} - -You can also use the filter on an entire template which you ``include``: - -.. code-block:: twig - - {{ include('some_template.html.twig')|html_to_markdown }} - -.. note:: - - The ``html_to_markdown`` filter is part of the ``MarkdownExtension`` which - is not installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/markdown-extra - - On Symfony projects, you can automatically enable it by installing the - ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Or add the extension explicitly on the Twig environment:: - - use Twig\Extra\Markdown\MarkdownExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new MarkdownExtension()); - - If you are not using Symfony, you must also register the extension runtime:: - - use Twig\Extra\Markdown\DefaultMarkdown; - use Twig\Extra\Markdown\MarkdownRuntime; - use Twig\RuntimeLoader\RuntimeLoaderInterface; - - $twig->addRuntimeLoader(new class implements RuntimeLoaderInterface { - public function load($class) { - if (MarkdownRuntime::class === $class) { - return new MarkdownRuntime(new DefaultMarkdown()); - } - } - }); - -``html_to_markdown`` is just a frontend; the actual conversion is done by one of -the following compatible libraries, from which you can choose: - -* `erusev/parsedown`_ -* `league/html-to-markdown`_ -* `michelf/php-markdown`_ - -Depending on the library, you can also add some options by passing them as an argument -to the filter. Example for ``league/html-to-markdown``: - -.. code-block:: html+twig - - {% apply html_to_markdown({hard_break: false}) %} - <html> - <h1>Hello!</h1> - </html> - {% endapply %} - -.. _erusev/parsedown: https://github.com/erusev/parsedown -.. _league/html-to-markdown: https://github.com/thephpleague/html-to-markdown -.. _michelf/php-markdown: https://github.com/michelf/php-markdown diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/index.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/index.rst deleted file mode 100644 index eea2383e..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/index.rst +++ /dev/null @@ -1,60 +0,0 @@ -Filters -======= - -.. toctree:: - :maxdepth: 1 - - abs - batch - capitalize - column - convert_encoding - country_name - currency_name - currency_symbol - data_uri - date - date_modify - default - escape - filter - first - format - format_currency - format_date - format_datetime - format_number - format_time - html_to_markdown - inline_css - inky_to_html - join - json_encode - keys - language_name - last - length - locale_name - lower - map - markdown_to_html - merge - nl2br - number_format - raw - reduce - replace - reverse - round - slice - slug - sort - spaceless - split - striptags - timezone_name - title - trim - u - upper - url_encode diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/inky_to_html.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/inky_to_html.rst deleted file mode 100644 index 563baba3..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/inky_to_html.rst +++ /dev/null @@ -1,42 +0,0 @@ -``inky_to_html`` -================ - -The ``inky_to_html`` filter processes an `inky email template -<https://github.com/zurb/inky>`_: - -.. code-block:: html+twig - - {% apply inky_to_html %} - <row> - <columns large="6"></columns> - <columns large="6"></columns> - </row> - {% endapply %} - -You can also use the filter on an included file: - -.. code-block:: twig - - {{ include('some_template.inky.twig')|inky_to_html }} - -.. note:: - - The ``inky_to_html`` filter is part of the ``InkyExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/inky-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Inky\InkyExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new InkyExtension()); diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/inline_css.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/inline_css.rst deleted file mode 100644 index 44b14262..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/inline_css.rst +++ /dev/null @@ -1,66 +0,0 @@ -``inline_css`` -============== - -The ``inline_css`` filter inline CSS styles in HTML documents: - -.. code-block:: html+twig - - {% apply inline_css %} - <html> - <head> - <style> - p { color: red; } - </style> - </head> - <body> - <p>Hello CSS!</p> - </body> - </html> - {% endapply %} - -You can also add some stylesheets by passing them as arguments to the filter: - -.. code-block:: html+twig - - {% apply inline_css(source("some_styles.css"), source("another.css")) %} - <html> - <body> - <p>Hello CSS!</p> - </body> - </html> - {% endapply %} - -Styles loaded via the filter override the styles defined in the ``<style>`` tag -of the HTML document. - -You can also use the filter on an included file: - -.. code-block:: twig - - {{ include('some_template.html.twig')|inline_css }} - - {{ include('some_template.html.twig')|inline_css(source("some_styles.css")) }} - -Note that the CSS inliner works on an entire HTML document, not a fragment. - -.. note:: - - The ``inline_css`` filter is part of the ``CssInlinerExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/cssinliner-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\CssInliner\CssInlinerExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new CssInlinerExtension()); diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/join.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/join.rst deleted file mode 100644 index d57be66e..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/join.rst +++ /dev/null @@ -1,32 +0,0 @@ -``join`` -======== - -The ``join`` filter returns a string which is the concatenation of the items -of a sequence: - -.. code-block:: twig - - {{ [1, 2, 3]|join }} - {# returns 123 #} - -The separator between elements is an empty string per default, but you can -define it with the optional first parameter: - -.. code-block:: twig - - {{ [1, 2, 3]|join('|') }} - {# outputs 1|2|3 #} - -A second parameter can also be provided that will be the separator used between -the last two items of the sequence: - -.. code-block:: twig - - {{ [1, 2, 3]|join(', ', ' and ') }} - {# outputs 1, 2 and 3 #} - -Arguments ---------- - -* ``glue``: The separator -* ``and``: The separator for the last pair of input items diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/json_encode.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/json_encode.rst deleted file mode 100644 index 434e2f17..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/json_encode.rst +++ /dev/null @@ -1,23 +0,0 @@ -``json_encode`` -=============== - -The ``json_encode`` filter returns the JSON representation of a value: - -.. code-block:: twig - - {{ data|json_encode() }} - -.. note:: - - Internally, Twig uses the PHP `json_encode`_ function. - -Arguments ---------- - -* ``options``: A bitmask of `json_encode options`_: ``{{ - data|json_encode(constant('JSON_PRETTY_PRINT')) }}``. - Combine constants using :ref:`bitwise operators<template_logic>`: - ``{{ data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT')) }}`` - -.. _`json_encode`: https://secure.php.net/json_encode -.. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/keys.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/keys.rst deleted file mode 100644 index 58609471..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/keys.rst +++ /dev/null @@ -1,11 +0,0 @@ -``keys`` -======== - -The ``keys`` filter returns the keys of an array. It is useful when you want to -iterate over the keys of an array: - -.. code-block:: twig - - {% for key in array|keys %} - ... - {% endfor %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/language_name.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/language_name.rst deleted file mode 100644 index 55c24392..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/language_name.rst +++ /dev/null @@ -1,47 +0,0 @@ -``language_name`` -================= - -The ``language_name`` filter returns the language name given its two-letter -code: - -.. code-block:: twig - - {# German #} - {{ 'de'|language_name }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# allemand #} - {{ 'de'|language_name('fr') }} - - {# français canadien #} - {{ 'fr_CA'|language_name('fr_FR') }} - -.. note:: - - The ``language_name`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/last.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/last.rst deleted file mode 100644 index 2b7c45bd..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/last.rst +++ /dev/null @@ -1,22 +0,0 @@ -``last`` -======== - -The ``last`` filter returns the last "element" of a sequence, a mapping, or -a string: - -.. code-block:: twig - - {{ [1, 2, 3, 4]|last }} - {# outputs 4 #} - - {{ { a: 1, b: 2, c: 3, d: 4 }|last }} - {# outputs 4 #} - - {{ '1234'|last }} - {# outputs 4 #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/length.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/length.rst deleted file mode 100644 index d3671223..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/length.rst +++ /dev/null @@ -1,19 +0,0 @@ -``length`` -========== - -The ``length`` filter returns the number of items of a sequence or mapping, or -the length of a string. - -For objects that implement the ``Countable`` interface, ``length`` will use the -return value of the ``count()`` method. - -For objects that implement the ``__toString()`` magic method (and not ``Countable``), -it will return the length of the string provided by that method. - -For objects that implement the ``Traversable`` interface, ``length`` will use the return value of the ``iterator_count()`` method. - -.. code-block:: twig - - {% if users|length > 10 %} - ... - {% endif %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/locale_name.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/locale_name.rst deleted file mode 100644 index c6d34cbc..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/locale_name.rst +++ /dev/null @@ -1,47 +0,0 @@ -``locale_name`` -=============== - -The ``locale_name`` filter returns the locale name given its two-letter -code: - -.. code-block:: twig - - {# German #} - {{ 'de'|locale_name }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# allemand #} - {{ 'de'|locale_name('fr') }} - - {# français (Canada) #} - {{ 'fr_CA'|locale_name('fr_FR') }} - -.. note:: - - The ``locale_name`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/lower.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/lower.rst deleted file mode 100644 index c0a0e0cd..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/lower.rst +++ /dev/null @@ -1,10 +0,0 @@ -``lower`` -========= - -The ``lower`` filter converts a value to lowercase: - -.. code-block:: twig - - {{ 'WELCOME'|lower }} - - {# outputs 'welcome' #} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/map.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/map.rst deleted file mode 100644 index 1083bfe5..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/map.rst +++ /dev/null @@ -1,34 +0,0 @@ -``map`` -======= - -The ``map`` filter applies an arrow function to the elements of a sequence or a -mapping. The arrow function receives the value of the sequence or mapping: - -.. code-block:: twig - - {% set people = [ - {first: "Bob", last: "Smith"}, - {first: "Alice", last: "Dupond"}, - ] %} - - {{ people|map(p => "#{p.first} #{p.last}")|join(', ') }} - {# outputs Bob Smith, Alice Dupond #} - -The arrow function also receives the key as a second argument: - -.. code-block:: twig - - {% set people = { - "Bob": "Smith", - "Alice": "Dupond", - } %} - - {{ people|map((last, first) => "#{first} #{last}")|join(', ') }} - {# outputs Bob Smith, Alice Dupond #} - -Note that the arrow function has access to the current context. - -Arguments ---------- - -* ``arrow``: The arrow function diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/markdown_to_html.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/markdown_to_html.rst deleted file mode 100644 index 3903746e..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/markdown_to_html.rst +++ /dev/null @@ -1,72 +0,0 @@ -``markdown_to_html`` -==================== - -The ``markdown_to_html`` filter converts a block of Markdown to HTML: - -.. code-block:: twig - - {% apply markdown_to_html %} - Title - ====== - - Hello! - {% endapply %} - -Note that you can indent the Markdown content as leading whitespaces will be -removed consistently before conversion: - -.. code-block:: twig - - {% apply markdown_to_html %} - Title - ====== - - Hello! - {% endapply %} - -You can also use the filter on an included file or a variable: - -.. code-block:: twig - - {{ include('some_template.markdown.twig')|markdown_to_html }} - - {{ changelog|markdown_to_html }} - -.. note:: - - The ``markdown_to_html`` filter is part of the ``MarkdownExtension`` which - is not installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/markdown-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Markdown\MarkdownExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new MarkdownExtension()); - - If you are not using Symfony, you must also register the extension runtime:: - - use Twig\Extra\Markdown\DefaultMarkdown; - use Twig\Extra\Markdown\MarkdownRuntime; - use Twig\RuntimeLoader\RuntimeLoaderInterface; - - $twig->addRuntimeLoader(new class implements RuntimeLoaderInterface { - public function load($class) { - if (MarkdownRuntime::class === $class) { - return new MarkdownRuntime(new DefaultMarkdown()); - } - } - }); - - Afterwards you need to install a markdown library of your choice. Some of them are - mentioned in the ``require-dev`` section of the ``twig/markdown-extra`` package. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/merge.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/merge.rst deleted file mode 100644 index e26e51c2..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/merge.rst +++ /dev/null @@ -1,48 +0,0 @@ -``merge`` -========= - -The ``merge`` filter merges an array with another array: - -.. code-block:: twig - - {% set values = [1, 2] %} - - {% set values = values|merge(['apple', 'orange']) %} - - {# values now contains [1, 2, 'apple', 'orange'] #} - -New values are added at the end of the existing ones. - -The ``merge`` filter also works on hashes: - -.. code-block:: twig - - {% set items = { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'unknown' } %} - - {% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %} - - {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'renault': 'car' } #} - -For hashes, the merging process occurs on the keys: if the key does not -already exist, it is added but if the key already exists, its value is -overridden. - -.. tip:: - - If you want to ensure that some values are defined in an array (by given - default values), reverse the two elements in the call: - - .. code-block:: twig - - {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} - - {% set items = { 'apple': 'unknown' }|merge(items) %} - - {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #} - -.. note:: - - Internally, Twig uses the PHP `array_merge`_ function. It supports - Traversable objects by transforming those to arrays. - -.. _`array_merge`: https://secure.php.net/array_merge diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/nl2br.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/nl2br.rst deleted file mode 100644 index 7c84c22d..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/nl2br.rst +++ /dev/null @@ -1,19 +0,0 @@ -``nl2br`` -========= - -The ``nl2br`` filter inserts HTML line breaks before all newlines in a string: - -.. code-block:: html+twig - - {{ "I like Twig.\nYou will like it too."|nl2br }} - {# outputs - - I like Twig.<br /> - You will like it too. - - #} - -.. note:: - - The ``nl2br`` filter pre-escapes the input before applying the - transformation. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/number_format.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/number_format.rst deleted file mode 100644 index c44e2e35..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/number_format.rst +++ /dev/null @@ -1,51 +0,0 @@ -``number_format`` -================= - -The ``number_format`` filter formats numbers. It is a wrapper around PHP's -`number_format`_ function: - -.. code-block:: twig - - {{ 200.35|number_format }} - -You can control the number of decimal places, decimal point, and thousands -separator using the additional arguments: - -.. code-block:: twig - - {{ 9800.333|number_format(2, '.', ',') }} - -To format negative numbers or math calculation, wrap the previous statement -with parentheses (needed because of Twig's :ref:`precedence of operators -<twig-expressions>`): - -.. code-block:: twig - - {{ -9800.333|number_format(2, '.', ',') }} {# outputs : -9 #} - {{ (-9800.333)|number_format(2, '.', ',') }} {# outputs : -9,800.33 #} - {{ 1 + 0.2|number_format(2) }} {# outputs : 1.2 #} - {{ (1 + 0.2)|number_format(2) }} {# outputs : 1.20 #} - -If no formatting options are provided then Twig will use the default formatting -options of: - -* 0 decimal places. -* ``.`` as the decimal point. -* ``,`` as the thousands separator. - -These defaults can be changed through the core extension:: - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setNumberFormat(3, '.', ','); - -The defaults set for ``number_format`` can be over-ridden upon each call using the -additional parameters. - -Arguments ---------- - -* ``decimal``: The number of decimal points to display -* ``decimal_point``: The character(s) to use for the decimal point -* ``thousand_sep``: The character(s) to use for the thousands separator - -.. _`number_format`: https://secure.php.net/number_format diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/raw.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/raw.rst deleted file mode 100644 index 856e9697..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/raw.rst +++ /dev/null @@ -1,12 +0,0 @@ -``raw`` -======= - -The ``raw`` filter marks the value as being "safe", which means that in an -environment with automatic escaping enabled this variable will not be escaped -if ``raw`` is the last filter applied to it: - -.. code-block:: twig - - {% autoescape %} - {{ var|raw }} {# var won't be escaped #} - {% endautoescape %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/reduce.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/reduce.rst deleted file mode 100644 index 7df4646c..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/reduce.rst +++ /dev/null @@ -1,29 +0,0 @@ -``reduce`` -========== - -The ``reduce`` filter iteratively reduces a sequence or a mapping to a single -value using an arrow function, so as to reduce it to a single value. The arrow -function receives the return value of the previous iteration and the current -value of the sequence or mapping: - -.. code-block:: twig - - {% set numbers = [1, 2, 3] %} - - {{ numbers|reduce((carry, v) => carry + v) }} - {# output 6 #} - -The ``reduce`` filter takes an ``initial`` value as a second argument: - -.. code-block:: twig - - {{ numbers|reduce((carry, v) => carry + v, 10) }} - {# output 16 #} - -Note that the arrow function has access to the current context. - -Arguments ---------- - -* ``arrow``: The arrow function -* ``initial``: The initial value diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/replace.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/replace.rst deleted file mode 100644 index 5761a219..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/replace.rst +++ /dev/null @@ -1,27 +0,0 @@ -``replace`` -=========== - -The ``replace`` filter formats a given string by replacing the placeholders -(placeholders are free-form): - -.. code-block:: twig - - {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }} - - {# outputs I like foo and bar - if the foo parameter equals to the foo string. #} - - {# using % as a delimiter is purely conventional and optional #} - - {{ "I like this and --that--."|replace({'this': foo, '--that--': "bar"}) }} - - {# outputs I like foo and bar #} - -Arguments ---------- - -* ``from``: The placeholder values - -.. seealso:: - - :doc:`format<format>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/reverse.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/reverse.rst deleted file mode 100644 index c5ceb7d0..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/reverse.rst +++ /dev/null @@ -1,44 +0,0 @@ -``reverse`` -=========== - -The ``reverse`` filter reverses a sequence, a mapping, or a string: - -.. code-block:: twig - - {% for user in users|reverse %} - ... - {% endfor %} - - {{ '1234'|reverse }} - - {# outputs 4321 #} - -.. tip:: - - For sequences and mappings, numeric keys are not preserved. To reverse - them as well, pass ``true`` as an argument to the ``reverse`` filter: - - .. code-block:: twig - - {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse %} - {{ key }}: {{ value }} - {%- endfor %} - - {# output: 0: c 1: b 2: a #} - - {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse(true) %} - {{ key }}: {{ value }} - {%- endfor %} - - {# output: 3: c 2: b 1: a #} - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -Arguments ---------- - -* ``preserve_keys``: Preserve keys when reversing a mapping or a sequence. - -.. _`Traversable`: https://secure.php.net/Traversable diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/round.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/round.rst deleted file mode 100644 index 2c970b7f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/round.rst +++ /dev/null @@ -1,34 +0,0 @@ -``round`` -========= - -The ``round`` filter rounds a number to a given precision: - -.. code-block:: twig - - {{ 42.55|round }} - {# outputs 43 #} - - {{ 42.55|round(1, 'floor') }} - {# outputs 42.5 #} - -The ``round`` filter takes two optional arguments; the first one specifies the -precision (default is ``0``) and the second the rounding method (default is -``common``): - -* ``common`` rounds either up or down (rounds the value up to precision decimal - places away from zero, when it is half way there -- making 1.5 into 2 and - -1.5 into -2); - -* ``ceil`` always rounds up; - -* ``floor`` always rounds down. - -.. note:: - - The ``//`` operator is equivalent to ``|round(0, 'floor')``. - -Arguments ---------- - -* ``precision``: The rounding precision -* ``method``: The rounding method diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/slice.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/slice.rst deleted file mode 100644 index ff38bbc9..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/slice.rst +++ /dev/null @@ -1,68 +0,0 @@ -``slice`` -=========== - -The ``slice`` filter extracts a slice of a sequence, a mapping, or a string: - -.. code-block:: twig - - {% for i in [1, 2, 3, 4, 5]|slice(1, 2) %} - {# will iterate over 2 and 3 #} - {% endfor %} - - {{ '12345'|slice(1, 2) }} - - {# outputs 23 #} - -You can use any valid expression for both the start and the length: - -.. code-block:: twig - - {% for i in [1, 2, 3, 4, 5]|slice(start, length) %} - {# ... #} - {% endfor %} - -As syntactic sugar, you can also use the ``[]`` notation: - -.. code-block:: twig - - {% for i in [1, 2, 3, 4, 5][start:length] %} - {# ... #} - {% endfor %} - - {{ '12345'[1:2] }} {# will display "23" #} - - {# you can omit the first argument -- which is the same as 0 #} - {{ '12345'[:2] }} {# will display "12" #} - - {# you can omit the last argument -- which will select everything till the end #} - {{ '12345'[2:] }} {# will display "345" #} - -The ``slice`` filter works as the `array_slice`_ PHP function for arrays and -`mb_substr`_ for strings with a fallback to `substr`_. - -If the start is non-negative, the sequence will start at that start in the -variable. If start is negative, the sequence will start that far from the end -of the variable. - -If length is given and is positive, then the sequence will have up to that -many elements in it. If the variable is shorter than the length, then only the -available variable elements will be present. If length is given and is -negative then the sequence will stop that many elements from the end of the -variable. If it is omitted, then the sequence will have everything from offset -up until the end of the variable. - -.. note:: - - It also works with objects implementing the `Traversable`_ interface. - -Arguments ---------- - -* ``start``: The start of the slice -* ``length``: The size of the slice -* ``preserve_keys``: Whether to preserve key or not (when the input is an array) - -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php -.. _`array_slice`: https://secure.php.net/array_slice -.. _`mb_substr`: https://secure.php.net/mb-substr -.. _`substr`: https://secure.php.net/substr diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/slug.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/slug.rst deleted file mode 100644 index 773a42fa..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/slug.rst +++ /dev/null @@ -1,59 +0,0 @@ -``slug`` -======== - -The ``slug`` filter transforms a given string into another string that -only includes safe ASCII characters. - -Here is an example: - -.. code-block:: twig - - {{ 'Wôrķšƥáçè ~~sèťtïñğš~~'|slug }} - Workspace-settings - -The default separator between words is a dash (``-``), but you can -define a selector of your choice by passing it as an argument: - -.. code-block:: twig - - {{ 'Wôrķšƥáçè ~~sèťtïñğš~~'|slug('/') }} - Workspace/settings - -The slugger automatically detects the language of the original -string, but you can also specify it explicitly using the second -argument: - -.. code-block:: twig - - {{ '...'|slug('-', 'ko') }} - -The ``slug`` filter uses the method by the same name in Symfony's -`AsciiSlugger <https://symfony.com/doc/current/components/string.html#slugger>`_. - -.. note:: - - The ``slug`` filter is part of the ``StringExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/string-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\String\StringExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new StringExtension()); - -Arguments ---------- - -* ``separator``: The separator that is used to join words (defaults to ``-``) -* ``locale``: The locale of the original string (if none is specified, it will be automatically detected) diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/sort.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/sort.rst deleted file mode 100644 index 3dc5f4d7..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/sort.rst +++ /dev/null @@ -1,42 +0,0 @@ -``sort`` -======== - -The ``sort`` filter sorts an array: - -.. code-block:: twig - - {% for user in users|sort %} - ... - {% endfor %} - -.. note:: - - Internally, Twig uses the PHP `asort`_ function to maintain index - association. It supports Traversable objects by transforming - those to arrays. - -You can pass an arrow function to sort the array: - -.. code-block:: html+twig - - {% set fruits = [ - { name: 'Apples', quantity: 5 }, - { name: 'Oranges', quantity: 2 }, - { name: 'Grapes', quantity: 4 }, - ] %} - - {% for fruit in fruits|sort((a, b) => a.quantity <=> b.quantity)|column('name') %} - {{ fruit }} - {% endfor %} - - {# output in this order: Oranges, Grapes, Apples #} - -Note the usage of the `spaceship`_ operator to simplify the comparison. - -Arguments ---------- - -* ``arrow``: An arrow function - -.. _`asort`: https://secure.php.net/asort -.. _`spaceship`: https://www.php.net/manual/en/language.operators.comparison.php diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/spaceless.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/spaceless.rst deleted file mode 100644 index 9a213c37..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/spaceless.rst +++ /dev/null @@ -1,56 +0,0 @@ -``spaceless`` -============= - -Use the ``spaceless`` filter to remove whitespace *between HTML tags*, not -whitespace within HTML tags or whitespace in plain text: - -.. code-block:: html+twig - - {{ - "<div> - <strong>foo</strong> - </div> - "|spaceless }} - - {# output will be <div><strong>foo</strong></div> #} - -You can combine ``spaceless`` with the ``apply`` tag to apply the transformation -on large amounts of HTML: - -.. code-block:: html+twig - - {% apply spaceless %} - <div> - <strong>foo</strong> - </div> - {% endapply %} - - {# output will be <div><strong>foo</strong></div> #} - -This tag is not meant to "optimize" the size of the generated HTML content but -merely to avoid extra whitespace between HTML tags to avoid browser rendering -quirks under some circumstances. - -.. caution:: - - As the filter uses a regular expression behind the scenes, its performance - is directly related to the text size you are working on (remember that - filters are executed at runtime). - -.. tip:: - - If you want to optimize the size of the generated HTML content, gzip - compress the output instead. - -.. tip:: - - If you want to create a tag that actually removes all extra whitespace in - an HTML string, be warned that this is not as easy as it seems to be - (think of ``textarea`` or ``pre`` tags for instance). Using a third-party - library like Tidy is probably a better idea. - -.. tip:: - - For more information on whitespace control, read the - :ref:`dedicated section <templates-whitespace-control>` of the documentation and learn how - you can also use the whitespace control modifier on your tags. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/split.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/split.rst deleted file mode 100644 index 38c4b7df..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/split.rst +++ /dev/null @@ -1,50 +0,0 @@ -``split`` -========= - -The ``split`` filter splits a string by the given delimiter and returns a list -of strings: - -.. code-block:: twig - - {% set foo = "one,two,three"|split(',') %} - {# foo contains ['one', 'two', 'three'] #} - -You can also pass a ``limit`` argument: - -* If ``limit`` is positive, the returned array will contain a maximum of - limit elements with the last element containing the rest of string; - -* If ``limit`` is negative, all components except the last -limit are - returned; - -* If ``limit`` is zero, then this is treated as 1. - -.. code-block:: twig - - {% set foo = "one,two,three,four,five"|split(',', 3) %} - {# foo contains ['one', 'two', 'three,four,five'] #} - -If the ``delimiter`` is an empty string, then value will be split by equal -chunks. Length is set by the ``limit`` argument (one character by default). - -.. code-block:: twig - - {% set foo = "123"|split('') %} - {# foo contains ['1', '2', '3'] #} - - {% set bar = "aabbcc"|split('', 2) %} - {# bar contains ['aa', 'bb', 'cc'] #} - -.. note:: - - Internally, Twig uses the PHP `explode`_ or `str_split`_ (if delimiter is - empty) functions for string splitting. - -Arguments ---------- - -* ``delimiter``: The delimiter -* ``limit``: The limit argument - -.. _`explode`: https://secure.php.net/explode -.. _`str_split`: https://secure.php.net/str_split diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/striptags.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/striptags.rst deleted file mode 100644 index 7a0aabdd..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/striptags.rst +++ /dev/null @@ -1,29 +0,0 @@ -``striptags`` -============= - -The ``striptags`` filter strips SGML/XML tags and replace adjacent whitespace -by one space: - -.. code-block:: twig - - {{ some_html|striptags }} - -You can also provide tags which should not be stripped: - -.. code-block:: html+twig - - {{ some_html|striptags('<br><p>') }} - -In this example, the ``<br/>``, ``<br>``, ``<p>``, and ``</p>`` tags won't be -removed from the string. - -.. note:: - - Internally, Twig uses the PHP `strip_tags`_ function. - -Arguments ---------- - -* ``allowable_tags``: Tags which should not be stripped - -.. _`strip_tags`: https://secure.php.net/strip_tags diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/timezone_name.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/timezone_name.rst deleted file mode 100644 index dfb22818..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/timezone_name.rst +++ /dev/null @@ -1,46 +0,0 @@ -``timezone_name`` -================= - -The ``timezone_name`` filter returns the timezone name given a timezone identifier: - -.. code-block:: twig - - {# Central European Time (Paris) #} - {{ 'Europe/Paris'|timezone_name }} - - {# Pacific Time (Los Angeles) #} - {{ 'America/Los_Angeles'|timezone_name }} - -By default, the filter uses the current locale. You can pass it explicitly: - -.. code-block:: twig - - {# heure du Pacifique nord-américain (Los Angeles) #} - {{ 'America/Los_Angeles'|timezone_name('fr') }} - -.. note:: - - The ``timezone_name`` filter is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); - -Arguments ---------- - -* ``locale``: The locale diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/title.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/title.rst deleted file mode 100644 index dd0311ca..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/title.rst +++ /dev/null @@ -1,11 +0,0 @@ -``title`` -========= - -The ``title`` filter returns a titlecased version of the value. Words will -start with uppercase letters, all remaining characters are lowercase: - -.. code-block:: twig - - {{ 'my first car'|title }} - - {# outputs 'My First Car' #} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/trim.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/trim.rst deleted file mode 100644 index 81d5e041..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/trim.rst +++ /dev/null @@ -1,39 +0,0 @@ -``trim`` -======== - -The ``trim`` filter strips whitespace (or other characters) from the beginning -and end of a string: - -.. code-block:: twig - - {{ ' I like Twig. '|trim }} - - {# outputs 'I like Twig.' #} - - {{ ' I like Twig.'|trim('.') }} - - {# outputs ' I like Twig' #} - - {{ ' I like Twig. '|trim(side='left') }} - - {# outputs 'I like Twig. ' #} - - {{ ' I like Twig. '|trim(' ', 'right') }} - - {# outputs ' I like Twig.' #} - -.. note:: - - Internally, Twig uses the PHP `trim`_, `ltrim`_, and `rtrim`_ functions. - -Arguments ---------- - -* ``character_mask``: The characters to strip - -* ``side``: The default is to strip from the left and the right (`both`) sides, but `left` - and `right` will strip from either the left side or right side only - -.. _`trim`: https://secure.php.net/trim -.. _`ltrim`: https://secure.php.net/ltrim -.. _`rtrim`: https://secure.php.net/rtrim diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/u.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/u.rst deleted file mode 100644 index 20bb0d5c..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/u.rst +++ /dev/null @@ -1,87 +0,0 @@ -``u`` -===== - -The ``u`` filter wraps a text in a Unicode object (a `Symfony UnicodeString -instance <https://symfony.com/doc/current/components/string.html>`_) that -exposes methods to "manipulate" the string. - -Let's see some common use cases. - -Wrapping a text to a given number of characters: - -.. code-block:: twig - - {{ 'Symfony String + Twig = <3'|u.wordwrap(5) }} - Symfony - String - + - Twig - = <3 - -Truncating a string: - -.. code-block:: twig - - {{ 'Lorem ipsum'|u.truncate(8) }} - Lorem ip - - {{ 'Lorem ipsum'|u.truncate(8, '...') }} - Lorem... - -The ``truncate`` method also accepts a third argument to preserve whole words: - -.. code-block:: twig - - {{ 'Lorem ipsum dolor'|u.truncate(10, '...', false) }} - Lorem ipsum... - -Converting a string to *snake* case or *camelCase*: - -.. code-block:: twig - - {{ 'SymfonyStringWithTwig'|u.snake }} - symfony_string_with_twig - - {{ 'symfony_string with twig'|u.camel.title }} - SymfonyStringWithTwig - -You can also chain methods: - -.. code-block:: twig - - {{ 'Symfony String + Twig = <3'|u.wordwrap(5).upper }} - SYMFONY - STRING - + - TWIG - = <3 - -For large strings manipulation, use the ``apply`` tag: - -.. code-block:: twig - - {% apply u.wordwrap(5) %} - Some large amount of text... - {% endapply %} - -.. note:: - - The ``u`` filter is part of the ``StringExtension`` which is not installed - by default. Install it first: - - .. code-block:: bash - - $ composer require twig/string-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\String\StringExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new StringExtension()); diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/upper.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/upper.rst deleted file mode 100644 index 01c9fbb0..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/upper.rst +++ /dev/null @@ -1,10 +0,0 @@ -``upper`` -========= - -The ``upper`` filter converts a value to uppercase: - -.. code-block:: twig - - {{ 'welcome'|upper }} - - {# outputs 'WELCOME' #} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/filters/url_encode.rst b/data/web/inc/lib/vendor/twig/twig/doc/filters/url_encode.rst deleted file mode 100644 index 60cf365f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/filters/url_encode.rst +++ /dev/null @@ -1,23 +0,0 @@ -``url_encode`` -============== - -The ``url_encode`` filter percent encodes a given string as URL segment -or an array as query string: - -.. code-block:: twig - - {{ "path-seg*ment"|url_encode }} - {# outputs "path-seg%2Ament" #} - - {{ "string with spaces"|url_encode }} - {# outputs "string%20with%20spaces" #} - - {{ {'param': 'value', 'foo': 'bar'}|url_encode }} - {# outputs "param=value&foo=bar" #} - -.. note:: - - Internally, Twig uses the PHP `rawurlencode`_ or the `http_build_query`_ function. - -.. _`rawurlencode`: https://secure.php.net/rawurlencode -.. _`http_build_query`: https://secure.php.net/http_build_query diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/attribute.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/attribute.rst deleted file mode 100644 index e9d9a842..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/attribute.rst +++ /dev/null @@ -1,23 +0,0 @@ -``attribute`` -============= - -The ``attribute`` function can be used to access a "dynamic" attribute of a -variable: - -.. code-block:: twig - - {{ attribute(object, method) }} - {{ attribute(object, method, arguments) }} - {{ attribute(array, item) }} - -In addition, the ``defined`` test can check for the existence of a dynamic -attribute: - -.. code-block:: twig - - {{ attribute(object, method) is defined ? 'Method exists' : 'Method does not exist' }} - -.. note:: - - The resolution algorithm is the same as the one used for the ``.`` - notation, except that the item can be any valid expression. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/block.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/block.rst deleted file mode 100644 index 117e160f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/block.rst +++ /dev/null @@ -1,37 +0,0 @@ -``block`` -========= - -When a template uses inheritance and if you want to print a block multiple -times, use the ``block`` function: - -.. code-block:: html+twig - - <title>{% block title %}{% endblock %}</title> - - <h1>{{ block('title') }}</h1> - - {% block body %}{% endblock %} - -The ``block`` function can also be used to display one block from another -template: - -.. code-block:: twig - - {{ block("title", "common_blocks.twig") }} - -Use the ``defined`` test to check if a block exists in the context of the -current template: - -.. code-block:: twig - - {% if block("footer") is defined %} - ... - {% endif %} - - {% if block("footer", "common_blocks.twig") is defined %} - ... - {% endif %} - -.. seealso:: - - :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/constant.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/constant.rst deleted file mode 100644 index 660bf870..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/constant.rst +++ /dev/null @@ -1,23 +0,0 @@ -``constant`` -============ - -``constant`` returns the constant value for a given string: - -.. code-block:: twig - - {{ some_date|date(constant('DATE_W3C')) }} - {{ constant('Namespace\\Classname::CONSTANT_NAME') }} - -You can read constants from object instances as well: - -.. code-block:: twig - - {{ constant('RSS', date) }} - -Use the ``defined`` test to check if a constant is defined: - -.. code-block:: twig - - {% if constant('SOME_CONST') is defined %} - ... - {% endif %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/country_timezones.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/country_timezones.rst deleted file mode 100644 index ecbbc1c9..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/country_timezones.rst +++ /dev/null @@ -1,32 +0,0 @@ -``country_timezones`` -===================== - -The ``country_timezones`` function returns the names of the timezones associated -with a given country code: - -.. code-block:: twig - - {# Europe/Paris #} - {{ country_timezones('FR')|join(', ') }} - -.. note:: - - The ``country_timezones`` function is part of the ``IntlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/intl-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Intl\IntlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new IntlExtension()); diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/cycle.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/cycle.rst deleted file mode 100644 index 84cff6a1..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/cycle.rst +++ /dev/null @@ -1,28 +0,0 @@ -``cycle`` -========= - -The ``cycle`` function cycles on an array of values: - -.. code-block:: twig - - {% set start_year = date() | date('Y') %} - {% set end_year = start_year + 5 %} - - {% for year in start_year..end_year %} - {{ cycle(['odd', 'even'], loop.index0) }} - {% endfor %} - -The array can contain any number of values: - -.. code-block:: twig - - {% set fruits = ['apple', 'orange', 'citrus'] %} - - {% for i in 0..10 %} - {{ cycle(fruits, i) }} - {% endfor %} - -Arguments ---------- - -* ``position``: The cycle position diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/date.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/date.rst deleted file mode 100644 index 3329a569..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/date.rst +++ /dev/null @@ -1,44 +0,0 @@ -``date`` -======== - -Converts an argument to a date to allow date comparison: - -.. code-block:: html+twig - - {% if date(user.created_at) < date('-2days') %} - {# do something #} - {% endif %} - -The argument must be in one of PHP’s supported `date and time formats`_. - -You can pass a timezone as the second argument: - -.. code-block:: html+twig - - {% if date(user.created_at) < date('-2days', 'Europe/Paris') %} - {# do something #} - {% endif %} - -If no argument is passed, the function returns the current date: - -.. code-block:: html+twig - - {% if date(user.created_at) < date() %} - {# always! #} - {% endif %} - -.. note:: - - You can set the default timezone globally by calling ``setTimezone()`` on - the ``core`` extension instance:: - - $twig = new \Twig\Environment($loader); - $twig->getExtension(\Twig\Extension\CoreExtension::class)->setTimezone('Europe/Paris'); - -Arguments ---------- - -* ``date``: The date -* ``timezone``: The timezone - -.. _`date and time formats`: https://secure.php.net/manual/en/datetime.formats.php diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/dump.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/dump.rst deleted file mode 100644 index c7264edd..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/dump.rst +++ /dev/null @@ -1,66 +0,0 @@ -``dump`` -======== - -The ``dump`` function dumps information about a template variable. This is -mostly useful to debug a template that does not behave as expected by -introspecting its variables: - -.. code-block:: twig - - {{ dump(user) }} - -.. note:: - - The ``dump`` function is not available by default. You must add the - ``\Twig\Extension\DebugExtension`` extension explicitly when creating your Twig - environment:: - - $twig = new \Twig\Environment($loader, [ - 'debug' => true, - // ... - ]); - $twig->addExtension(new \Twig\Extension\DebugExtension()); - - Even when enabled, the ``dump`` function won't display anything if the - ``debug`` option on the environment is not enabled (to avoid leaking debug - information on a production server). - -In an HTML context, wrap the output with a ``pre`` tag to make it easier to -read: - -.. code-block:: html+twig - - <pre> - {{ dump(user) }} - </pre> - -.. tip:: - - Using a ``pre`` tag is not needed when `XDebug`_ is enabled and - ``html_errors`` is ``on``; as a bonus, the output is also nicer with - XDebug enabled. - -You can debug several variables by passing them as additional arguments: - -.. code-block:: twig - - {{ dump(user, categories) }} - -If you don't pass any value, all variables from the current context are -dumped: - -.. code-block:: twig - - {{ dump() }} - -.. note:: - - Internally, Twig uses the PHP `var_dump`_ function. - -Arguments ---------- - -* ``context``: The context to dump - -.. _`XDebug`: https://xdebug.org/docs/display -.. _`var_dump`: https://secure.php.net/var_dump diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/html_classes.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/html_classes.rst deleted file mode 100644 index 80bc796e..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/html_classes.rst +++ /dev/null @@ -1,35 +0,0 @@ -``html_classes`` -================ - -The ``html_classes`` function returns a string by conditionally joining class -names together: - -.. code-block:: html+twig - - <p class="{{ html_classes('a-class', 'another-class', { - 'errored': object.errored, - 'finished': object.finished, - 'pending': object.pending, - }) }}">How are you doing?</p> - -.. note:: - - The ``html_classes`` function is part of the ``HtmlExtension`` which is not - installed by default. Install it first: - - .. code-block:: bash - - $ composer require twig/html-extra - - Then, on Symfony projects, install the ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Otherwise, add the extension explicitly on the Twig environment:: - - use Twig\Extra\Html\HtmlExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new HtmlExtension()); diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/include.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/include.rst deleted file mode 100644 index f49971a8..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/include.rst +++ /dev/null @@ -1,77 +0,0 @@ -``include`` -=========== - -The ``include`` function returns the rendered content of a template: - -.. code-block:: twig - - {{ include('template.html') }} - {{ include(some_var) }} - -Included templates have access to the variables of the active context. - -If you are using the filesystem loader, the templates are looked for in the -paths defined by it. - -The context is passed by default to the template but you can also pass -additional variables: - -.. code-block:: twig - - {# template.html will have access to the variables from the current context and the additional ones provided #} - {{ include('template.html', {foo: 'bar'}) }} - -You can disable access to the context by setting ``with_context`` to -``false``: - -.. code-block:: twig - - {# only the foo variable will be accessible #} - {{ include('template.html', {foo: 'bar'}, with_context = false) }} - -.. code-block:: twig - - {# no variables will be accessible #} - {{ include('template.html', with_context = false) }} - -And if the expression evaluates to a ``\Twig\Template`` or a -``\Twig\TemplateWrapper`` instance, Twig will use it directly:: - - // {{ include(template) }} - - $template = $twig->load('some_template.twig'); - - $twig->display('template.twig', ['template' => $template]); - -When you set the ``ignore_missing`` flag, Twig will return an empty string if -the template does not exist: - -.. code-block:: twig - - {{ include('sidebar.html', ignore_missing = true) }} - -You can also provide a list of templates that are checked for existence before -inclusion. The first template that exists will be rendered: - -.. code-block:: twig - - {{ include(['page_detailed.html', 'page.html']) }} - -If ``ignore_missing`` is set, it will fall back to rendering nothing if none -of the templates exist, otherwise it will throw an exception. - -When including a template created by an end user, you should consider -sandboxing it: - -.. code-block:: twig - - {{ include('page.html', sandboxed = true) }} - -Arguments ---------- - -* ``template``: The template to render -* ``variables``: The variables to pass to the template -* ``with_context``: Whether to pass the current context variables or not -* ``ignore_missing``: Whether to ignore missing templates or not -* ``sandboxed``: Whether to sandbox the template or not diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/index.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/index.rst deleted file mode 100644 index 97465ed0..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -Functions -========= - -.. toctree:: - :maxdepth: 1 - - attribute - block - constant - cycle - date - dump - html_classes - include - max - min - parent - random - range - source - country_timezones - template_from_string diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/max.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/max.rst deleted file mode 100644 index 230b3c8f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/max.rst +++ /dev/null @@ -1,17 +0,0 @@ -``max`` -======= - -``max`` returns the biggest value of a sequence or a set of values: - -.. code-block:: twig - - {{ max(1, 3, 2) }} - {{ max([1, 3, 2]) }} - -When called with a mapping, max ignores keys and only compares values: - -.. code-block:: twig - - {{ max({2: "e", 1: "a", 3: "b", 5: "d", 4: "c"}) }} - {# returns "e" #} - diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/min.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/min.rst deleted file mode 100644 index 65318580..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/min.rst +++ /dev/null @@ -1,17 +0,0 @@ -``min`` -======= - -``min`` returns the lowest value of a sequence or a set of values: - -.. code-block:: twig - - {{ min(1, 3, 2) }} - {{ min([1, 3, 2]) }} - -When called with a mapping, min ignores keys and only compares values: - -.. code-block:: twig - - {{ min({2: "e", 3: "a", 1: "b", 5: "d", 4: "c"}) }} - {# returns "a" #} - diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/parent.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/parent.rst deleted file mode 100644 index 158bac78..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/parent.rst +++ /dev/null @@ -1,22 +0,0 @@ -``parent`` -========== - -When a template uses inheritance, it's possible to render the contents of the -parent block when overriding a block by using the ``parent`` function: - -.. code-block:: html+twig - - {% extends "base.html" %} - - {% block sidebar %} - <h3>Table Of Contents</h3> - ... - {{ parent() }} - {% endblock %} - -The ``parent()`` call will return the content of the ``sidebar`` block as -defined in the ``base.html`` template. - -.. seealso:: - - :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/random.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/random.rst deleted file mode 100644 index aac2986c..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/random.rst +++ /dev/null @@ -1,25 +0,0 @@ -``random`` -========== - -The ``random`` function returns a random value depending on the supplied -parameter type: - -* a random item from a sequence; -* a random character from a string; -* a random integer between 0 and the integer parameter (inclusive). -* a random integer between the integer parameter (when negative) and 0 (inclusive). -* a random integer between the first integer and the second integer parameter (inclusive). - -.. code-block:: twig - - {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #} - {{ random('ABC') }} {# example output: C #} - {{ random() }} {# example output: 15386094 (works as the native PHP mt_rand function) #} - {{ random(5) }} {# example output: 3 #} - {{ random(50, 100) }} {# example output: 63 #} - -Arguments ---------- - -* ``values``: The values -* ``max``: The max value when values is an integer diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/range.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/range.rst deleted file mode 100644 index a1f0e7c0..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/range.rst +++ /dev/null @@ -1,58 +0,0 @@ -``range`` -========= - -Returns a list containing an arithmetic progression of integers: - -.. code-block:: twig - - {% for i in range(0, 3) %} - {{ i }}, - {% endfor %} - - {# outputs 0, 1, 2, 3, #} - -When step is given (as the third parameter), it specifies the increment (or -decrement for negative values): - -.. code-block:: twig - - {% for i in range(0, 6, 2) %} - {{ i }}, - {% endfor %} - - {# outputs 0, 2, 4, 6, #} - -.. note:: - - Note that if the start is greater than the end, ``range`` assumes a step of - ``-1``: - - .. code-block:: twig - - {% for i in range(3, 0) %} - {{ i }}, - {% endfor %} - - {# outputs 3, 2, 1, 0, #} - -The Twig built-in ``..`` operator is just syntactic sugar for the ``range`` -function (with a step of ``1``, or ``-1`` if the start is greater than the end): - -.. code-block:: twig - - {% for i in 0..3 %} - {{ i }}, - {% endfor %} - -.. tip:: - - The ``range`` function works as the native PHP `range`_ function. - -Arguments ---------- - -* ``low``: The first value of the sequence. -* ``high``: The highest possible value of the sequence. -* ``step``: The increment between elements of the sequence. - -.. _`range`: https://secure.php.net/range diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/source.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/source.rst deleted file mode 100644 index 080e2bef..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/source.rst +++ /dev/null @@ -1,26 +0,0 @@ -``source`` -========== - -The ``source`` function returns the content of a template without rendering it: - -.. code-block:: twig - - {{ source('template.html') }} - {{ source(some_var) }} - -When you set the ``ignore_missing`` flag, Twig will return an empty string if -the template does not exist: - -.. code-block:: twig - - {{ source('template.html', ignore_missing = true) }} - -The function uses the same template loaders as the ones used to include -templates. So, if you are using the filesystem loader, the templates are looked -for in the paths defined by it. - -Arguments ---------- - -* ``name``: The name of the template to read -* ``ignore_missing``: Whether to ignore missing templates or not diff --git a/data/web/inc/lib/vendor/twig/twig/doc/functions/template_from_string.rst b/data/web/inc/lib/vendor/twig/twig/doc/functions/template_from_string.rst deleted file mode 100644 index 80e9d2de..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/functions/template_from_string.rst +++ /dev/null @@ -1,37 +0,0 @@ -``template_from_string`` -======================== - -The ``template_from_string`` function loads a template from a string: - -.. code-block:: twig - - {{ include(template_from_string("Hello {{ name }}")) }} - {{ include(template_from_string(page.template)) }} - -To ease debugging, you can also give the template a name that will be part of -any related error message: - -.. code-block:: twig - - {{ include(template_from_string(page.template, "template for page " ~ page.name)) }} - -.. note:: - - The ``template_from_string`` function is not available by default. You - must add the ``\Twig\Extension\StringLoaderExtension`` extension explicitly when - creating your Twig environment:: - - $twig = new \Twig\Environment(...); - $twig->addExtension(new \Twig\Extension\StringLoaderExtension()); - -.. note:: - - Even if you will probably always use the ``template_from_string`` function - with the ``include`` function, you can use it with any tag or function that - takes a template as an argument (like the ``embed`` or ``extends`` tags). - -Arguments ---------- - -* ``template``: The template -* ``name``: A name for the template diff --git a/data/web/inc/lib/vendor/twig/twig/doc/index.rst b/data/web/inc/lib/vendor/twig/twig/doc/index.rst deleted file mode 100644 index 358bd738..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -Twig -==== - -.. toctree:: - :maxdepth: 2 - - intro - installation - templates - api - advanced - internals - deprecated - recipes - coding_standards - tags/index - filters/index - functions/index - tests/index diff --git a/data/web/inc/lib/vendor/twig/twig/doc/installation.rst b/data/web/inc/lib/vendor/twig/twig/doc/installation.rst deleted file mode 100644 index 5fd56507..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/installation.rst +++ /dev/null @@ -1,10 +0,0 @@ -Installation -============ - -Install `Composer`_ and run the following command to get the latest version: - -.. code-block:: bash - - composer require "twig/twig:^3.0" - -.. _`Composer`: https://getcomposer.org/download/ diff --git a/data/web/inc/lib/vendor/twig/twig/doc/internals.rst b/data/web/inc/lib/vendor/twig/twig/doc/internals.rst deleted file mode 100644 index 0421e7c7..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/internals.rst +++ /dev/null @@ -1,140 +0,0 @@ -Twig Internals -============== - -Twig is very extensible and you can hack it. Keep in mind that you -should probably try to create an extension before hacking the core, as most -features and enhancements can be handled with extensions. This chapter is also -useful for people who want to understand how Twig works under the hood. - -How does Twig work? -------------------- - -The rendering of a Twig template can be summarized into four key steps: - -* **Load** the template: If the template is already compiled, load it and go - to the *evaluation* step, otherwise: - - * First, the **lexer** tokenizes the template source code into small pieces - for easier processing; - - * Then, the **parser** converts the token stream into a meaningful tree - of nodes (the Abstract Syntax Tree); - - * Finally, the *compiler* transforms the AST into PHP code. - -* **Evaluate** the template: It means calling the ``display()`` - method of the compiled template and passing it the context. - -The Lexer ---------- - -The lexer tokenizes a template source code into a token stream (each token is -an instance of ``\Twig\Token``, and the stream is an instance of -``\Twig\TokenStream``). The default lexer recognizes 13 different token types: - -* ``\Twig\Token::BLOCK_START_TYPE``, ``\Twig\Token::BLOCK_END_TYPE``: Delimiters for blocks (``{% %}``) -* ``\Twig\Token::VAR_START_TYPE``, ``\Twig\Token::VAR_END_TYPE``: Delimiters for variables (``{{ }}``) -* ``\Twig\Token::TEXT_TYPE``: A text outside an expression; -* ``\Twig\Token::NAME_TYPE``: A name in an expression; -* ``\Twig\Token::NUMBER_TYPE``: A number in an expression; -* ``\Twig\Token::STRING_TYPE``: A string in an expression; -* ``\Twig\Token::OPERATOR_TYPE``: An operator; -* ``\Twig\Token::PUNCTUATION_TYPE``: A punctuation sign; -* ``\Twig\Token::INTERPOLATION_START_TYPE``, ``\Twig\Token::INTERPOLATION_END_TYPE``: Delimiters for string interpolation; -* ``\Twig\Token::EOF_TYPE``: Ends of template. - -You can manually convert a source code into a token stream by calling the -``tokenize()`` method of an environment:: - - $stream = $twig->tokenize(new \Twig\Source($source, $identifier)); - -As the stream has a ``__toString()`` method, you can have a textual -representation of it by echoing the object:: - - echo $stream."\n"; - -Here is the output for the ``Hello {{ name }}`` template: - -.. code-block:: text - - TEXT_TYPE(Hello ) - VAR_START_TYPE() - NAME_TYPE(name) - VAR_END_TYPE() - EOF_TYPE() - -.. note:: - - The default lexer (``\Twig\Lexer``) can be changed by calling - the ``setLexer()`` method:: - - $twig->setLexer($lexer); - -The Parser ----------- - -The parser converts the token stream into an AST (Abstract Syntax Tree), or a -node tree (an instance of ``\Twig\Node\ModuleNode``). The core extension defines -the basic nodes like: ``for``, ``if``, ... and the expression nodes. - -You can manually convert a token stream into a node tree by calling the -``parse()`` method of an environment:: - - $nodes = $twig->parse($stream); - -Echoing the node object gives you a nice representation of the tree:: - - echo $nodes."\n"; - -Here is the output for the ``Hello {{ name }}`` template: - -.. code-block:: text - - \Twig\Node\ModuleNode( - \Twig\Node\TextNode(Hello ) - \Twig\Node\PrintNode( - \Twig\Node\Expression\NameExpression(name) - ) - ) - -.. note:: - - The default parser (``\Twig\TokenParser\AbstractTokenParser``) can be changed by calling the - ``setParser()`` method:: - - $twig->setParser($parser); - -The Compiler ------------- - -The last step is done by the compiler. It takes a node tree as an input and -generates PHP code usable for runtime execution of the template. - -You can manually compile a node tree to PHP code with the ``compile()`` method -of an environment:: - - $php = $twig->compile($nodes); - -The generated template for a ``Hello {{ name }}`` template reads as follows -(the actual output can differ depending on the version of Twig you are -using):: - - /* Hello {{ name }} */ - class __TwigTemplate_1121b6f109fe93ebe8c6e22e3712bceb extends Template - { - protected function doDisplay(array $context, array $blocks = []) - { - // line 1 - echo "Hello "; - echo twig_escape_filter($this->env, (isset($context["name"]) ? $context["name"] : null), "html", null, true); - } - - // some more code - } - -.. note:: - - The default compiler (``\Twig\Compiler``) can be changed by calling the - ``setCompiler()`` method:: - - $twig->setCompiler($compiler); diff --git a/data/web/inc/lib/vendor/twig/twig/doc/intro.rst b/data/web/inc/lib/vendor/twig/twig/doc/intro.rst deleted file mode 100644 index 8914507e..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/intro.rst +++ /dev/null @@ -1,74 +0,0 @@ -Introduction -============ - -Welcome to the documentation for Twig, the flexible, fast, and secure template -engine for PHP. - -Twig is both designer and developer friendly by sticking to PHP's principles and -adding functionality useful for templating environments. - -The key-features are... - -* *Fast*: Twig compiles templates down to plain optimized PHP code. The - overhead compared to regular PHP code was reduced to the very minimum. - -* *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This - allows Twig to be used as a template language for applications where users - may modify the template design. - -* *Flexible*: Twig is powered by a flexible lexer and parser. This allows the - developer to define their own custom tags and filters, and to create their own DSL. - -Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish, -phpBB, Matomo, OroCRM; and many frameworks have support for it as well like -Slim, Yii, Laravel, and Codeigniter — just to name a few. - -.. admonition:: Screencast - - Like to learn from video tutorials? Check out the `SymfonyCasts Twig Tutorial`_! - -Prerequisites -------------- - -Twig 3.x needs at least **PHP 7.2.5** to run. - -Installation ------------- - -The recommended way to install Twig is via Composer: - -.. code-block:: bash - - composer require "twig/twig:^3.0" - -Basic API Usage ---------------- - -This section gives you a brief introduction to the PHP API for Twig:: - - require_once '/path/to/vendor/autoload.php'; - - $loader = new \Twig\Loader\ArrayLoader([ - 'index' => 'Hello {{ name }}!', - ]); - $twig = new \Twig\Environment($loader); - - echo $twig->render('index', ['name' => 'Fabien']); - -Twig uses a loader (``\Twig\Loader\ArrayLoader``) to locate templates, and an -environment (``\Twig\Environment``) to store its configuration. - -The ``render()`` method loads the template passed as a first argument and -renders it with the variables passed as a second argument. - -As templates are generally stored on the filesystem, Twig also comes with a -filesystem loader:: - - $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates'); - $twig = new \Twig\Environment($loader, [ - 'cache' => '/path/to/compilation_cache', - ]); - - echo $twig->render('index.html', ['name' => 'Fabien']); - -.. _`SymfonyCasts Twig Tutorial`: https://symfonycasts.com/screencast/twig diff --git a/data/web/inc/lib/vendor/twig/twig/doc/recipes.rst b/data/web/inc/lib/vendor/twig/twig/doc/recipes.rst deleted file mode 100644 index 01c937da..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/recipes.rst +++ /dev/null @@ -1,531 +0,0 @@ -Recipes -======= - -.. _deprecation-notices: - -Displaying Deprecation Notices ------------------------------- - -Deprecated features generate deprecation notices (via a call to the -``trigger_error()`` PHP function). By default, they are silenced and never -displayed nor logged. - -To remove all deprecated feature usages from your templates, write and run a -script along the lines of the following:: - - require_once __DIR__.'/vendor/autoload.php'; - - $twig = create_your_twig_env(); - - $deprecations = new \Twig\Util\DeprecationCollector($twig); - - print_r($deprecations->collectDir(__DIR__.'/templates')); - -The ``collectDir()`` method compiles all templates found in a directory, -catches deprecation notices, and return them. - -.. tip:: - - If your templates are not stored on the filesystem, use the ``collect()`` - method instead. ``collect()`` takes a ``Traversable`` which must return - template names as keys and template contents as values (as done by - ``\Twig\Util\TemplateDirIterator``). - -However, this code won't find all deprecations (like using deprecated some Twig -classes). To catch all notices, register a custom error handler like the one -below:: - - $deprecations = []; - set_error_handler(function ($type, $msg) use (&$deprecations) { - if (E_USER_DEPRECATED === $type) { - $deprecations[] = $msg; - } - }); - - // run your application - - print_r($deprecations); - -Note that most deprecation notices are triggered during **compilation**, so -they won't be generated when templates are already cached. - -.. tip:: - - If you want to manage the deprecation notices from your PHPUnit tests, have - a look at the `symfony/phpunit-bridge - <https://github.com/symfony/phpunit-bridge>`_ package, which eases the - process. - -Making a Layout conditional ---------------------------- - -Working with Ajax means that the same content is sometimes displayed as is, -and sometimes decorated with a layout. As Twig layout template names can be -any valid expression, you can pass a variable that evaluates to ``true`` when -the request is made via Ajax and choose the layout accordingly: - -.. code-block:: twig - - {% extends request.ajax ? "base_ajax.html" : "base.html" %} - - {% block content %} - This is the content to be displayed. - {% endblock %} - -Making an Include dynamic -------------------------- - -When including a template, its name does not need to be a string. For -instance, the name can depend on the value of a variable: - -.. code-block:: twig - - {% include var ~ '_foo.html' %} - -If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be -rendered. - -As a matter of fact, the template name can be any valid expression, such as -the following: - -.. code-block:: twig - - {% include var|default('index') ~ '_foo.html' %} - -Overriding a Template that also extends itself ----------------------------------------------- - -A template can be customized in two different ways: - -* *Inheritance*: A template *extends* a parent template and overrides some - blocks; - -* *Replacement*: If you use the filesystem loader, Twig loads the first - template it finds in a list of configured directories; a template found in a - directory *replaces* another one from a directory further in the list. - -But how do you combine both: *replace* a template that also extends itself -(aka a template in a directory further in the list)? - -Let's say that your templates are loaded from both ``.../templates/mysite`` -and ``.../templates/default`` in this order. The ``page.twig`` template, -stored in ``.../templates/default`` reads as follows: - -.. code-block:: twig - - {# page.twig #} - {% extends "layout.twig" %} - - {% block content %} - {% endblock %} - -You can replace this template by putting a file with the same name in -``.../templates/mysite``. And if you want to extend the original template, you -might be tempted to write the following: - -.. code-block:: twig - - {# page.twig in .../templates/mysite #} - {% extends "page.twig" %} {# from .../templates/default #} - -However, this will not work as Twig will always load the template from -``.../templates/mysite``. - -It turns out it is possible to get this to work, by adding a directory right -at the end of your template directories, which is the parent of all of the -other directories: ``.../templates`` in our case. This has the effect of -making every template file within our system uniquely addressable. Most of the -time you will use the "normal" paths, but in the special case of wanting to -extend a template with an overriding version of itself we can reference its -parent's full, unambiguous template path in the extends tag: - -.. code-block:: twig - - {# page.twig in .../templates/mysite #} - {% extends "default/page.twig" %} {# from .../templates #} - -.. note:: - - This recipe was inspired by the following Django wiki page: - https://code.djangoproject.com/wiki/ExtendingTemplates - -Customizing the Syntax ----------------------- - -Twig allows some syntax customization for the block delimiters. It's **not** -recommended to use this feature as templates will be tied with your custom -syntax. But for specific projects, it can make sense to change the defaults. - -To change the block delimiters, you need to create your own lexer object:: - - $twig = new \Twig\Environment(...); - - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => ['{#', '#}'], - 'tag_block' => ['{%', '%}'], - 'tag_variable' => ['{{', '}}'], - 'interpolation' => ['#{', '}'], - ]); - $twig->setLexer($lexer); - -Here are some configuration example that simulates some other template engines -syntax:: - - // Ruby erb syntax - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => ['<%#', '%>'], - 'tag_block' => ['<%', '%>'], - 'tag_variable' => ['<%=', '%>'], - ]); - - // SGML Comment Syntax - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => ['<!--#', '-->'], - 'tag_block' => ['<!--', '-->'], - 'tag_variable' => ['${', '}'], - ]); - - // Smarty like - $lexer = new \Twig\Lexer($twig, [ - 'tag_comment' => ['{*', '*}'], - 'tag_block' => ['{', '}'], - 'tag_variable' => ['{$', '}'], - ]); - -Using dynamic Object Properties -------------------------------- - -When Twig encounters a variable like ``article.title``, it tries to find a -``title`` public property in the ``article`` object. - -It also works if the property does not exist but is rather defined dynamically -thanks to the magic ``__get()`` method; you need to also implement the -``__isset()`` magic method like shown in the following snippet of code:: - - class Article - { - public function __get($name) - { - if ('title' == $name) { - return 'The title'; - } - - // throw some kind of error - } - - public function __isset($name) - { - if ('title' == $name) { - return true; - } - - return false; - } - } - -Accessing the parent Context in Nested Loops --------------------------------------------- - -Sometimes, when using nested loops, you need to access the parent context. The -parent context is always accessible via the ``loop.parent`` variable. For -instance, if you have the following template data:: - - $data = [ - 'topics' => [ - 'topic1' => ['Message 1 of topic 1', 'Message 2 of topic 1'], - 'topic2' => ['Message 1 of topic 2', 'Message 2 of topic 2'], - ], - ]; - -And the following template to display all messages in all topics: - -.. code-block:: twig - - {% for topic, messages in topics %} - * {{ loop.index }}: {{ topic }} - {% for message in messages %} - - {{ loop.parent.loop.index }}.{{ loop.index }}: {{ message }} - {% endfor %} - {% endfor %} - -The output will be similar to: - -.. code-block:: text - - * 1: topic1 - - 1.1: The message 1 of topic 1 - - 1.2: The message 2 of topic 1 - * 2: topic2 - - 2.1: The message 1 of topic 2 - - 2.2: The message 2 of topic 2 - -In the inner loop, the ``loop.parent`` variable is used to access the outer -context. So, the index of the current ``topic`` defined in the outer for loop -is accessible via the ``loop.parent.loop.index`` variable. - -Defining undefined Functions, Filters, and Tags on the Fly ----------------------------------------------------------- - -.. versionadded:: 3.2 - - The ``registerUndefinedTokenParserCallback()`` method was added in Twig - 3.2. - -When a function/filter/tag is not defined, Twig defaults to throw a -``\Twig\Error\SyntaxError`` exception. However, it can also call a `callback`_ -(any valid PHP callable) which should return a function/filter/tag. - -For tags, register callbacks with ``registerUndefinedTokenParserCallback()``. -For filters, register callbacks with ``registerUndefinedFilterCallback()``. -For functions, use ``registerUndefinedFunctionCallback()``:: - - // auto-register all native PHP functions as Twig functions - // NEVER do this in a project as it's NOT secure - $twig->registerUndefinedFunctionCallback(function ($name) { - if (function_exists($name)) { - return new \Twig\TwigFunction($name, $name); - } - - return false; - }); - -If the callable is not able to return a valid function/filter/tag, it must -return ``false``. - -If you register more than one callback, Twig will call them in turn until one -does not return ``false``. - -.. tip:: - - As the resolution of functions/filters/tags is done during compilation, - there is no overhead when registering these callbacks. - -Validating the Template Syntax ------------------------------- - -When template code is provided by a third-party (through a web interface for -instance), it might be interesting to validate the template syntax before -saving it. If the template code is stored in a ``$template`` variable, here is -how you can do it:: - - try { - $twig->parse($twig->tokenize(new \Twig\Source($template))); - - // the $template is valid - } catch (\Twig\Error\SyntaxError $e) { - // $template contains one or more syntax errors - } - -If you iterate over a set of files, you can pass the filename to the -``tokenize()`` method to get the filename in the exception message:: - - foreach ($files as $file) { - try { - $twig->parse($twig->tokenize(new \Twig\Source($template, $file->getFilename(), $file))); - - // the $template is valid - } catch (\Twig\Error\SyntaxError $e) { - // $template contains one or more syntax errors - } - } - -.. note:: - - This method won't catch any sandbox policy violations because the policy - is enforced during template rendering (as Twig needs the context for some - checks like allowed methods on objects). - -Refreshing modified Templates when OPcache or APC is enabled ------------------------------------------------------------- - -When using OPcache with ``opcache.validate_timestamps`` set to ``0`` or APC -with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template -cache won't update the cache. - -To get around this, force Twig to invalidate the bytecode cache:: - - $twig = new \Twig\Environment($loader, [ - 'cache' => new \Twig\Cache\FilesystemCache('/some/cache/path', \Twig\Cache\FilesystemCache::FORCE_BYTECODE_INVALIDATION), - // ... - ]); - -Reusing a stateful Node Visitor -------------------------------- - -When attaching a visitor to a ``\Twig\Environment`` instance, Twig uses it to -visit *all* templates it compiles. If you need to keep some state information -around, you probably want to reset it when visiting a new template. - -This can be achieved with the following code:: - - protected $someTemplateState = []; - - public function enterNode(\Twig\Node\Node $node, \Twig\Environment $env) - { - if ($node instanceof \Twig\Node\ModuleNode) { - // reset the state as we are entering a new template - $this->someTemplateState = []; - } - - // ... - - return $node; - } - -Using a Database to store Templates ------------------------------------ - -If you are developing a CMS, templates are usually stored in a database. This -recipe gives you a simple PDO template loader you can use as a starting point -for your own. - -First, let's create a temporary in-memory SQLite3 database to work with:: - - $dbh = new PDO('sqlite::memory:'); - $dbh->exec('CREATE TABLE templates (name STRING, source STRING, last_modified INTEGER)'); - $base = '{% block content %}{% endblock %}'; - $index = ' - {% extends "base.twig" %} - {% block content %}Hello {{ name }}{% endblock %} - '; - $now = time(); - $dbh->prepare('INSERT INTO templates (name, source, last_modified) VALUES (?, ?, ?)')->execute(['base.twig', $base, $now]); - $dbh->prepare('INSERT INTO templates (name, source, last_modified) VALUES (?, ?, ?)')->execute(['index.twig', $index, $now]); - -We have created a simple ``templates`` table that hosts two templates: -``base.twig`` and ``index.twig``. - -Now, let's define a loader able to use this database:: - - class DatabaseTwigLoader implements \Twig\Loader\LoaderInterface - { - protected $dbh; - - public function __construct(PDO $dbh) - { - $this->dbh = $dbh; - } - - public function getSourceContext(string $name): Source - { - if (false === $source = $this->getValue('source', $name)) { - throw new \Twig\Error\LoaderError(sprintf('Template "%s" does not exist.', $name)); - } - - return new \Twig\Source($source, $name); - } - - public function exists(string $name) - { - return $name === $this->getValue('name', $name); - } - - public function getCacheKey(string $name): string - { - return $name; - } - - public function isFresh(string $name, int $time): bool - { - if (false === $lastModified = $this->getValue('last_modified', $name)) { - return false; - } - - return $lastModified <= $time; - } - - protected function getValue($column, $name) - { - $sth = $this->dbh->prepare('SELECT '.$column.' FROM templates WHERE name = :name'); - $sth->execute([':name' => (string) $name]); - - return $sth->fetchColumn(); - } - } - -Finally, here is an example on how you can use it:: - - $loader = new DatabaseTwigLoader($dbh); - $twig = new \Twig\Environment($loader); - - echo $twig->render('index.twig', ['name' => 'Fabien']); - -Using different Template Sources --------------------------------- - -This recipe is the continuation of the previous one. Even if you store the -contributed templates in a database, you might want to keep the original/base -templates on the filesystem. When templates can be loaded from different -sources, you need to use the ``\Twig\Loader\ChainLoader`` loader. - -As you can see in the previous recipe, we reference the template in the exact -same way as we would have done it with a regular filesystem loader. This is -the key to be able to mix and match templates coming from the database, the -filesystem, or any other loader for that matter: the template name should be a -logical name, and not the path from the filesystem:: - - $loader1 = new DatabaseTwigLoader($dbh); - $loader2 = new \Twig\Loader\ArrayLoader([ - 'base.twig' => '{% block content %}{% endblock %}', - ]); - $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]); - - $twig = new \Twig\Environment($loader); - - echo $twig->render('index.twig', ['name' => 'Fabien']); - -Now that the ``base.twig`` templates is defined in an array loader, you can -remove it from the database, and everything else will still work as before. - -Loading a Template from a String --------------------------------- - -From a template, you can load a template stored in a string via the -``template_from_string`` function (via the -``\Twig\Extension\StringLoaderExtension`` extension): - -.. code-block:: twig - - {{ include(template_from_string("Hello {{ name }}")) }} - -From PHP, it's also possible to load a template stored in a string via -``\Twig\Environment::createTemplate()``:: - - $template = $twig->createTemplate('hello {{ name }}'); - echo $template->render(['name' => 'Fabien']); - -Using Twig and AngularJS in the same Templates ----------------------------------------------- - -Mixing different template syntaxes in the same file is not a recommended -practice as both AngularJS and Twig use the same delimiters in their syntax: -``{{`` and ``}}``. - -Still, if you want to use AngularJS and Twig in the same template, there are -two ways to make it work depending on the amount of AngularJS you need to -include in your templates: - -* Escaping the AngularJS delimiters by wrapping AngularJS sections with the - ``{% verbatim %}`` tag or by escaping each delimiter via ``{{ '{{' }}`` and - ``{{ '}}' }}``; - -* Changing the delimiters of one of the template engines (depending on which - engine you introduced last): - - * For AngularJS, change the interpolation tags using the - ``interpolateProvider`` service, for instance at the module initialization - time: - - .. code-block:: javascript - - angular.module('myApp', []).config(function($interpolateProvider) { - $interpolateProvider.startSymbol('{[').endSymbol(']}'); - }); - - * For Twig, change the delimiters via the ``tag_variable`` Lexer option:: - - $env->setLexer(new \Twig\Lexer($env, [ - 'tag_variable' => ['{[', ']}'], - ])); - -.. _callback: https://secure.php.net/manual/en/function.is-callable.php diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/apply.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/apply.rst deleted file mode 100644 index 27f25f91..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/apply.rst +++ /dev/null @@ -1,20 +0,0 @@ -``apply`` -========= - -The ``apply`` tag allows you to apply Twig filters on a block of template data: - -.. code-block:: twig - - {% apply upper %} - This text becomes uppercase - {% endapply %} - -You can also chain filters and pass arguments to them: - -.. code-block:: html+twig - - {% apply lower|escape('html') %} - <strong>SOME TEXT</strong> - {% endapply %} - - {# outputs "<strong>some text</strong>" #} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/autoescape.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/autoescape.rst deleted file mode 100644 index 8c621d3a..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/autoescape.rst +++ /dev/null @@ -1,61 +0,0 @@ -``autoescape`` -============== - -Whether automatic escaping is enabled or not, you can mark a section of a -template to be escaped or not by using the ``autoescape`` tag: - -.. code-block:: twig - - {% autoescape %} - Everything will be automatically escaped in this block - using the HTML strategy - {% endautoescape %} - - {% autoescape 'html' %} - Everything will be automatically escaped in this block - using the HTML strategy - {% endautoescape %} - - {% autoescape 'js' %} - Everything will be automatically escaped in this block - using the js escaping strategy - {% endautoescape %} - - {% autoescape false %} - Everything will be outputted as is in this block - {% endautoescape %} - -When automatic escaping is enabled everything is escaped by default except for -values explicitly marked as safe. Those can be marked in the template by using -the :doc:`raw<../filters/raw>` filter: - -.. code-block:: twig - - {% autoescape %} - {{ safe_value|raw }} - {% endautoescape %} - -Functions returning template data (like :doc:`macros<macro>` and -:doc:`parent<../functions/parent>`) always return safe markup. - -.. note:: - - Twig is smart enough to not escape an already escaped value by the - :doc:`escape<../filters/escape>` filter. - -.. note:: - - Twig does not escape static expressions: - - .. code-block:: html+twig - - {% set hello = "<strong>Hello</strong>" %} - {{ hello }} - {{ "<strong>world</strong>" }} - - Will be rendered "<strong>Hello</strong> **world**". - -.. note:: - - The chapter :doc:`Twig for Developers<../api>` gives more information - about when and how automatic escaping is applied. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/block.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/block.rst deleted file mode 100644 index 272bc7f3..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/block.rst +++ /dev/null @@ -1,12 +0,0 @@ -``block`` -========= - -Blocks are used for inheritance and act as placeholders and replacements at -the same time. They are documented in detail in the documentation for the -:doc:`extends<../tags/extends>` tag. - -Block names must consist of alphanumeric characters, and underscores. The first char can't be a digit and dashes are not permitted. - -.. seealso:: - - :doc:`block<../functions/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`, :doc:`extends<../tags/extends>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/cache.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/cache.rst deleted file mode 100644 index b1d032bc..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/cache.rst +++ /dev/null @@ -1,113 +0,0 @@ -``cache`` -========= - -.. versionadded:: 3.2 - - The ``cache`` tag was added in Twig 3.2. - -The ``cache`` tag tells Twig to cache a template fragment: - -.. code-block:: twig - - {% cache "cache key" %} - Cached forever (depending on the cache implementation) - {% endcache %} - -If you want to expire the cache after a certain amount of time, specify an -expiration in seconds via the ``ttl()`` modifier: - -.. code-block:: twig - - {% cache "cache key" ttl(300) %} - Cached for 300 seconds - {% endcache %} - -The cache key can be any string that does not use the following reserved -characters ``{}()/\@:``; a good practice is to embed some useful information in -the key that allows the cache to automatically expire when it must be -refreshed: - -* Give each cache a unique name and namespace it like your templates; - -* Embed an integer that you increment whenever the template code changes (to - automatically invalidate all current caches); - -* Embed a unique key that is updated whenever the variables used in the - template code changes. - -For instance, I would use ``{% cache "blog_post;v1;" ~ post.id ~ ";" ~ -post.updated_at %}`` to cache a blog content template fragment where -``blog_post`` describes the template fragment, ``v1`` represents the first -version of the template code, ``post.id`` represent the id of the blog post, -and ``post.updated_at`` returns a timestamp that represents the time where the -blog post was last modified. - -Using such a strategy for naming cache keys allows to avoid using a ``ttl``. -It's like using a "validation" strategy instead of an "expiration" strategy as -we do for HTTP caches. - -If your cache implementation supports tags, you can also tag your cache items: - -.. code-block:: twig - - {% cache "cache key" tags('blog') %} - Some code - {% endcache %} - - {% cache "cache key" tags(['cms', 'blog']) %} - Some code - {% endcache %} - -The ``cache`` tag creates a new "scope" for variables, meaning that the changes -are local to the template fragment: - -.. code-block:: twig - - {% set count = 1 %} - - {% cache "cache key" tags('blog') %} - {# Won't affect the value of count outside of the cache tag #} - {% set count = 2 %} - Some code - {% endcache %} - - {# Displays 1 #} - {{ count }} - -.. note:: - - The ``cache`` tag is part of the ``CacheExtension`` which is not installed - by default. Install it first: - - .. code-block:: bash - - $ composer require twig/cache-extra - - On Symfony projects, you can automatically enable it by installing the - ``twig/extra-bundle``: - - .. code-block:: bash - - $ composer require twig/extra-bundle - - Or add the extension explicitly on the Twig environment:: - - use Twig\Extra\Cache\CacheExtension; - - $twig = new \Twig\Environment(...); - $twig->addExtension(new CacheExtension()); - - If you are not using Symfony, you must also register the extension runtime:: - - use Symfony\Component\Cache\Adapter\FilesystemAdapter; - use Symfony\Component\Cache\Adapter\TagAwareAdapter; - use Twig\Extra\Cache\CacheRuntime; - use Twig\RuntimeLoader\RuntimeLoaderInterface; - - $twig->addRuntimeLoader(new class implements RuntimeLoaderInterface { - public function load($class) { - if (CacheRuntime::class === $class) { - return new CacheRuntime(new TagAwareAdapter(new FilesystemAdapter())); - } - } - }); diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/deprecated.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/deprecated.rst deleted file mode 100644 index c078eef4..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/deprecated.rst +++ /dev/null @@ -1,27 +0,0 @@ -``deprecated`` -============== - -Twig generates a deprecation notice (via a call to the ``trigger_error()`` -PHP function) where the ``deprecated`` tag is used in a template: - -.. code-block:: twig - - {# base.twig #} - {% deprecated 'The "base.twig" template is deprecated, use "layout.twig" instead.' %} - {% extends 'layout.twig' %} - -Also you can deprecate a block in the following way: - -.. code-block:: twig - - {% block hey %} - {% deprecated 'The "hey" block is deprecated, use "greet" instead.' %} - {{ block('greet') }} - {% endblock %} - - {% block greet %} - Hey you! - {% endblock %} - -Note that by default, the deprecation notices are silenced and never displayed nor logged. -See :ref:`deprecation-notices` to learn how to handle them. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/do.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/do.rst deleted file mode 100644 index b8fe9f08..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/do.rst +++ /dev/null @@ -1,9 +0,0 @@ -``do`` -====== - -The ``do`` tag works exactly like the regular variable expression (``{{ ... -}}``) just that it doesn't print anything: - -.. code-block:: twig - - {% do 1 + 2 %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/embed.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/embed.rst deleted file mode 100644 index 42e33b19..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/embed.rst +++ /dev/null @@ -1,177 +0,0 @@ -``embed`` -========= - -The ``embed`` tag combines the behavior of :doc:`include<include>` and -:doc:`extends<extends>`. -It allows you to include another template's contents, just like ``include`` -does. But it also allows you to override any block defined inside the -included template, like when extending a template. - -Think of an embedded template as a "micro layout skeleton". - -.. code-block:: twig - - {% embed "teasers_skeleton.twig" %} - {# These blocks are defined in "teasers_skeleton.twig" #} - {# and we override them right here: #} - {% block left_teaser %} - Some content for the left teaser box - {% endblock %} - {% block right_teaser %} - Some content for the right teaser box - {% endblock %} - {% endembed %} - -The ``embed`` tag takes the idea of template inheritance to the level of -content fragments. While template inheritance allows for "document skeletons", -which are filled with life by child templates, the ``embed`` tag allows you to -create "skeletons" for smaller units of content and re-use and fill them -anywhere you like. - -Since the use case may not be obvious, let's look at a simplified example. -Imagine a base template shared by multiple HTML pages, defining a single block -named "content": - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ │ │ - │ │ │ │ - │ │ (child template to │ │ - │ │ put content here) │ │ - │ │ │ │ - │ │ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -Some pages ("foo" and "bar") share the same content structure - -two vertically stacked boxes: - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ ┌─ block "top" ───┐ │ │ - │ │ │ │ │ │ - │ │ └─────────────────┘ │ │ - │ │ ┌─ block "bottom" ┐ │ │ - │ │ │ │ │ │ - │ │ └─────────────────┘ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -While other pages ("boom" and "baz") share a different content structure - -two boxes side by side: - -.. code-block:: text - - ┌─── page layout ─────────────────────┐ - │ │ - │ ┌── block "content" ──┐ │ - │ │ │ │ - │ │ ┌ block ┐ ┌ block ┐ │ │ - │ │ │"left" │ │"right"│ │ │ - │ │ │ │ │ │ │ │ - │ │ │ │ │ │ │ │ - │ │ └───────┘ └───────┘ │ │ - │ └─────────────────────┘ │ - │ │ - └─────────────────────────────────────┘ - -Without the ``embed`` tag, you have two ways to design your templates: - -* Create two "intermediate" base templates that extend the master layout - template: one with vertically stacked boxes to be used by the "foo" and - "bar" pages and another one with side-by-side boxes for the "boom" and - "baz" pages. - -* Embed the markup for the top/bottom and left/right boxes into each page - template directly. - -These two solutions do not scale well because they each have a major drawback: - -* The first solution may indeed work for this simplified example. But imagine - we add a sidebar, which may again contain different, recurring structures - of content. Now we would need to create intermediate base templates for - all occurring combinations of content structure and sidebar structure... - and so on. - -* The second solution involves duplication of common code with all its negative - consequences: any change involves finding and editing all affected copies - of the structure, correctness has to be verified for each copy, copies may - go out of sync by careless modifications etc. - -In such a situation, the ``embed`` tag comes in handy. The common layout -code can live in a single base template, and the two different content structures, -let's call them "micro layouts" go into separate templates which are embedded -as necessary: - -Page template ``foo.twig``: - -.. code-block:: twig - - {% extends "layout_skeleton.twig" %} - - {% block content %} - {% embed "vertical_boxes_skeleton.twig" %} - {% block top %} - Some content for the top box - {% endblock %} - - {% block bottom %} - Some content for the bottom box - {% endblock %} - {% endembed %} - {% endblock %} - -And here is the code for ``vertical_boxes_skeleton.twig``: - -.. code-block:: html+twig - - <div class="top_box"> - {% block top %} - Top box default content - {% endblock %} - </div> - - <div class="bottom_box"> - {% block bottom %} - Bottom box default content - {% endblock %} - </div> - -The goal of the ``vertical_boxes_skeleton.twig`` template being to factor -out the HTML markup for the boxes. - -The ``embed`` tag takes the exact same arguments as the ``include`` tag: - -.. code-block:: twig - - {% embed "base" with {'foo': 'bar'} %} - ... - {% endembed %} - - {% embed "base" with {'foo': 'bar'} only %} - ... - {% endembed %} - - {% embed "base" ignore missing %} - ... - {% endembed %} - -.. warning:: - - As embedded templates do not have "names", auto-escaping strategies based - on the template name won't work as expected if you change the context (for - instance, if you embed a CSS/JavaScript template into an HTML one). In that - case, explicitly set the default auto-escaping strategy with the - ``autoescape`` tag. - -.. seealso:: - - :doc:`include<../tags/include>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/extends.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/extends.rst deleted file mode 100644 index 7f1c1e8c..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/extends.rst +++ /dev/null @@ -1,263 +0,0 @@ -``extends`` -=========== - -The ``extends`` tag can be used to extend a template from another one. - -.. note:: - - Like PHP, Twig does not support multiple inheritance. So you can only have - one extends tag called per rendering. However, Twig supports horizontal - :doc:`reuse<use>`. - -Let's define a base template, ``base.html``, which defines a simple HTML -skeleton document: - -.. code-block:: html+twig - - <!DOCTYPE html> - <html> - <head> - {% block head %} - <link rel="stylesheet" href="style.css"/> - <title>{% block title %}{% endblock %} - My Webpage</title> - {% endblock %} - </head> - <body> - <div id="content">{% block content %}{% endblock %}</div> - <div id="footer"> - {% block footer %} - © Copyright 2011 by <a href="http://domain.invalid/">you</a>. - {% endblock %} - </div> - </body> - </html> - -In this example, the :doc:`block<block>` tags define four blocks that child -templates can fill in. - -All the ``block`` tag does is to tell the template engine that a child -template may override those portions of the template. - -Child Template --------------- - -A child template might look like this: - -.. code-block:: html+twig - - {% extends "base.html" %} - - {% block title %}Index{% endblock %} - {% block head %} - {{ parent() }} - <style type="text/css"> - .important { color: #336699; } - </style> - {% endblock %} - {% block content %} - <h1>Index</h1> - <p class="important"> - Welcome on my awesome homepage. - </p> - {% endblock %} - -The ``extends`` tag is the key here. It tells the template engine that this -template "extends" another template. When the template system evaluates this -template, first it locates the parent. The extends tag should be the first tag -in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -You can't define multiple ``block`` tags with the same name in the same -template. This limitation exists because a block tag works in "both" -directions. That is, a block tag doesn't just provide a hole to fill - it also -defines the content that fills the hole in the *parent*. If there were two -similarly-named ``block`` tags in a template, that template's parent wouldn't -know which one of the blocks' content to use. - -If you want to print a block multiple times you can however use the -``block`` function: - -.. code-block:: html+twig - - <title>{% block title %}{% endblock %}</title> - <h1>{{ block('title') }}</h1> - {% block body %}{% endblock %} - -Parent Blocks -------------- - -It's possible to render the contents of the parent block by using the -:doc:`parent<../functions/parent>` function. This gives back the results of -the parent block: - -.. code-block:: html+twig - - {% block sidebar %} - <h3>Table Of Contents</h3> - ... - {{ parent() }} - {% endblock %} - -Named Block End-Tags --------------------- - -Twig allows you to put the name of the block after the end tag for better -readability (the name after the ``endblock`` word must match the block name): - -.. code-block:: twig - - {% block sidebar %} - {% block inner_sidebar %} - ... - {% endblock inner_sidebar %} - {% endblock sidebar %} - -Block Nesting and Scope ------------------------ - -Blocks can be nested for more complex layouts. Per default, blocks have access -to variables from outer scopes: - -.. code-block:: html+twig - - {% for item in seq %} - <li>{% block loop_item %}{{ item }}{% endblock %}</li> - {% endfor %} - -Block Shortcuts ---------------- - -For blocks with little content, it's possible to use a shortcut syntax. The -following constructs do the same thing: - -.. code-block:: twig - - {% block title %} - {{ page_title|title }} - {% endblock %} - -.. code-block:: twig - - {% block title page_title|title %} - -Dynamic Inheritance -------------------- - -Twig supports dynamic inheritance by using a variable as the base template: - -.. code-block:: twig - - {% extends some_var %} - -If the variable evaluates to a ``\Twig\Template`` or a ``\Twig\TemplateWrapper`` -instance, Twig will use it as the parent template:: - - // {% extends layout %} - - $layout = $twig->load('some_layout_template.twig'); - - $twig->display('template.twig', ['layout' => $layout]); - -You can also provide a list of templates that are checked for existence. The -first template that exists will be used as a parent: - -.. code-block:: twig - - {% extends ['layout.html', 'base_layout.html'] %} - -Conditional Inheritance ------------------------ - -As the template name for the parent can be any valid Twig expression, it's -possible to make the inheritance mechanism conditional: - -.. code-block:: twig - - {% extends standalone ? "minimum.html" : "base.html" %} - -In this example, the template will extend the "minimum.html" layout template -if the ``standalone`` variable evaluates to ``true``, and "base.html" -otherwise. - -How do blocks work? -------------------- - -A block provides a way to change how a certain part of a template is rendered -but it does not interfere in any way with the logic around it. - -Let's take the following example to illustrate how a block works and more -importantly, how it does not work: - -.. code-block:: html+twig - - {# base.twig #} - {% for post in posts %} - {% block post %} - <h1>{{ post.title }}</h1> - <p>{{ post.body }}</p> - {% endblock %} - {% endfor %} - -If you render this template, the result would be exactly the same with or -without the ``block`` tag. The ``block`` inside the ``for`` loop is just a way -to make it overridable by a child template: - -.. code-block:: html+twig - - {# child.twig #} - {% extends "base.twig" %} - - {% block post %} - <article> - <header>{{ post.title }}</header> - <section>{{ post.text }}</section> - </article> - {% endblock %} - -Now, when rendering the child template, the loop is going to use the block -defined in the child template instead of the one defined in the base one; the -executed template is then equivalent to the following one: - -.. code-block:: html+twig - - {% for post in posts %} - <article> - <header>{{ post.title }}</header> - <section>{{ post.text }}</section> - </article> - {% endfor %} - -Let's take another example: a block included within an ``if`` statement: - -.. code-block:: html+twig - - {% if posts is empty %} - {% block head %} - {{ parent() }} - - <meta name="robots" content="noindex, follow"> - {% endblock head %} - {% endif %} - -Contrary to what you might think, this template does not define a block -conditionally; it just makes overridable by a child template the output of -what will be rendered when the condition is ``true``. - -If you want the output to be displayed conditionally, use the following -instead: - -.. code-block:: html+twig - - {% block head %} - {{ parent() }} - - {% if posts is empty %} - <meta name="robots" content="noindex, follow"> - {% endif %} - {% endblock head %} - -.. seealso:: - - :doc:`block<../functions/block>`, :doc:`block<../tags/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/flush.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/flush.rst deleted file mode 100644 index 332e9825..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/flush.rst +++ /dev/null @@ -1,14 +0,0 @@ -``flush`` -========= - -The ``flush`` tag tells Twig to flush the output buffer: - -.. code-block:: twig - - {% flush %} - -.. note:: - - Internally, Twig uses the PHP `flush`_ function. - -.. _`flush`: https://secure.php.net/flush diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/for.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/for.rst deleted file mode 100644 index 4517f590..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/for.rst +++ /dev/null @@ -1,141 +0,0 @@ -``for`` -======= - -Loop over each item in a sequence. For example, to display a list of users -provided in a variable called ``users``: - -.. code-block:: html+twig - - <h1>Members</h1> - <ul> - {% for user in users %} - <li>{{ user.username|e }}</li> - {% endfor %} - </ul> - -.. note:: - - A sequence can be either an array or an object implementing the - ``Traversable`` interface. - -If you do need to iterate over a sequence of numbers, you can use the ``..`` -operator: - -.. code-block:: twig - - {% for i in 0..10 %} - * {{ i }} - {% endfor %} - -The above snippet of code would print all numbers from 0 to 10. - -It can be also useful with letters: - -.. code-block:: twig - - {% for letter in 'a'..'z' %} - * {{ letter }} - {% endfor %} - -The ``..`` operator can take any expression at both sides: - -.. code-block:: twig - - {% for letter in 'a'|upper..'z'|upper %} - * {{ letter }} - {% endfor %} - -.. tip: - - If you need a step different from 1, you can use the ``range`` function - instead. - -The `loop` variable -------------------- - -Inside of a ``for`` loop block you can access some special variables: - -===================== ============================================================= -Variable Description -===================== ============================================================= -``loop.index`` The current iteration of the loop. (1 indexed) -``loop.index0`` The current iteration of the loop. (0 indexed) -``loop.revindex`` The number of iterations from the end of the loop (1 indexed) -``loop.revindex0`` The number of iterations from the end of the loop (0 indexed) -``loop.first`` True if first iteration -``loop.last`` True if last iteration -``loop.length`` The number of items in the sequence -``loop.parent`` The parent context -===================== ============================================================= - -.. code-block:: twig - - {% for user in users %} - {{ loop.index }} - {{ user.username }} - {% endfor %} - -.. note:: - - The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and - ``loop.last`` variables are only available for PHP arrays, or objects that - implement the ``Countable`` interface. - -The `else` Clause ------------------ - -If no iteration took place because the sequence was empty, you can render a -replacement block by using ``else``: - -.. code-block:: html+twig - - <ul> - {% for user in users %} - <li>{{ user.username|e }}</li> - {% else %} - <li><em>no user found</em></li> - {% endfor %} - </ul> - -Iterating over Keys -------------------- - -By default, a loop iterates over the values of the sequence. You can iterate -on keys by using the ``keys`` filter: - -.. code-block:: html+twig - - <h1>Members</h1> - <ul> - {% for key in users|keys %} - <li>{{ key }}</li> - {% endfor %} - </ul> - -Iterating over Keys and Values ------------------------------- - -You can also access both keys and values: - -.. code-block:: html+twig - - <h1>Members</h1> - <ul> - {% for key, user in users %} - <li>{{ key }}: {{ user.username|e }}</li> - {% endfor %} - </ul> - -Iterating over a Subset ------------------------ - -You might want to iterate over a subset of values. This can be achieved using -the :doc:`slice <../filters/slice>` filter: - -.. code-block:: html+twig - - <h1>Top Ten Members</h1> - <ul> - {% for user in users|slice(0, 10) %} - <li>{{ user.username|e }}</li> - {% endfor %} - </ul> diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/from.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/from.rst deleted file mode 100644 index 96c439aa..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/from.rst +++ /dev/null @@ -1,6 +0,0 @@ -``from`` -======== - -The ``from`` tag imports :doc:`macro<../tags/macro>` names into the current -namespace. The tag is documented in detail in the documentation for the -:doc:`macro<../tags/macro>` tag. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/if.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/if.rst deleted file mode 100644 index 2d747522..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/if.rst +++ /dev/null @@ -1,79 +0,0 @@ -``if`` -====== - -The ``if`` statement in Twig is comparable with the if statements of PHP. - -In the simplest form you can use it to test if an expression evaluates to -``true``: - -.. code-block:: html+twig - - {% if online == false %} - <p>Our website is in maintenance mode. Please, come back later.</p> - {% endif %} - -You can also test if an array is not empty: - -.. code-block:: html+twig - - {% if users %} - <ul> - {% for user in users %} - <li>{{ user.username|e }}</li> - {% endfor %} - </ul> - {% endif %} - -.. note:: - - If you want to test if the variable is defined, use ``if users is - defined`` instead. - -You can also use ``not`` to check for values that evaluate to ``false``: - -.. code-block:: html+twig - - {% if not user.subscribed %} - <p>You are not subscribed to our mailing list.</p> - {% endif %} - -For multiple conditions, ``and`` and ``or`` can be used: - -.. code-block:: html+twig - - {% if temperature > 18 and temperature < 27 %} - <p>It's a nice day for a walk in the park.</p> - {% endif %} - -For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can -use more complex ``expressions`` there too: - -.. code-block:: twig - - {% if product.stock > 10 %} - Available - {% elseif product.stock > 0 %} - Only {{ product.stock }} left! - {% else %} - Sold-out! - {% endif %} - -.. note:: - - The rules to determine if an expression is ``true`` or ``false`` are the - same as in PHP; here are the edge cases rules: - - ====================== ==================== - Value Boolean evaluation - ====================== ==================== - empty string false - numeric zero false - NAN (Not A Number) true - INF (Infinity) true - whitespace-only string true - string "0" or '0' false - empty array false - null false - non-empty array true - object true - ====================== ==================== diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/import.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/import.rst deleted file mode 100644 index f217479f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/import.rst +++ /dev/null @@ -1,6 +0,0 @@ -``import`` -========== - -The ``import`` tag imports :doc:`macro<../tags/macro>` names in a local -variable. The tag is documented in detail in the documentation for the -:doc:`macro<../tags/macro>` tag. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/include.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/include.rst deleted file mode 100644 index 93fb0371..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/include.rst +++ /dev/null @@ -1,110 +0,0 @@ -``include`` -=========== - -The ``include`` statement includes a template and outputs the rendered content -of that file: - -.. code-block:: twig - - {% include 'header.html' %} - Body - {% include 'footer.html' %} - -.. note:: - - It is recommended to use the :doc:`include<../functions/include>` function - instead as it provides the same features with a bit more flexibility: - - * The ``include`` function is semantically more "correct" (including a - template outputs its rendered contents in the current scope; a tag should - not display anything); - - * The ``include`` function is more "composable": - - .. code-block:: twig - - {# Store a rendered template in a variable #} - {% set content %} - {% include 'template.html' %} - {% endset %} - {# vs #} - {% set content = include('template.html') %} - - {# Apply filter on a rendered template #} - {% apply upper %} - {% include 'template.html' %} - {% endapply %} - {# vs #} - {{ include('template.html')|upper }} - - * The ``include`` function does not impose any specific order for - arguments thanks to :ref:`named arguments <named-arguments>`. - -Included templates have access to the variables of the active context. - -If you are using the filesystem loader, the templates are looked for in the -paths defined by it. - -You can add additional variables by passing them after the ``with`` keyword: - -.. code-block:: twig - - {# template.html will have access to the variables from the current context and the additional ones provided #} - {% include 'template.html' with {'foo': 'bar'} %} - - {% set vars = {'foo': 'bar'} %} - {% include 'template.html' with vars %} - -You can disable access to the context by appending the ``only`` keyword: - -.. code-block:: twig - - {# only the foo variable will be accessible #} - {% include 'template.html' with {'foo': 'bar'} only %} - -.. code-block:: twig - - {# no variables will be accessible #} - {% include 'template.html' only %} - -.. tip:: - - When including a template created by an end user, you should consider - sandboxing it. More information in the :doc:`Twig for Developers<../api>` - chapter and in the :doc:`sandbox<../tags/sandbox>` tag documentation. - -The template name can be any valid Twig expression: - -.. code-block:: twig - - {% include some_var %} - {% include ajax ? 'ajax.html' : 'not_ajax.html' %} - -And if the expression evaluates to a ``\Twig\Template`` or a -``\Twig\TemplateWrapper`` instance, Twig will use it directly:: - - // {% include template %} - - $template = $twig->load('some_template.twig'); - - $twig->display('template.twig', ['template' => $template]); - -You can mark an include with ``ignore missing`` in which case Twig will ignore -the statement if the template to be included does not exist. It has to be -placed just after the template name. Here some valid examples: - -.. code-block:: twig - - {% include 'sidebar.html' ignore missing %} - {% include 'sidebar.html' ignore missing with {'foo': 'bar'} %} - {% include 'sidebar.html' ignore missing only %} - -You can also provide a list of templates that are checked for existence before -inclusion. The first template that exists will be included: - -.. code-block:: twig - - {% include ['page_detailed.html', 'page.html'] %} - -If ``ignore missing`` is given, it will fall back to rendering nothing if none -of the templates exist, otherwise it will throw an exception. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/index.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/index.rst deleted file mode 100644 index b3c10408..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/index.rst +++ /dev/null @@ -1,26 +0,0 @@ -Tags -==== - -.. toctree:: - :maxdepth: 1 - - apply - autoescape - block - cache - deprecated - do - embed - extends - flush - for - from - if - import - include - macro - sandbox - set - use - verbatim - with diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/macro.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/macro.rst deleted file mode 100644 index 42fc460c..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/macro.rst +++ /dev/null @@ -1,140 +0,0 @@ -``macro`` -========= - -Macros are comparable with functions in regular programming languages. They -are useful to reuse template fragments to not repeat yourself. - -Macros are defined in regular templates. - -Imagine having a generic helper template that define how to render HTML forms -via macros (called ``forms.html``): - -.. code-block:: html+twig - - {% macro input(name, value, type = "text", size = 20) %} - <input type="{{ type }}" name="{{ name }}" value="{{ value|e }}" size="{{ size }}"/> - {% endmacro %} - - {% macro textarea(name, value, rows = 10, cols = 40) %} - <textarea name="{{ name }}" rows="{{ rows }}" cols="{{ cols }}">{{ value|e }}</textarea> - {% endmacro %} - -Each macro argument can have a default value (here ``text`` is the default value -for ``type`` if not provided in the call). - -Macros differ from native PHP functions in a few ways: - -* Arguments of a macro are always optional. - -* If extra positional arguments are passed to a macro, they end up in the - special ``varargs`` variable as a list of values. - -But as with PHP functions, macros don't have access to the current template -variables. - -.. tip:: - - You can pass the whole context as an argument by using the special - ``_context`` variable. - -Importing Macros ----------------- - -There are two ways to import macros. You can import the complete template -containing the macros into a local variable (via the ``import`` tag) or only -import specific macros from the template (via the ``from`` tag). - -To import all macros from a template into a local variable, use the ``import`` -tag: - -.. code-block:: twig - - {% import "forms.html" as forms %} - -The above ``import`` call imports the ``forms.html`` file (which can contain -only macros, or a template and some macros), and import the macros as items of -the ``forms`` local variable. - -The macros can then be called at will in the *current* template: - -.. code-block:: html+twig - - <p>{{ forms.input('username') }}</p> - <p>{{ forms.input('password', null, 'password') }}</p> - -Alternatively you can import names from the template into the current namespace -via the ``from`` tag: - -.. code-block:: html+twig - - {% from 'forms.html' import input as input_field, textarea %} - - <p>{{ input_field('password', '', 'password') }}</p> - <p>{{ textarea('comment') }}</p> - -.. tip:: - - When macro usages and definitions are in the same template, you don't need to - import the macros as they are automatically available under the special - ``_self`` variable: - - .. code-block:: html+twig - - <p>{{ _self.input('password', '', 'password') }}</p> - - {% macro input(name, value, type = "text", size = 20) %} - <input type="{{ type }}" name="{{ name }}" value="{{ value|e }}" size="{{ size }}"/> - {% endmacro %} - -Macros Scoping --------------- - -The scoping rules are the same whether you imported macros via ``import`` or -``from``. - -Imported macros are always **local** to the current template. It means that -macros are available in all blocks and other macros defined in the current -template, but they are not available in included templates or child templates; -you need to explicitly re-import macros in each template. - -Imported macros are not available in the body of ``embed`` tags, you need -to explicitly re-import macros inside the tag. - -When calling ``import`` or ``from`` from a ``block`` tag, the imported macros -are only defined in the current block and they override macros defined at the -template level with the same names. - -When calling ``import`` or ``from`` from a ``macro`` tag, the imported macros -are only defined in the current macro and they override macros defined at the -template level with the same names. - -Checking if a Macro is defined ------------------------------- - -You can check if a macro is defined via the ``defined`` test: - -.. code-block:: twig - - {% import "macros.twig" as macros %} - - {% from "macros.twig" import hello %} - - {% if macros.hello is defined -%} - OK - {% endif %} - - {% if hello is defined -%} - OK - {% endif %} - -Named Macro End-Tags --------------------- - -Twig allows you to put the name of the macro after the end tag for better -readability (the name after the ``endmacro`` word must match the macro name): - -.. code-block:: twig - - {% macro input() %} - ... - {% endmacro input %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/sandbox.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/sandbox.rst deleted file mode 100644 index b331fdb8..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/sandbox.rst +++ /dev/null @@ -1,30 +0,0 @@ -``sandbox`` -=========== - -The ``sandbox`` tag can be used to enable the sandboxing mode for an included -template, when sandboxing is not enabled globally for the Twig environment: - -.. code-block:: twig - - {% sandbox %} - {% include 'user.html' %} - {% endsandbox %} - -.. warning:: - - The ``sandbox`` tag is only available when the sandbox extension is - enabled (see the :doc:`Twig for Developers<../api>` chapter). - -.. note:: - - The ``sandbox`` tag can only be used to sandbox an include tag and it - cannot be used to sandbox a section of a template. The following example - won't work: - - .. code-block:: twig - - {% sandbox %} - {% for i in 1..2 %} - {{ i }} - {% endfor %} - {% endsandbox %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/set.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/set.rst deleted file mode 100644 index 7a3a784f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/set.rst +++ /dev/null @@ -1,78 +0,0 @@ -``set`` -======= - -Inside code blocks you can also assign values to variables. Assignments use -the ``set`` tag and can have multiple targets. - -Here is how you can assign the ``bar`` value to the ``foo`` variable: - -.. code-block:: twig - - {% set foo = 'bar' %} - -After the ``set`` call, the ``foo`` variable is available in the template like -any other ones: - -.. code-block:: twig - - {# displays bar #} - {{ foo }} - -The assigned value can be any valid :ref:`Twig expression -<twig-expressions>`: - -.. code-block:: twig - - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - {% set foo = 'foo' ~ 'bar' %} - -Several variables can be assigned in one block: - -.. code-block:: twig - - {% set foo, bar = 'foo', 'bar' %} - - {# is equivalent to #} - - {% set foo = 'foo' %} - {% set bar = 'bar' %} - -The ``set`` tag can also be used to 'capture' chunks of text: - -.. code-block:: html+twig - - {% set foo %} - <div id="pagination"> - ... - </div> - {% endset %} - -.. caution:: - - If you enable automatic output escaping, Twig will only consider the - content to be safe when capturing chunks of text. - -.. note:: - - Note that loops are scoped in Twig; therefore a variable declared inside a - ``for`` loop is not accessible outside the loop itself: - - .. code-block:: twig - - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is NOT available #} - - If you want to access the variable, just declare it before the loop: - - .. code-block:: twig - - {% set foo = "" %} - {% for item in list %} - {% set foo = item %} - {% endfor %} - - {# foo is available #} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/use.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/use.rst deleted file mode 100644 index 2aca6a01..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/use.rst +++ /dev/null @@ -1,117 +0,0 @@ -``use`` -======= - -.. note:: - - Horizontal reuse is an advanced Twig feature that is hardly ever needed in - regular templates. It is mainly used by projects that need to make - template blocks reusable without using inheritance. - -Template inheritance is one of the most powerful features of Twig but it is -limited to single inheritance; a template can only extend one other template. -This limitation makes template inheritance simple to understand and easy to -debug: - -.. code-block:: twig - - {% extends "base.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -Horizontal reuse is a way to achieve the same goal as multiple inheritance, -but without the associated complexity: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -The ``use`` statement tells Twig to import the blocks defined in -``blocks.html`` into the current template (it's like macros, but for blocks): - -.. code-block:: twig - - {# blocks.html #} - - {% block sidebar %}{% endblock %} - -In this example, the ``use`` statement imports the ``sidebar`` block into the -main template. The code is mostly equivalent to the following one (the -imported blocks are not outputted automatically): - -.. code-block:: twig - - {% extends "base.html" %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -.. note:: - - The ``use`` tag only imports a template if it does not extend another - template, if it does not define macros, and if the body is empty. But it - can *use* other templates. - -.. note:: - - Because ``use`` statements are resolved independently of the context - passed to the template, the template reference cannot be an expression. - -The main template can also override any imported block. If the template -already defines the ``sidebar`` block, then the one defined in ``blocks.html`` -is ignored. To avoid name conflicts, you can rename imported blocks: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as base_sidebar, title as base_title %} - - {% block sidebar %}{% endblock %} - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -The ``parent()`` function automatically determines the correct inheritance -tree, so it can be used when overriding a block defined in an imported -template: - -.. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" %} - - {% block sidebar %} - {{ parent() }} - {% endblock %} - - {% block title %}{% endblock %} - {% block content %}{% endblock %} - -In this example, ``parent()`` will correctly call the ``sidebar`` block from -the ``blocks.html`` template. - -.. tip:: - - Renaming allows you to simulate inheritance by calling the "parent" block: - - .. code-block:: twig - - {% extends "base.html" %} - - {% use "blocks.html" with sidebar as parent_sidebar %} - - {% block sidebar %} - {{ block('parent_sidebar') }} - {% endblock %} - -.. note:: - - You can use as many ``use`` statements as you want in any given template. - If two imported templates define the same block, the latest one wins. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/verbatim.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/verbatim.rst deleted file mode 100644 index 3d7115a6..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/verbatim.rst +++ /dev/null @@ -1,16 +0,0 @@ -``verbatim`` -============ - -The ``verbatim`` tag marks sections as being raw text that should not be -parsed. For example to put Twig syntax as example into a template you can use -this snippet: - -.. code-block:: html+twig - - {% verbatim %} - <ul> - {% for item in seq %} - <li>{{ item }}</li> - {% endfor %} - </ul> - {% endverbatim %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tags/with.rst b/data/web/inc/lib/vendor/twig/twig/doc/tags/with.rst deleted file mode 100644 index 107432f6..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tags/with.rst +++ /dev/null @@ -1,41 +0,0 @@ -``with`` -======== - -Use the ``with`` tag to create a new inner scope. Variables set within this -scope are not visible outside of the scope: - -.. code-block:: twig - - {% with %} - {% set foo = 42 %} - {{ foo }} {# foo is 42 here #} - {% endwith %} - foo is not visible here any longer - -Instead of defining variables at the beginning of the scope, you can pass a -hash of variables you want to define in the ``with`` tag; the previous example -is equivalent to the following one: - -.. code-block:: twig - - {% with { foo: 42 } %} - {{ foo }} {# foo is 42 here #} - {% endwith %} - foo is not visible here any longer - - {# it works with any expression that resolves to a hash #} - {% set vars = { foo: 42 } %} - {% with vars %} - ... - {% endwith %} - -By default, the inner scope has access to the outer scope context; you can -disable this behavior by appending the ``only`` keyword: - -.. code-block:: twig - - {% set bar = 'bar' %} - {% with { foo: 42 } only %} - {# only foo is defined #} - {# bar is not defined #} - {% endwith %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/templates.rst b/data/web/inc/lib/vendor/twig/twig/doc/templates.rst deleted file mode 100644 index 2a8f3804..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/templates.rst +++ /dev/null @@ -1,859 +0,0 @@ -Twig for Template Designers -=========================== - -This document describes the syntax and semantics of the template engine and -will be most useful as reference to those creating Twig templates. - -Synopsis --------- - -A template is a regular text file. It can generate any text-based format (HTML, -XML, CSV, LaTeX, etc.). It doesn't have a specific extension, ``.html`` or -``.xml`` are just fine. - -A template contains **variables** or **expressions**, which get replaced with -values when the template is evaluated, and **tags**, which control the -template's logic. - -Below is a minimal template that illustrates a few basics. We will cover further -details later on: - -.. code-block:: html+twig - - <!DOCTYPE html> - <html> - <head> - <title>My Webpage</title> - </head> - <body> - <ul id="navigation"> - {% for item in navigation %} - <li><a href="{{ item.href }}">{{ item.caption }}</a></li> - {% endfor %} - </ul> - - <h1>My Webpage</h1> - {{ a_variable }} - </body> - </html> - -There are two kinds of delimiters: ``{% ... %}`` and ``{{ ... }}``. The first -one is used to execute statements such as for-loops, the latter outputs the -result of an expression. - -IDEs Integration ----------------- - -Many IDEs support syntax highlighting and auto-completion for Twig: - -* *Textmate* via the `Twig bundle`_ -* *Vim* via the `Jinja syntax plugin`_ or the `vim-twig plugin`_ -* *Netbeans* via the `Twig syntax plugin`_ (until 7.1, native as of 7.2) -* *PhpStorm* (native as of 2.1) -* *Eclipse* via the `Twig plugin`_ -* *Sublime Text* via the `Twig bundle`_ -* *GtkSourceView* via the `Twig language definition`_ (used by gedit and other projects) -* *Coda* and *SubEthaEdit* via the `Twig syntax mode`_ -* *Coda 2* via the `other Twig syntax mode`_ -* *Komodo* and *Komodo Edit* via the Twig highlight/syntax check mode -* *Notepad++* via the `Notepad++ Twig Highlighter`_ -* *Emacs* via `web-mode.el`_ -* *Atom* via the `PHP-twig for atom`_ -* *Visual Studio Code* via the `Twig pack`_ - -Also, `TwigFiddle`_ is an online service that allows you to execute Twig templates -from a browser; it supports all versions of Twig. - -Variables ---------- - -The application passes variables to the templates for manipulation in the -template. Variables may have attributes or elements you can access, too. The -visual representation of a variable depends heavily on the application providing -it. - -Use a dot (``.``) to access attributes of a variable (methods or properties of a -PHP object, or items of a PHP array): - -.. code-block:: twig - - {{ foo.bar }} - -.. note:: - - It's important to know that the curly braces are *not* part of the - variable but the print statement. When accessing variables inside tags, - don't put the braces around them. - -.. sidebar:: Implementation - - For convenience's sake ``foo.bar`` does the following things on the PHP - layer: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid property; - * if not, and if ``foo`` is an object, check that ``bar`` is a valid method - (even if ``bar`` is the constructor - use ``__construct()`` instead); - * if not, and if ``foo`` is an object, check that ``getBar`` is a valid method; - * if not, and if ``foo`` is an object, check that ``isBar`` is a valid method; - * if not, and if ``foo`` is an object, check that ``hasBar`` is a valid method; - * if not, return a ``null`` value. - - Twig also supports a specific syntax for accessing items on PHP arrays, - ``foo['bar']``: - - * check if ``foo`` is an array and ``bar`` a valid element; - * if not, return a ``null`` value. - -If a variable or attribute does not exist, you will receive a ``null`` value -when the ``strict_variables`` option is set to ``false``; alternatively, if ``strict_variables`` -is set, Twig will throw an error (see :ref:`environment options<environment_options>`). - -.. note:: - - If you want to access a dynamic attribute of a variable, use the - :doc:`attribute<functions/attribute>` function instead. - - The ``attribute`` function is also useful when the attribute contains - special characters (like ``-`` that would be interpreted as the minus - operator): - - .. code-block:: twig - - {# equivalent to the non-working foo.data-foo #} - {{ attribute(foo, 'data-foo') }} - -Global Variables -~~~~~~~~~~~~~~~~ - -The following variables are always available in templates: - -* ``_self``: references the current template name; -* ``_context``: references the current context; -* ``_charset``: references the current charset. - -Setting Variables -~~~~~~~~~~~~~~~~~ - -You can assign values to variables inside code blocks. Assignments use the -:doc:`set<tags/set>` tag: - -.. code-block:: twig - - {% set foo = 'foo' %} - {% set foo = [1, 2] %} - {% set foo = {'foo': 'bar'} %} - -Filters -------- - -Variables can be modified by **filters**. Filters are separated from the -variable by a pipe symbol (``|``). Multiple filters can be chained. The output -of one filter is applied to the next. - -The following example removes all HTML tags from the ``name`` and title-cases -it: - -.. code-block:: twig - - {{ name|striptags|title }} - -Filters that accept arguments have parentheses around the arguments. This -example joins the elements of a list by commas: - -.. code-block:: twig - - {{ list|join(', ') }} - -To apply a filter on a section of code, wrap it with the -:doc:`apply<tags/apply>` tag: - -.. code-block:: twig - - {% apply upper %} - This text becomes uppercase - {% endapply %} - -Go to the :doc:`filters<filters/index>` page to learn more about built-in -filters. - -Functions ---------- - -Functions can be called to generate content. Functions are called by their -name followed by parentheses (``()``) and may have arguments. - -For instance, the ``range`` function returns a list containing an arithmetic -progression of integers: - -.. code-block:: twig - - {% for i in range(0, 3) %} - {{ i }}, - {% endfor %} - -Go to the :doc:`functions<functions/index>` page to learn more about the -built-in functions. - -.. _named-arguments: - -Named Arguments ---------------- - -.. code-block:: twig - - {% for i in range(low=1, high=10, step=2) %} - {{ i }}, - {% endfor %} - -Using named arguments makes your templates more explicit about the meaning of -the values you pass as arguments: - -.. code-block:: twig - - {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }} - - {# versus #} - - {{ data|convert_encoding(from='iso-2022-jp', to='UTF-8') }} - -Named arguments also allow you to skip some arguments for which you don't want -to change the default value: - -.. code-block:: twig - - {# the first argument is the date format, which defaults to the global date format if null is passed #} - {{ "now"|date(null, "Europe/Paris") }} - - {# or skip the format value by using a named argument for the time zone #} - {{ "now"|date(timezone="Europe/Paris") }} - -You can also use both positional and named arguments in one call, in which -case positional arguments must always come before named arguments: - -.. code-block:: twig - - {{ "now"|date('d/m/Y H:i', timezone="Europe/Paris") }} - -.. tip:: - - Each function and filter documentation page has a section where the names - of all arguments are listed when supported. - -Control Structure ------------------ - -A control structure refers to all those things that control the flow of a -program - conditionals (i.e. ``if``/``elseif``/``else``), ``for``-loops, as -well as things like blocks. Control structures appear inside ``{% ... %}`` -blocks. - -For example, to display a list of users provided in a variable called -``users``, use the :doc:`for<tags/for>` tag: - -.. code-block:: html+twig - - <h1>Members</h1> - <ul> - {% for user in users %} - <li>{{ user.username|e }}</li> - {% endfor %} - </ul> - -The :doc:`if<tags/if>` tag can be used to test an expression: - -.. code-block:: html+twig - - {% if users|length > 0 %} - <ul> - {% for user in users %} - <li>{{ user.username|e }}</li> - {% endfor %} - </ul> - {% endif %} - -Go to the :doc:`tags<tags/index>` page to learn more about the built-in tags. - -Comments --------- - -To comment-out part of a line in a template, use the comment syntax ``{# ... -#}``. This is useful for debugging or to add information for other template -designers or yourself: - -.. code-block:: twig - - {# note: disabled template because we no longer use this - {% for user in users %} - ... - {% endfor %} - #} - -Including other Templates -------------------------- - -The :doc:`include<functions/include>` function is useful to include a template -and return the rendered content of that template into the current one: - -.. code-block:: twig - - {{ include('sidebar.html') }} - -By default, included templates have access to the same context as the template -which includes them. This means that any variable defined in the main template -will be available in the included template too: - -.. code-block:: twig - - {% for box in boxes %} - {{ include('render_box.html') }} - {% endfor %} - -The included template ``render_box.html`` is able to access the ``box`` variable. - -The name of the template depends on the template loader. For instance, the -``\Twig\Loader\FilesystemLoader`` allows you to access other templates by giving the -filename. You can access templates in subdirectories with a slash: - -.. code-block:: twig - - {{ include('sections/articles/sidebar.html') }} - -This behavior depends on the application embedding Twig. - -Template Inheritance --------------------- - -The most powerful part of Twig is template inheritance. Template inheritance -allows you to build a base "skeleton" template that contains all the common -elements of your site and defines **blocks** that child templates can -override. - -It's easier to understand the concept by starting with an example. - -Let's define a base template, ``base.html``, which defines an HTML skeleton -document that might be used for a two-column page: - -.. code-block:: html+twig - - <!DOCTYPE html> - <html> - <head> - {% block head %} - <link rel="stylesheet" href="style.css"/> - <title>{% block title %}{% endblock %} - My Webpage</title> - {% endblock %} - </head> - <body> - <div id="content">{% block content %}{% endblock %}</div> - <div id="footer"> - {% block footer %} - © Copyright 2011 by <a href="http://domain.invalid/">you</a>. - {% endblock %} - </div> - </body> - </html> - -In this example, the :doc:`block<tags/block>` tags define four blocks that -child templates can fill in. All the ``block`` tag does is to tell the -template engine that a child template may override those portions of the -template. - -A child template might look like this: - -.. code-block:: html+twig - - {% extends "base.html" %} - - {% block title %}Index{% endblock %} - {% block head %} - {{ parent() }} - <style type="text/css"> - .important { color: #336699; } - </style> - {% endblock %} - {% block content %} - <h1>Index</h1> - <p class="important"> - Welcome to my awesome homepage. - </p> - {% endblock %} - -The :doc:`extends<tags/extends>` tag is the key here. It tells the template -engine that this template "extends" another template. When the template system -evaluates this template, first it locates the parent. The extends tag should -be the first tag in the template. - -Note that since the child template doesn't define the ``footer`` block, the -value from the parent template is used instead. - -It's possible to render the contents of the parent block by using the -:doc:`parent<functions/parent>` function. This gives back the results of the -parent block: - -.. code-block:: html+twig - - {% block sidebar %} - <h3>Table Of Contents</h3> - ... - {{ parent() }} - {% endblock %} - -.. tip:: - - The documentation page for the :doc:`extends<tags/extends>` tag describes - more advanced features like block nesting, scope, dynamic inheritance, and - conditional inheritance. - -.. note:: - - Twig also supports multiple inheritance via "horizontal reuse" with the help - of the :doc:`use<tags/use>` tag. - -HTML Escaping -------------- - -When generating HTML from templates, there's always a risk that a variable -will include characters that affect the resulting HTML. There are two -approaches: manually escaping each variable or automatically escaping -everything by default. - -Twig supports both, automatic escaping is enabled by default. - -The automatic escaping strategy can be configured via the -:ref:`autoescape<environment_options>` option and defaults to ``html``. - -Working with Manual Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If manual escaping is enabled, it is **your** responsibility to escape variables -if needed. What to escape? Any variable that comes from an untrusted source. - -Escaping works by using the :doc:`escape<filters/escape>` or ``e`` filter: - -.. code-block:: twig - - {{ user.username|e }} - -By default, the ``escape`` filter uses the ``html`` strategy, but depending on -the escaping context, you might want to explicitly use an other strategy: - -.. code-block:: twig - - {{ user.username|e('js') }} - {{ user.username|e('css') }} - {{ user.username|e('url') }} - {{ user.username|e('html_attr') }} - -Working with Automatic Escaping -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Whether automatic escaping is enabled or not, you can mark a section of a -template to be escaped or not by using the :doc:`autoescape<tags/autoescape>` -tag: - -.. code-block:: twig - - {% autoescape %} - Everything will be automatically escaped in this block (using the HTML strategy) - {% endautoescape %} - -By default, auto-escaping uses the ``html`` escaping strategy. If you output -variables in other contexts, you need to explicitly escape them with the -appropriate escaping strategy: - -.. code-block:: twig - - {% autoescape 'js' %} - Everything will be automatically escaped in this block (using the JS strategy) - {% endautoescape %} - -Escaping --------- - -It is sometimes desirable or even necessary to have Twig ignore parts it would -otherwise handle as variables or blocks. For example if the default syntax is -used and you want to use ``{{`` as raw string in the template and not start a -variable you have to use a trick. - -The easiest way is to output the variable delimiter (``{{``) by using a variable -expression: - -.. code-block:: twig - - {{ '{{' }} - -For bigger sections it makes sense to mark a block -:doc:`verbatim<tags/verbatim>`. - -Macros ------- - -Macros are comparable with functions in regular programming languages. They are -useful to reuse HTML fragments to not repeat yourself. They are described in the -:doc:`macro<tags/macro>` tag documentation. - -.. _twig-expressions: - -Expressions ------------ - -Twig allows expressions everywhere. - -.. note:: - - The operator precedence is as follows, with the lowest-precedence operators - listed first: ``?:`` (ternary operator), ``b-and``, ``b-xor``, ``b-or``, - ``or``, ``and``, ``==``, ``!=``, ``<=>``, ``<``, ``>``, ``>=``, ``<=``, - ``in``, ``matches``, ``starts with``, ``ends with``, ``..``, ``+``, ``-``, - ``~``, ``*``, ``/``, ``//``, ``%``, ``is`` (tests), ``**``, ``??``, ``|`` - (filters), ``[]``, and ``.``: - - .. code-block:: twig - - {% set greeting = 'Hello ' %} - {% set name = 'Fabien' %} - - {{ greeting ~ name|lower }} {# Hello fabien #} - - {# use parenthesis to change precedence #} - {{ (greeting ~ name)|lower }} {# hello fabien #} - -Literals -~~~~~~~~ - -The simplest form of expressions are literals. Literals are representations -for PHP types such as strings, numbers, and arrays. The following literals -exist: - -* ``"Hello World"``: Everything between two double or single quotes is a - string. They are useful whenever you need a string in the template (for - example as arguments to function calls, filters or just to extend or include - a template). A string can contain a delimiter if it is preceded by a - backslash (``\``) -- like in ``'It\'s good'``. If the string contains a - backslash (e.g. ``'c:\Program Files'``) escape it by doubling it - (e.g. ``'c:\\Program Files'``). - -* ``42`` / ``42.23``: Integers and floating point numbers are created by - writing the number down. If a dot is present the number is a float, - otherwise an integer. - -* ``["foo", "bar"]``: Arrays are defined by a sequence of expressions - separated by a comma (``,``) and wrapped with squared brackets (``[]``). - -* ``{"foo": "bar"}``: Hashes are defined by a list of keys and values - separated by a comma (``,``) and wrapped with curly braces (``{}``): - - .. code-block:: twig - - {# keys as string #} - { 'foo': 'foo', 'bar': 'bar' } - - {# keys as names (equivalent to the previous hash) #} - { foo: 'foo', bar: 'bar' } - - {# keys as integer #} - { 2: 'foo', 4: 'bar' } - - {# keys can be omitted if it is the same as the variable name #} - { foo } - {# is equivalent to the following #} - { 'foo': foo } - - {# keys as expressions (the expression must be enclosed into parentheses) #} - {% set foo = 'foo' %} - { (foo): 'foo', (1 + 1): 'bar', (foo ~ 'b'): 'baz' } - -* ``true`` / ``false``: ``true`` represents the true value, ``false`` - represents the false value. - -* ``null``: ``null`` represents no specific value. This is the value returned - when a variable does not exist. ``none`` is an alias for ``null``. - -Arrays and hashes can be nested: - -.. code-block:: twig - - {% set foo = [1, {"foo": "bar"}] %} - -.. tip:: - - Using double-quoted or single-quoted strings has no impact on performance - but :ref:`string interpolation <templates-string-interpolation>` is only - supported in double-quoted strings. - -Math -~~~~ - -Twig allows you to do math in templates; the following operators are supported: - -* ``+``: Adds two numbers together (the operands are casted to numbers). ``{{ - 1 + 1 }}`` is ``2``. - -* ``-``: Subtracts the second number from the first one. ``{{ 3 - 2 }}`` is - ``1``. - -* ``/``: Divides two numbers. The returned value will be a floating point - number. ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``. - -* ``%``: Calculates the remainder of an integer division. ``{{ 11 % 7 }}`` is - ``4``. - -* ``//``: Divides two numbers and returns the floored integer result. ``{{ 20 - // 7 }}`` is ``2``, ``{{ -20 // 7 }}`` is ``-3`` (this is just syntactic - sugar for the :doc:`round<filters/round>` filter). - -* ``*``: Multiplies the left operand with the right one. ``{{ 2 * 2 }}`` would - return ``4``. - -* ``**``: Raises the left operand to the power of the right operand. ``{{ 2 ** - 3 }}`` would return ``8``. - -.. _template_logic: - -Logic -~~~~~ - -You can combine multiple expressions with the following operators: - -* ``and``: Returns true if the left and the right operands are both true. - -* ``or``: Returns true if the left or the right operand is true. - -* ``not``: Negates a statement. - -* ``(expr)``: Groups an expression. - -.. note:: - - Twig also supports bitwise operators (``b-and``, ``b-xor``, and ``b-or``). - -.. note:: - - Operators are case sensitive. - -Comparisons -~~~~~~~~~~~ - -The following comparison operators are supported in any expression: ``==``, -``!=``, ``<``, ``>``, ``>=``, and ``<=``. - -You can also check if a string ``starts with`` or ``ends with`` another -string: - -.. code-block:: twig - - {% if 'Fabien' starts with 'F' %} - {% endif %} - - {% if 'Fabien' ends with 'n' %} - {% endif %} - -.. note:: - - For complex string comparisons, the ``matches`` operator allows you to use - `regular expressions`_: - - .. code-block:: twig - - {% if phone matches '/^[\\d\\.]+$/' %} - {% endif %} - -Containment Operator -~~~~~~~~~~~~~~~~~~~~ - -The ``in`` operator performs containment test. It returns ``true`` if the left -operand is contained in the right: - -.. code-block:: twig - - {# returns true #} - - {{ 1 in [1, 2, 3] }} - - {{ 'cd' in 'abcde' }} - -.. tip:: - - You can use this filter to perform a containment test on strings, arrays, - or objects implementing the ``Traversable`` interface. - -To perform a negative test, use the ``not in`` operator: - -.. code-block:: twig - - {% if 1 not in [1, 2, 3] %} - - {# is equivalent to #} - {% if not (1 in [1, 2, 3]) %} - -Test Operator -~~~~~~~~~~~~~ - -The ``is`` operator performs tests. Tests can be used to test a variable against -a common expression. The right operand is name of the test: - -.. code-block:: twig - - {# find out if a variable is odd #} - - {{ name is odd }} - -Tests can accept arguments too: - -.. code-block:: twig - - {% if post.status is constant('Post::PUBLISHED') %} - -Tests can be negated by using the ``is not`` operator: - -.. code-block:: twig - - {% if post.status is not constant('Post::PUBLISHED') %} - - {# is equivalent to #} - {% if not (post.status is constant('Post::PUBLISHED')) %} - -Go to the :doc:`tests<tests/index>` page to learn more about the built-in -tests. - -Other Operators -~~~~~~~~~~~~~~~ - -The following operators don't fit into any of the other categories: - -* ``|``: Applies a filter. - -* ``..``: Creates a sequence based on the operand before and after the operator - (this is syntactic sugar for the :doc:`range<functions/range>` function): - - .. code-block:: twig - - {{ 1..5 }} - - {# equivalent to #} - {{ range(1, 5) }} - - Note that you must use parentheses when combining it with the filter operator - due to the :ref:`operator precedence rules <twig-expressions>`: - - .. code-block:: twig - - (1..5)|join(', ') - -* ``~``: Converts all operands into strings and concatenates them. ``{{ "Hello - " ~ name ~ "!" }}`` would return (assuming ``name`` is ``'John'``) ``Hello - John!``. - -* ``.``, ``[]``: Gets an attribute of a variable. - -* ``?:``: The ternary operator: - - .. code-block:: twig - - {{ foo ? 'yes' : 'no' }} - {{ foo ?: 'no' }} is the same as {{ foo ? foo : 'no' }} - {{ foo ? 'yes' }} is the same as {{ foo ? 'yes' : '' }} - -* ``??``: The null-coalescing operator: - - .. code-block:: twig - - {# returns the value of foo if it is defined and not null, 'no' otherwise #} - {{ foo ?? 'no' }} - -.. _templates-string-interpolation: - -String Interpolation -~~~~~~~~~~~~~~~~~~~~ - -String interpolation (``#{expression}``) allows any valid expression to appear -within a *double-quoted string*. The result of evaluating that expression is -inserted into the string: - -.. code-block:: twig - - {{ "foo #{bar} baz" }} - {{ "foo #{1 + 2} baz" }} - -.. _templates-whitespace-control: - -Whitespace Control ------------------- - -The first newline after a template tag is removed automatically (like in PHP). -Whitespace is not further modified by the template engine, so each whitespace -(spaces, tabs, newlines etc.) is returned unchanged. - -You can also control whitespace on a per tag level. By using the whitespace -control modifiers on your tags, you can trim leading and or trailing whitespace. - -Twig supports two modifiers: - -* *Whitespace trimming* via the ``-`` modifier: Removes all whitespace - (including newlines); - -* *Line whitespace trimming* via the ``~`` modifier: Removes all whitespace - (excluding newlines). Using this modifier on the right disables the default - removal of the first newline inherited from PHP. - -The modifiers can be used on either side of the tags like in ``{%-`` or ``-%}`` -and they consume all whitespace for that side of the tag. It is possible to use -the modifiers on one side of a tag or on both sides: - -.. code-block:: html+twig - - {% set value = 'no spaces' %} - {#- No leading/trailing whitespace -#} - {%- if true -%} - {{- value -}} - {%- endif -%} - {# output 'no spaces' #} - - <li> - {{ value }} </li> - {# outputs '<li>\n no spaces </li>' #} - - <li> - {{- value }} </li> - {# outputs '<li>no spaces </li>' #} - - <li> - {{~ value }} </li> - {# outputs '<li>\nno spaces </li>' #} - -.. tip:: - - In addition to the whitespace modifiers, Twig also has a ``spaceless`` filter - that removes whitespace **between HTML tags**: - - .. code-block:: html+twig - - {% apply spaceless %} - <div> - <strong>foo bar</strong> - </div> - {% endapply %} - - {# output will be <div><strong>foo bar</strong></div> #} - -Extensions ----------- - -Twig can be extended. If you want to create your own extensions, read the -:ref:`Creating an Extension <creating_extensions>` chapter. - -.. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle -.. _`Jinja syntax plugin`: http://jinja.pocoo.org/docs/integration/#vim -.. _`vim-twig plugin`: https://github.com/lumiliet/vim-twig -.. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig -.. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin -.. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language -.. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode -.. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode -.. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig -.. _`web-mode.el`: http://web-mode.org/ -.. _`regular expressions`: https://secure.php.net/manual/en/pcre.pattern.php -.. _`PHP-twig for atom`: https://github.com/reesef/php-twig -.. _`TwigFiddle`: https://twigfiddle.com/ -.. _`Twig pack`: https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/constant.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/constant.rst deleted file mode 100644 index 448c238b..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/constant.rst +++ /dev/null @@ -1,19 +0,0 @@ -``constant`` -============ - -``constant`` checks if a variable has the exact same value as a constant. You -can use either global constants or class constants: - -.. code-block:: twig - - {% if post.status is constant('Post::PUBLISHED') %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} - -You can test constants from object instances as well: - -.. code-block:: twig - - {% if post.status is constant('PUBLISHED', post) %} - the status attribute is exactly the same as Post::PUBLISHED - {% endif %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/defined.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/defined.rst deleted file mode 100644 index 234a2898..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/defined.rst +++ /dev/null @@ -1,30 +0,0 @@ -``defined`` -=========== - -``defined`` checks if a variable is defined in the current context. This is very -useful if you use the ``strict_variables`` option: - -.. code-block:: twig - - {# defined works with variable names #} - {% if foo is defined %} - ... - {% endif %} - - {# and attributes on variables names #} - {% if foo.bar is defined %} - ... - {% endif %} - - {% if foo['bar'] is defined %} - ... - {% endif %} - -When using the ``defined`` test on an expression that uses variables in some -method calls, be sure that they are all defined first: - -.. code-block:: twig - - {% if var is defined and foo.method(var) is defined %} - ... - {% endif %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/divisibleby.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/divisibleby.rst deleted file mode 100644 index 8032d349..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/divisibleby.rst +++ /dev/null @@ -1,10 +0,0 @@ -``divisible by`` -================ - -``divisible by`` checks if a variable is divisible by a number: - -.. code-block:: twig - - {% if loop.index is divisible by(3) %} - ... - {% endif %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/empty.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/empty.rst deleted file mode 100644 index 0233eca4..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/empty.rst +++ /dev/null @@ -1,18 +0,0 @@ -``empty`` -========= - -``empty`` checks if a variable is an empty string, an empty array, an empty -hash, exactly ``false``, or exactly ``null``. - -For objects that implement the ``Countable`` interface, ``empty`` will check the -return value of the ``count()`` method. - -For objects that implement the ``__toString()`` magic method (and not ``Countable``), -it will check if an empty string is returned. - -.. code-block:: twig - - {% if foo is empty %} - ... - {% endif %} - diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/even.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/even.rst deleted file mode 100644 index 2de0de2f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/even.rst +++ /dev/null @@ -1,12 +0,0 @@ -``even`` -======== - -``even`` returns ``true`` if the given number is even: - -.. code-block:: twig - - {{ var is even }} - -.. seealso:: - - :doc:`odd<../tests/odd>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/index.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/index.rst deleted file mode 100644 index c63208ee..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -Tests -===== - -.. toctree:: - :maxdepth: 1 - - constant - defined - divisibleby - empty - even - iterable - null - odd - sameas diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/iterable.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/iterable.rst deleted file mode 100644 index 4ebfe9d8..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/iterable.rst +++ /dev/null @@ -1,16 +0,0 @@ -``iterable`` -============ - -``iterable`` checks if a variable is an array or a traversable object: - -.. code-block:: twig - - {# evaluates to true if the foo variable is iterable #} - {% if users is iterable %} - {% for user in users %} - Hello {{ user }}! - {% endfor %} - {% else %} - {# users is probably a string #} - Hello {{ users }}! - {% endif %} diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/null.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/null.rst deleted file mode 100644 index 9ed93f6b..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/null.rst +++ /dev/null @@ -1,12 +0,0 @@ -``null`` -======== - -``null`` returns ``true`` if the variable is ``null``: - -.. code-block:: twig - - {{ var is null }} - -.. note:: - - ``none`` is an alias for ``null``. diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/odd.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/odd.rst deleted file mode 100644 index 27fe7e4d..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/odd.rst +++ /dev/null @@ -1,12 +0,0 @@ -``odd`` -======= - -``odd`` returns ``true`` if the given number is odd: - -.. code-block:: twig - - {{ var is odd }} - -.. seealso:: - - :doc:`even<../tests/even>` diff --git a/data/web/inc/lib/vendor/twig/twig/doc/tests/sameas.rst b/data/web/inc/lib/vendor/twig/twig/doc/tests/sameas.rst deleted file mode 100644 index c0929711..00000000 --- a/data/web/inc/lib/vendor/twig/twig/doc/tests/sameas.rst +++ /dev/null @@ -1,11 +0,0 @@ -``same as`` -=========== - -``same as`` checks if a variable is the same as another variable. -This is equivalent to ``===`` in PHP: - -.. code-block:: twig - - {% if foo.attribute is same as(false) %} - the foo attribute really is the 'false' PHP value - {% endif %} diff --git a/data/web/inc/lib/vendor/twig/twig/drupal_test.sh b/data/web/inc/lib/vendor/twig/twig/drupal_test.sh deleted file mode 100755 index a25d886f..00000000 --- a/data/web/inc/lib/vendor/twig/twig/drupal_test.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -set -x -set -e - -REPO=`pwd` -cd /tmp -rm -rf drupal-twig-test -composer create-project --no-interaction drupal/recommended-project:9.1.x-dev drupal-twig-test -cd drupal-twig-test -(cd vendor/twig && rm -rf twig && ln -sf $REPO twig) -php ./web/core/scripts/drupal install --no-interaction demo_umami > output -perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output -source output -#echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php - -wget https://get.symfony.com/cli/installer -O - | bash -export PATH="$HOME/.symfony/bin:$PATH" -symfony server:start -d --no-tls - -curl -OLsS https://get.blackfire.io/blackfire-player.phar -chmod +x blackfire-player.phar -cat > drupal-tests.bkf <<EOF -name "Drupal tests" - -scenario - name "homepage" - set name "admin" - set pass "pass" - - visit url('/') - expect status_code() == 200 - click link('Articles') - expect status_code() == 200 - click link('Dairy-free and delicious milk chocolate') - expect body() matches "/Dairy\-free milk chocolate is made in largely the same way as regular chocolate/" - expect status_code() == 200 - click link('Log in') - expect status_code() == 200 - submit button("Log in") - param name name - param pass pass - expect status_code() == 303 - follow - expect status_code() == 200 - click link('Structure') - expect status_code() == 200 -EOF -./blackfire-player.phar run drupal-tests.bkf --endpoint=`symfony var:export SYMFONY_DEFAULT_ROUTE_URL` --variable name=$DRUPAL_Username --variable pass=$DRUPAL_Password -symfony server:stop diff --git a/data/web/inc/lib/vendor/twig/twig/src/Cache/FilesystemCache.php b/data/web/inc/lib/vendor/twig/twig/src/Cache/FilesystemCache.php index a9f1f466..e075563a 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Cache/FilesystemCache.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Cache/FilesystemCache.php @@ -31,7 +31,7 @@ class FilesystemCache implements CacheInterface public function generateKey(string $name, string $className): string { - $hash = hash('sha256', $className); + $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $className); return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php'; } diff --git a/data/web/inc/lib/vendor/twig/twig/src/Compiler.php b/data/web/inc/lib/vendor/twig/twig/src/Compiler.php index b3f1eca3..95e1f183 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Compiler.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Compiler.php @@ -209,6 +209,6 @@ class Compiler public function getVarName(): string { - return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++)); + return sprintf('__internal_compile_%d', $this->varNameSalt++); } } diff --git a/data/web/inc/lib/vendor/twig/twig/src/Environment.php b/data/web/inc/lib/vendor/twig/twig/src/Environment.php index 889df493..ab5e5d02 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Environment.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Environment.php @@ -38,11 +38,11 @@ use Twig\TokenParser\TokenParserInterface; */ class Environment { - public const VERSION = '3.3.2'; - public const VERSION_ID = 30302; + public const VERSION = '3.3.8'; + public const VERSION_ID = 30308; public const MAJOR_VERSION = 3; public const MINOR_VERSION = 3; - public const RELEASE_VERSION = 2; + public const RELEASE_VERSION = 8; public const EXTRA_VERSION = ''; private $charset; @@ -260,7 +260,7 @@ class Environment { $key = $this->getLoader()->getCacheKey($name).$this->optionsHash; - return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '___'.$index); + return $this->templateClassPrefix.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $key).(null === $index ? '' : '___'.$index); } /** @@ -382,7 +382,7 @@ class Environment */ public function createTemplate(string $template, string $name = null): TemplateWrapper { - $hash = hash('sha256', $template, false); + $hash = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $template, false); if (null !== $name) { $name = sprintf('%s (string template %s)', $name, $hash); } else { @@ -433,11 +433,20 @@ class Environment return $this->load($names); } + $count = \count($names); foreach ($names as $name) { - try { - return $this->load($name); - } catch (LoaderError $e) { + if ($name instanceof Template) { + return $name; } + if ($name instanceof TemplateWrapper) { + return $name; + } + + if (1 !== $count && !$this->getLoader()->exists($name)) { + continue; + } + + return $this->load($name); } throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); @@ -548,6 +557,13 @@ class Environment $this->runtimeLoaders[] = $loader; } + /** + * @template TExtension of ExtensionInterface + * + * @param class-string<TExtension> $class + * + * @return TExtension + */ public function getExtension(string $class): ExtensionInterface { return $this->extensionSet->getExtension($class); @@ -556,9 +572,11 @@ class Environment /** * Returns the runtime implementation of a Twig element (filter/function/tag/test). * - * @param string $class A runtime class name + * @template TRuntime of object * - * @return object The runtime implementation + * @param class-string<TRuntime> $class A runtime class name + * + * @return TRuntime The runtime implementation * * @throws RuntimeError When the template cannot be found */ diff --git a/data/web/inc/lib/vendor/twig/twig/src/Extension/CoreExtension.php b/data/web/inc/lib/vendor/twig/twig/src/Extension/CoreExtension.php index a967fd1b..88cd7545 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Extension/CoreExtension.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Extension/CoreExtension.php @@ -177,7 +177,7 @@ final class CoreExtension extends AbstractExtension // formatting filters new TwigFilter('date', 'twig_date_format_filter', ['needs_environment' => true]), new TwigFilter('date_modify', 'twig_date_modify_filter', ['needs_environment' => true]), - new TwigFilter('format', 'sprintf'), + new TwigFilter('format', 'twig_sprintf'), new TwigFilter('replace', 'twig_replace_filter'), new TwigFilter('number_format', 'twig_number_format_filter', ['needs_environment' => true]), new TwigFilter('abs', 'abs'), @@ -193,15 +193,15 @@ final class CoreExtension extends AbstractExtension new TwigFilter('capitalize', 'twig_capitalize_string_filter', ['needs_environment' => true]), new TwigFilter('upper', 'twig_upper_filter', ['needs_environment' => true]), new TwigFilter('lower', 'twig_lower_filter', ['needs_environment' => true]), - new TwigFilter('striptags', 'strip_tags'), + new TwigFilter('striptags', 'twig_striptags'), new TwigFilter('trim', 'twig_trim_filter'), - new TwigFilter('nl2br', 'nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), + new TwigFilter('nl2br', 'twig_nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), new TwigFilter('spaceless', 'twig_spaceless', ['is_safe' => ['html']]), // array helpers new TwigFilter('join', 'twig_join_filter'), new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]), - new TwigFilter('sort', 'twig_sort_filter'), + new TwigFilter('sort', 'twig_sort_filter', ['needs_environment' => true]), new TwigFilter('merge', 'twig_array_merge'), new TwigFilter('batch', 'twig_array_batch'), new TwigFilter('column', 'twig_array_column'), @@ -346,7 +346,7 @@ function twig_cycle($values, $position) function twig_random(Environment $env, $values = null, $max = null) { if (null === $values) { - return null === $max ? mt_rand() : mt_rand(0, $max); + return null === $max ? mt_rand() : mt_rand(0, (int) $max); } if (\is_int($values) || \is_float($values)) { @@ -363,7 +363,7 @@ function twig_random(Environment $env, $values = null, $max = null) $max = $max; } - return mt_rand($min, $max); + return mt_rand((int) $min, (int) $max); } if (\is_string($values)) { @@ -443,6 +443,19 @@ function twig_date_modify_filter(Environment $env, $date, $modifier) return $date->modify($modifier); } +/** + * Returns a formatted string. + * + * @param string|null $format + * @param ...$values + * + * @return string + */ +function twig_sprintf($format, ...$values) +{ + return sprintf($format ?? '', ...$values); +} + /** * Converts an input to a \DateTime instance. * @@ -505,7 +518,7 @@ function twig_date_converter(Environment $env, $date = null, $timezone = null) /** * Replaces strings within a string. * - * @param string $str String to replace in + * @param string|null $str String to replace in * @param array|\Traversable $from Replace values * * @return string @@ -516,20 +529,22 @@ function twig_replace_filter($str, $from) throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from))); } - return strtr($str, twig_to_array($from)); + return strtr($str ?? '', twig_to_array($from)); } /** * Rounds a number. * - * @param int|float $value The value to round - * @param int|float $precision The rounding precision - * @param string $method The method to use for rounding + * @param int|float|string|null $value The value to round + * @param int|float $precision The rounding precision + * @param string $method The method to use for rounding * * @return int|float The rounded number */ function twig_round($value, $precision = 0, $method = 'common') { + $value = (float) $value; + if ('common' === $method) { return round($value, $precision); } @@ -545,7 +560,7 @@ function twig_round($value, $precision = 0, $method = 'common') * Number format filter. * * All of the formatting options can be left null, in that case the defaults will - * be used. Supplying any of the parameters will override the defaults set in the + * be used. Supplying any of the parameters will override the defaults set in the * environment object. * * @param mixed $number A float/int/string of the number to format @@ -576,7 +591,7 @@ function twig_number_format_filter(Environment $env, $number, $decimal = null, $ /** * URL encodes (RFC 3986) a string as a path segment or an array as a query string. * - * @param string|array $url A URL or an array of query parameters + * @param string|array|null $url A URL or an array of query parameters * * @return string The URL encoded value */ @@ -586,7 +601,7 @@ function twig_urlencode_filter($url) return http_build_query($url, '', '&', \PHP_QUERY_RFC3986); } - return rawurlencode($url); + return rawurlencode($url ?? ''); } /** @@ -648,9 +663,7 @@ function twig_slice(Environment $env, $item, $start, $length = null, $preserveKe return \array_slice($item, $start, $length, $preserveKeys); } - $item = (string) $item; - - return mb_substr($item, $start, $length, $env->getCharset()); + return (string) mb_substr((string) $item, $start, $length, $env->getCharset()); } /** @@ -739,14 +752,16 @@ function twig_join_filter($value, $glue = '', $and = null) * {{ "aabbcc"|split('', 2) }} * {# returns [aa, bb, cc] #} * - * @param string $value A string - * @param string $delimiter The delimiter - * @param int $limit The limit + * @param string|null $value A string + * @param string $delimiter The delimiter + * @param int $limit The limit * * @return array The split string as an array */ function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) { + $value = $value ?? ''; + if (\strlen($delimiter) > 0) { return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); } @@ -831,8 +846,8 @@ function twig_get_array_keys_filter($array) /** * Reverses a variable. * - * @param array|\Traversable|string $item An array, a \Traversable instance, or a string - * @param bool $preserveKeys Whether to preserve key or not + * @param array|\Traversable|string|null $item An array, a \Traversable instance, or a string + * @param bool $preserveKeys Whether to preserve key or not * * @return mixed The reversed input */ @@ -851,10 +866,10 @@ function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) $charset = $env->getCharset(); if ('UTF-8' !== $charset) { - $item = twig_convert_encoding($string, 'UTF-8', $charset); + $string = twig_convert_encoding($string, 'UTF-8', $charset); } - preg_match_all('/./us', $item, $matches); + preg_match_all('/./us', $string, $matches); $string = implode('', array_reverse($matches[0])); @@ -872,7 +887,7 @@ function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) * * @return array */ -function twig_sort_filter($array, $arrow = null) +function twig_sort_filter(Environment $env, $array, $arrow = null) { if ($array instanceof \Traversable) { $array = iterator_to_array($array); @@ -881,6 +896,8 @@ function twig_sort_filter($array, $arrow = null) } if (null !== $arrow) { + twig_check_arrow_in_sandbox($env, $arrow, 'sort', 'filter'); + uasort($array, $arrow); } else { asort($array); @@ -1001,6 +1018,10 @@ function twig_compare($a, $b) /** * Returns a trimmed string. * + * @param string|null $string + * @param string|null $characterMask + * @param string $side + * * @return string * * @throws RuntimeError When an invalid trimming side is used (not a string or not 'left', 'right', or 'both') @@ -1013,33 +1034,54 @@ function twig_trim_filter($string, $characterMask = null, $side = 'both') switch ($side) { case 'both': - return trim($string, $characterMask); + return trim($string ?? '', $characterMask); case 'left': - return ltrim($string, $characterMask); + return ltrim($string ?? '', $characterMask); case 'right': - return rtrim($string, $characterMask); + return rtrim($string ?? '', $characterMask); default: throw new RuntimeError('Trimming side must be "left", "right" or "both".'); } } +/** + * Inserts HTML line breaks before all newlines in a string. + * + * @param string|null $string + * + * @return string + */ +function twig_nl2br($string) +{ + return nl2br($string ?? ''); +} + /** * Removes whitespaces between HTML tags. * + * @param string|null $string + * * @return string */ function twig_spaceless($content) { - return trim(preg_replace('/>\s+</', '><', $content)); + return trim(preg_replace('/>\s+</', '><', $content ?? '')); } +/** + * @param string|null $string + * @param string $to + * @param string $from + * + * @return string + */ function twig_convert_encoding($string, $to, $from) { if (!\function_exists('iconv')) { throw new RuntimeError('Unable to convert encoding: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.'); } - return iconv($from, $to, $string); + return iconv($from, $to, $string ?? ''); } /** @@ -1077,47 +1119,60 @@ function twig_length_filter(Environment $env, $thing) /** * Converts a string to uppercase. * - * @param string $string A string + * @param string|null $string A string * * @return string The uppercased string */ function twig_upper_filter(Environment $env, $string) { - return mb_strtoupper($string, $env->getCharset()); + return mb_strtoupper($string ?? '', $env->getCharset()); } /** * Converts a string to lowercase. * - * @param string $string A string + * @param string|null $string A string * * @return string The lowercased string */ function twig_lower_filter(Environment $env, $string) { - return mb_strtolower($string, $env->getCharset()); + return mb_strtolower($string ?? '', $env->getCharset()); +} + +/** + * Strips HTML and PHP tags from a string. + * + * @param string|null $string + * @param string[]|string|null $string + * + * @return string + */ +function twig_striptags($string, $allowable_tags = null) +{ + return strip_tags($string ?? '', $allowable_tags); } /** * Returns a titlecased string. * - * @param string $string A string + * @param string|null $string A string * * @return string The titlecased string */ function twig_title_string_filter(Environment $env, $string) { if (null !== $charset = $env->getCharset()) { - return mb_convert_case($string, \MB_CASE_TITLE, $charset); + return mb_convert_case($string ?? '', \MB_CASE_TITLE, $charset); } - return ucwords(strtolower($string)); + return ucwords(strtolower($string ?? '')); } /** * Returns a capitalized string. * - * @param string $string A string + * @param string|null $string A string * * @return string The capitalized string */ @@ -1125,7 +1180,7 @@ function twig_capitalize_string_filter(Environment $env, $string) { $charset = $env->getCharset(); - return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).mb_strtolower(mb_substr($string, 1, null, $charset), $charset); + return mb_strtoupper(mb_substr($string ?? '', 0, 1, $charset), $charset).mb_strtolower(mb_substr($string ?? '', 1, null, $charset), $charset); } /** @@ -1586,9 +1641,7 @@ function twig_array_filter(Environment $env, $array, $arrow) throw new RuntimeError(sprintf('The "filter" filter expects an array or "Traversable", got "%s".', \is_object($array) ? \get_class($array) : \gettype($array))); } - if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) { - throw new RuntimeError('The callable passed to "filter" filter must be a Closure in sandbox mode.'); - } + twig_check_arrow_in_sandbox($env, $arrow, 'filter', 'filter'); if (\is_array($array)) { return array_filter($array, $arrow, \ARRAY_FILTER_USE_BOTH); @@ -1600,9 +1653,7 @@ function twig_array_filter(Environment $env, $array, $arrow) function twig_array_map(Environment $env, $array, $arrow) { - if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) { - throw new RuntimeError('The callable passed to the "map" filter must be a Closure in sandbox mode.'); - } + twig_check_arrow_in_sandbox($env, $arrow, 'map', 'filter'); $r = []; foreach ($array as $k => $v) { @@ -1614,9 +1665,7 @@ function twig_array_map(Environment $env, $array, $arrow) function twig_array_reduce(Environment $env, $array, $arrow, $initial = null) { - if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) { - throw new RuntimeError('The callable passed to the "reduce" filter must be a Closure in sandbox mode.'); - } + twig_check_arrow_in_sandbox($env, $arrow, 'reduce', 'filter'); if (!\is_array($array)) { if (!$array instanceof \Traversable) { @@ -1628,4 +1677,11 @@ function twig_array_reduce(Environment $env, $array, $arrow, $initial = null) return array_reduce($array, $arrow, $initial); } + +function twig_check_arrow_in_sandbox(Environment $env, $arrow, $thing, $type) +{ + if (!$arrow instanceof Closure && $env->hasExtension('\Twig\Extension\SandboxExtension') && $env->getExtension('\Twig\Extension\SandboxExtension')->isSandboxed()) { + throw new RuntimeError(sprintf('The callable passed to the "%s" %s must be a Closure in sandbox mode.', $thing, $type)); + } +} } diff --git a/data/web/inc/lib/vendor/twig/twig/src/Extension/EscaperExtension.php b/data/web/inc/lib/vendor/twig/twig/src/Extension/EscaperExtension.php index 372551f2..72795da3 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Extension/EscaperExtension.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Extension/EscaperExtension.php @@ -206,7 +206,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char switch ($strategy) { case 'html': - // see https://secure.php.net/htmlspecialchars + // see https://www.php.net/htmlspecialchars // Using a static variable to avoid initializing the array // each time the function is called. Moving the declaration on the @@ -277,7 +277,7 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char return $shortMap[$char]; } - $codepoint = mb_ord($char); + $codepoint = mb_ord($char, 'UTF-8'); if (0x10000 > $codepoint) { return sprintf('\u%04X', $codepoint); } diff --git a/data/web/inc/lib/vendor/twig/twig/src/Markup.php b/data/web/inc/lib/vendor/twig/twig/src/Markup.php index c8c5e1a1..1788acc4 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Markup.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Markup.php @@ -35,11 +35,16 @@ class Markup implements \Countable, \JsonSerializable /** * @return int */ + #[\ReturnTypeWillChange] public function count() { return mb_strlen($this->content, $this->charset); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->content; diff --git a/data/web/inc/lib/vendor/twig/twig/src/Node/Node.php b/data/web/inc/lib/vendor/twig/twig/src/Node/Node.php index e974b497..c0558b9a 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Node/Node.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Node/Node.php @@ -148,6 +148,7 @@ class Node implements \Countable, \IteratorAggregate /** * @return int */ + #[\ReturnTypeWillChange] public function count() { return \count($this->nodes); diff --git a/data/web/inc/lib/vendor/twig/twig/src/Parser.php b/data/web/inc/lib/vendor/twig/twig/src/Parser.php index 6103695e..d0e77b35 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Parser.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Parser.php @@ -52,7 +52,7 @@ class Parser public function getVarName(): string { - return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->stream->getSourceContext()->getCode().$this->varNameSalt++)); + return sprintf('__internal_parse_%d', $this->varNameSalt++); } public function parse(TokenStream $stream, $test = null, bool $dropNeedle = false): ModuleNode diff --git a/data/web/inc/lib/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php b/data/web/inc/lib/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php index bd23b208..91abee80 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php @@ -28,10 +28,12 @@ use Twig\Profiler\Profile; final class ProfilerNodeVisitor implements NodeVisitorInterface { private $extensionName; + private $varName; public function __construct(string $extensionName) { $this->extensionName = $extensionName; + $this->varName = sprintf('__internal_%s', hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $extensionName)); } public function enterNode(Node $node, Environment $env): Node @@ -42,33 +44,25 @@ final class ProfilerNodeVisitor implements NodeVisitorInterface public function leaveNode(Node $node, Environment $env): ?Node { if ($node instanceof ModuleNode) { - $varName = $this->getVarName(); - $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $varName), $node->getNode('display_start')])); - $node->setNode('display_end', new Node([new LeaveProfileNode($varName), $node->getNode('display_end')])); + $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $this->varName), $node->getNode('display_start')])); + $node->setNode('display_end', new Node([new LeaveProfileNode($this->varName), $node->getNode('display_end')])); } elseif ($node instanceof BlockNode) { - $varName = $this->getVarName(); $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $varName), + new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $this->varName), $node->getNode('body'), - new LeaveProfileNode($varName), + new LeaveProfileNode($this->varName), ])); } elseif ($node instanceof MacroNode) { - $varName = $this->getVarName(); $node->setNode('body', new BodyNode([ - new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $varName), + new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $this->varName), $node->getNode('body'), - new LeaveProfileNode($varName), + new LeaveProfileNode($this->varName), ])); } return $node; } - private function getVarName(): string - { - return sprintf('__internal_%s', hash('sha256', $this->extensionName)); - } - public function getPriority(): int { return 0; diff --git a/data/web/inc/lib/vendor/twig/twig/src/Test/IntegrationTestCase.php b/data/web/inc/lib/vendor/twig/twig/src/Test/IntegrationTestCase.php index 7d7d5909..307302bb 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Test/IntegrationTestCase.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Test/IntegrationTestCase.php @@ -186,7 +186,7 @@ abstract class IntegrationTestCase extends TestCase // avoid using the same PHP class name for different cases $p = new \ReflectionProperty($twig, 'templateClassPrefix'); $p->setAccessible(true); - $p->setValue($twig, '__TwigTemplate_'.hash('sha256', uniqid(mt_rand(), true), false).'_'); + $p->setValue($twig, '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', uniqid(mt_rand(), true), false).'_'); $deprecations = []; try { diff --git a/data/web/inc/lib/vendor/twig/twig/src/Util/TemplateDirIterator.php b/data/web/inc/lib/vendor/twig/twig/src/Util/TemplateDirIterator.php index c7339fd7..3bef14be 100644 --- a/data/web/inc/lib/vendor/twig/twig/src/Util/TemplateDirIterator.php +++ b/data/web/inc/lib/vendor/twig/twig/src/Util/TemplateDirIterator.php @@ -16,11 +16,19 @@ namespace Twig\Util; */ class TemplateDirIterator extends \IteratorIterator { + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function current() { return file_get_contents(parent::current()); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function key() { return (string) parent::key(); diff --git a/generate_config.sh b/generate_config.sh index 6bef72ea..f2f444c5 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -365,10 +365,9 @@ cp -n -d data/assets/ssl-example/*.pem data/assets/ssl/ # Set app_info.inc.php mailcow_git_version=$(git describe --tags `git rev-list --tags --max-count=1`) if [ $? -eq 0 ]; then - mailcow_git_url=$(git config --get remote.origin.url) echo '<?php' > data/web/inc/app_info.inc.php echo ' $MAILCOW_GIT_VERSION="'$mailcow_git_version'";' >> data/web/inc/app_info.inc.php - echo ' $MAILCOW_GIT_URL="'$mailcow_git_url'";' >> data/web/inc/app_info.inc.php + echo ' $MAILCOW_GIT_URL="https://github.com/mailcow/mailcow-dockerized";' >> data/web/inc/app_info.inc.php echo '?>' >> data/web/inc/app_info.inc.php else echo '<?php' > data/web/inc/app_info.inc.php diff --git a/helper-scripts/backup_and_restore.sh b/helper-scripts/backup_and_restore.sh index 189a6607..9f7533ca 100755 --- a/helper-scripts/backup_and_restore.sh +++ b/helper-scripts/backup_and_restore.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -DEBIAN_DOCKER_IMAGE="debian:buster-slim" +DEBIAN_DOCKER_IMAGE="debian:bullseye-slim" if [[ ! -z ${MAILCOW_BACKUP_LOCATION} ]]; then BACKUP_LOCATION="${MAILCOW_BACKUP_LOCATION}" diff --git a/update.sh b/update.sh index 033aa140..2f336428 100755 --- a/update.sh +++ b/update.sh @@ -722,10 +722,9 @@ fi # Set app_info.inc.php mailcow_git_version=$(git describe --tags `git rev-list --tags --max-count=1`) if [ $? -eq 0 ]; then - mailcow_git_url=$(git config --get remote.origin.url) echo '<?php' > data/web/inc/app_info.inc.php echo ' $MAILCOW_GIT_VERSION="'$mailcow_git_version'";' >> data/web/inc/app_info.inc.php - echo ' $MAILCOW_GIT_URL="'$mailcow_git_url'";' >> data/web/inc/app_info.inc.php + echo ' $MAILCOW_GIT_URL="https://github.com/mailcow/mailcow-dockerized";' >> data/web/inc/app_info.inc.php echo '?>' >> data/web/inc/app_info.inc.php else echo '<?php' > data/web/inc/app_info.inc.php