From a193a80e4a5389e82b147c4d01d73da9d7d86b2e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 7 Sep 2024 11:21:17 +0100 Subject: [PATCH 001/717] 11.4.0 --- Core/lib/lang/call/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/lang/call/.php b/Core/lib/lang/call/.php index bcb58d7e1..4574082c0 100644 --- a/Core/lib/lang/call/.php +++ b/Core/lib/lang/call/.php @@ -72,7 +72,7 @@ function(string $n) use($p, $rp, $rfa, $isMethod) {return $rp->isOptional() ? $r "`df_call()`: the required argument `{$n}` of the `{$rfa->getName()}` %s is missed." ,$isMethod ? 'method' : 'function' ) - ,$p + ,['arguments' => $p] ); } );}) From 1f21946eaf784c1f0f230db4102038a94cb7a7bb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 8 Sep 2024 22:29:43 +0100 Subject: [PATCH 002/717] https://github.com/cabinetsbay/catalog/issues/47 --- Framework/lib/view/page/o.php | 1 + Framework/lib/view/page/type.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Framework/lib/view/page/o.php b/Framework/lib/view/page/o.php index 637c891a3..5cdb37c03 100644 --- a/Framework/lib/view/page/o.php +++ b/Framework/lib/view/page/o.php @@ -7,6 +7,7 @@ * @used-by df_body_class() * @used-by df_metadata() * @used-by df_page_title() + * @used-by \CabinetsBay\Catalog\Observer\LayoutLoadBefore::execute() (https://github.com/cabinetsbay/catalog/issues/47) * @used-by \Df\Sso\Button::_prepareLayout() * @used-by \Inkifi\Core\Plugin\Catalog\Block\Product\View::afterSetLayout() */ diff --git a/Framework/lib/view/page/type.php b/Framework/lib/view/page/type.php index a27dd9cfc..82e3e4ca9 100644 --- a/Framework/lib/view/page/type.php +++ b/Framework/lib/view/page/type.php @@ -8,6 +8,7 @@ function df_is_catalog_product_list():bool {return df_handle('catalog_category_v /** * 2019-03-27 + * @used-by \CabinetsBay\Catalog\Observer\LayoutLoadBefore::execute() (https://github.com/cabinetsbay/catalog/issues/47) * @used-by \Dfe\Frontend\Block\ProductView\Css::_toHtml() * @used-by \Frugue\Core\Plugin\Swatches\Helper\Media::afterGetImageConfig() * @used-by \TFC\Core\Plugin\Theme\Block\Html\Breadcrumbs::aroundAddCrumb() From 5e8efc5079be5485089aacae9a45f2e99c51a13e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 10 Sep 2024 13:43:00 +0100 Subject: [PATCH 003/717] https://github.com/mage2pro/core/issues/434 --- Core/lib/cache/dfc.php | 3 +++ Core/lib/lang/prop/custom.php | 3 +++ Framework/Config/Dom/L.php | 6 +++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Core/lib/cache/dfc.php b/Core/lib/cache/dfc.php index 54bcbda54..6d3fc9acb 100644 --- a/Core/lib/cache/dfc.php +++ b/Core/lib/cache/dfc.php @@ -55,6 +55,9 @@ function dfc($o, Closure $f, array $a = [], bool $unique = true, int $offset = 0 * https://php.net/manual/migration82.deprecated.php#migration82.deprecated.core.dynamic-properties * https://wiki.php.net/rfc/deprecate_dynamic_properties * 2) @see df_prop_k() + * 2024-09-10 + * 1) "The creation of dynamic properties is deprecated in PHP ≥ 8.2": https://df.tips/t/2360 + * 2) "Document the deprecation of dynamic properties in PHP ≥ 8.2": https://github.com/mage2pro/core/issues/434 * @var mixed $r */ static $hasWeakMap; /** @var bool $hasWeakMap */ diff --git a/Core/lib/lang/prop/custom.php b/Core/lib/lang/prop/custom.php index 68922866f..2b7ee76c8 100644 --- a/Core/lib/lang/prop/custom.php +++ b/Core/lib/lang/prop/custom.php @@ -178,6 +178,9 @@ function df_prop_k($o, string $k, $v = DF_N, $d = null) {/** @var object|mixed|n * https://php.net/manual/migration82.deprecated.php#migration82.deprecated.core.dynamic-properties * https://wiki.php.net/rfc/deprecate_dynamic_properties * 2) @see dfc() + * 2024-09-10 + * 1) "The creation of dynamic properties is deprecated in PHP ≥ 8.2": https://df.tips/t/2360 + * 2) "Document the deprecation of dynamic properties in PHP ≥ 8.2": https://github.com/mage2pro/core/issues/434 */ static $hasWeakMap; /** @var bool $hasWeakMap */ # 2024-01-10 diff --git a/Framework/Config/Dom/L.php b/Framework/Config/Dom/L.php index 847a8fd57..93a0f13a9 100644 --- a/Framework/Config/Dom/L.php +++ b/Framework/Config/Dom/L.php @@ -41,10 +41,14 @@ static function init(_P $o, string $xml):Doc { # 1) I have had a wrong code for 7 years: # $r->schema = $defaultSchema; # https://github.com/mage2pro/core/blob/9.5.0/Framework/Config/Dom.php#L81 - # 2) I have noticed the mistake only with PHH 8.2: + # 2) I have noticed the mistake only with PHP 8.2: # "[PHP 8.2] «Creation of dynamic property DOMDocument::$schema is deprecated # in vendor/mage2pro/core/Framework/Config/Dom.php on line 81»": # https://github.com/mage2pro/core/issues/215 + # 2024-09-10 + # 1) The code before 2023-07-17 was wrong because it assigned $defaultSchema to `$r` instead of `$o`. + # 2) "The creation of dynamic properties is deprecated in PHP ≥ 8.2": https://df.tips/t/2360 + # 3) "Document the deprecation of dynamic properties in PHP ≥ 8.2": https://github.com/mage2pro/core/issues/434 dfr_prop_set($o, 'schema', $defaultSchema); } return $r; From 1f58d6e94d53828769553369d3349bcd1fc95623 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Thu, 12 Sep 2024 11:53:59 +0100 Subject: [PATCH 004/717] https://github.com/cabinetsbay/site/issues/98 --- Framework/lib/http/main.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Framework/lib/http/main.php b/Framework/lib/http/main.php index c4964d816..5158cc75d 100644 --- a/Framework/lib/http/main.php +++ b/Framework/lib/http/main.php @@ -100,6 +100,7 @@ function df_post_h():PostHelper {return df_o(PostHelper::class);} * @used-by df_order() * @used-by df_store() * @used-by \Alignet\Paymecheckout\Plugin\Magento\Framework\Session\SidResolver::aroundGetSid() (innomuebles.com, https://github.com/innomuebles/m2/issues/11) + * @used-by \CabinetsBay\Catalog\Observer\LayoutLoadBefore::execute() (https://github.com/cabinetsbay/site/issues/98) * @used-by \CanadaSatellite\Core\Plugin\Magento\Framework\App\Http::aroundLaunch() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/72) * @used-by \Df\Backend\Model\Auth::loginByEmail() * @used-by \Df\Framework\Plugin\Data\Form\Element\Fieldset::beforeAddField() From ae07ccd79c580e95a842cc3277398e82b4a70eb7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 20:26:57 +0100 Subject: [PATCH 005/717] https://github.com/mage2pro/core/issues/435 --- Core/lib/lang/call/.php | 40 +++++++++++++++++++++---------- Qa/lib/validation/assert/bool.php | 1 + 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Core/lib/lang/call/.php b/Core/lib/lang/call/.php index 4574082c0..7efeee587 100644 --- a/Core/lib/lang/call/.php +++ b/Core/lib/lang/call/.php @@ -1,7 +1,9 @@ invoke(...array_merge( $isMethod ? [$o] : [] - ,df_map($rfa->getParameters(), function(RP $rp) use($p, $rfa, $isMethod) {return dfa($p, $rp->getName(), - # 2024-09-07 - # "`df_call()`: «Failed to retrieve the default value»": - # https://github.com/thehcginstitute-com/m1/issues/678 - function(string $n) use($p, $rp, $rfa, $isMethod) {return $rp->isOptional() ? $rp->getDefaultValue() : - df_error( - sprintf( - "`df_call()`: the required argument `{$n}` of the `{$rfa->getName()}` %s is missed." - ,$isMethod ? 'method' : 'function' - ) - ,['arguments' => $p] - ); + ,df_map($rfa->getParameters(), function(RP $rp) use($p, $rfa, $isMethod) {/** @var mixed $r */ + /** @var string $n */ + if (isset($p[$n = $rp->getName()])) { + $r = $p[$n]; + # 2024-09-21 + # 1) "`df_call()` should use `df_bool()` for `bool` arguments": + # https://github.com/mage2pro/core/issues/435 + # 2) https://www.php.net/manual/en/reflectionparameter.gettype.php + # 3) https://www.php.net/manual/en/class.reflectionnamedtype.php + # 4) https://www.php.net/manual/en/reflectionnamedtype.getname.php#128874 + if (($rt = $rp->getType()) instanceof RNT && 'bool' === $rt->getName()) {/** @var ?RT|?RNT $rt */ + $r = df_bool($r); + }; } - );}) + else { + # 2024-09-07 + # "`df_call()`: «Failed to retrieve the default value»": + # https://github.com/thehcginstitute-com/m1/issues/678 + $r = $rp->isOptional() ? $rp->getDefaultValue() : df_error(sprintf( + "`df_call()`: the required argument `{$n}` of the `{$rfa->getName()}` %s is missed." + ,$isMethod ? 'method' : 'function' + ) + ,['arguments' => $p]); + } + return $r; + }) )); } } diff --git a/Qa/lib/validation/assert/bool.php b/Qa/lib/validation/assert/bool.php index ff1ad5b55..aff9b4c1e 100644 --- a/Qa/lib/validation/assert/bool.php +++ b/Qa/lib/validation/assert/bool.php @@ -1,5 +1,6 @@ Date: Sat, 21 Sep 2024 20:32:55 +0100 Subject: [PATCH 006/717] https://github.com/mage2pro/core/issues/435 --- Core/lib/reflection/param/is/bool.php | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Core/lib/reflection/param/is/bool.php diff --git a/Core/lib/reflection/param/is/bool.php b/Core/lib/reflection/param/is/bool.php new file mode 100644 index 000000000..84e2d4e54 --- /dev/null +++ b/Core/lib/reflection/param/is/bool.php @@ -0,0 +1,9 @@ + Date: Sat, 21 Sep 2024 20:36:17 +0100 Subject: [PATCH 007/717] https://github.com/mage2pro/core/issues/435 --- Core/lib/reflection/param/type.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Core/lib/reflection/param/type.php diff --git a/Core/lib/reflection/param/type.php b/Core/lib/reflection/param/type.php new file mode 100644 index 000000000..776d20765 --- /dev/null +++ b/Core/lib/reflection/param/type.php @@ -0,0 +1,11 @@ +getType()) instanceof NT ? $t->getName() : '';} \ No newline at end of file From 5b763f2feecd834d24e390f546c405b5299af71d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 20:38:02 +0100 Subject: [PATCH 008/717] https://github.com/mage2pro/core/issues/435 --- Core/lib/lang/call/.php | 5 +---- Core/lib/reflection/param/is/bool.php | 7 +++---- Core/lib/reflection/param/type.php | 1 + 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Core/lib/lang/call/.php b/Core/lib/lang/call/.php index 7efeee587..78706f850 100644 --- a/Core/lib/lang/call/.php +++ b/Core/lib/lang/call/.php @@ -71,10 +71,7 @@ function df_call($o, $f, array $p = []) {/** @var mixed $r */ # 2024-09-21 # 1) "`df_call()` should use `df_bool()` for `bool` arguments": # https://github.com/mage2pro/core/issues/435 - # 2) https://www.php.net/manual/en/reflectionparameter.gettype.php - # 3) https://www.php.net/manual/en/class.reflectionnamedtype.php - # 4) https://www.php.net/manual/en/reflectionnamedtype.getname.php#128874 - if (($rt = $rp->getType()) instanceof RNT && 'bool' === $rt->getName()) {/** @var ?RT|?RNT $rt */ + if (dfr_param_is_bool($rp)) { $r = df_bool($r); }; } diff --git a/Core/lib/reflection/param/is/bool.php b/Core/lib/reflection/param/is/bool.php index 84e2d4e54..c06da0b9e 100644 --- a/Core/lib/reflection/param/is/bool.php +++ b/Core/lib/reflection/param/is/bool.php @@ -1,9 +1,8 @@ getType()) instanceof NT ? $t->getName() : '';} \ No newline at end of file From 89fc2bec1e324dc9d76eaaaf4d0e18cce85e57c0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 20:38:28 +0100 Subject: [PATCH 009/717] https://github.com/mage2pro/core/issues/435 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a1cfc7def..7006827c2 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/core" - ,"version": "11.4.0" + ,"version": "11.4.1" ,"description": "Mage2.PRO core package." ,"type": "magento2-module" ,"homepage": "https://mage2.pro" From f66fef6c941679be25799ca1024b813a0db90fee Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 20:39:40 +0100 Subject: [PATCH 010/717] https://github.com/mage2pro/core/issues/435 --- Core/lib/lang/call/.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Core/lib/lang/call/.php b/Core/lib/lang/call/.php index 78706f850..d5c968217 100644 --- a/Core/lib/lang/call/.php +++ b/Core/lib/lang/call/.php @@ -1,9 +1,7 @@ Date: Sat, 21 Sep 2024 22:39:18 +0100 Subject: [PATCH 011/717] refactoring --- Xml/lib/check.php | 41 +++++++++++++++++++++++++++++++++++++++++ Xml/lib/main.php | 39 --------------------------------------- 2 files changed, 41 insertions(+), 39 deletions(-) create mode 100644 Xml/lib/check.php diff --git a/Xml/lib/check.php b/Xml/lib/check.php new file mode 100644 index 000000000..0e78276cc --- /dev/null +++ b/Xml/lib/check.php @@ -0,0 +1,41 @@ +children())` некорректно возвращает 1 для листов в PHP 5.1: http://3v4l.org/PT6Pt + * Однако нам не нужно поддерживать PHP 5.1. + * 3) Для несуществующего узла попытка вызова @uses count() приведёт к сбою: «Warning: count(): Node no longer exists» + * http://3v4l.org/PsIPe#v512 + * 4) Текущий алгоритм проверен на работоспособность здесь: http://3v4l.org/VldTN + * 2015-08-15 + * Нельзя здесь использовать `count($e->children())`, + * потому что класс @see SimpleXmlElement не реализует интерфейс @see Iterator, + * а реализует только интерфейс @see Traversable. + * https://php.net/manual/class.iterator.php + * https://php.net/manual/class.traversable.php + * https://php.net/manual/simplexmlelement.count.php + * 2015-08-16 + * 1) Как ни странно, написанное выше действительно верно: http://3v4l.org/covo1 + * 2) Класс @see \SimpleXMLElement не реализует интерфейс @see Iterator, + * а реализует только интерфейс @see Traversable. + * https://php.net/manual/class.iterator.php + * https://php.net/manual/class.traversable.php + * https://php.net/manual/simplexmlelement.count.php + * Однако @uses count() почему-то работает для него. + * @see \SimpleXMLElement — самый загадочный класс PHP. + * @used-by df_assert_leaf() + */ +function df_check_leaf(CX $e):bool {return !df_xml_exists($e) || !$e->children()->count();} + +/** + * 2016-09-01 + * Вообще говоря, заголовок у XML необязателен, но моя функция @see df_xml_prettify() его добавляет, + * поэтому меня пока данный алгоритм устраивает. + * Более качественный алгоритм будет более ресурсоёмким: нам надо будет разбирать весь XML. + * @used-by \Df\Backend\Block\Widget\Grid\Column\Renderer\Text::render() + * @param mixed $v + */ +function df_check_xml($v):bool {return is_string($v) && df_starts_with($v, '";} -/** - * 2015-02-27 - * 1) Метод @see \SimpleXMLElement::count() появился только в PHP 5.3, - * поэтому мы его не используем: https://php.net/manual/simplexmlelement.count.php - * 2) `count($e->children())` некорректно возвращает 1 для листов в PHP 5.1: http://3v4l.org/PT6Pt - * Однако нам не нужно поддерживать PHP 5.1. - * 3) Для несуществующего узла попытка вызова @uses count() приведёт к сбою: «Warning: count(): Node no longer exists» - * http://3v4l.org/PsIPe#v512 - * 4) Текущий алгоритм проверен на работоспособность здесь: http://3v4l.org/VldTN - * 2015-08-15 - * Нельзя здесь использовать `count($e->children())`, - * потому что класс @see SimpleXmlElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * 2015-08-16 - * 1) Как ни странно, написанное выше действительно верно: http://3v4l.org/covo1 - * 2) Класс @see \SimpleXMLElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * Однако @uses count() почему-то работает для него. - * @see \SimpleXMLElement — самый загадочный класс PHP. - * @used-by df_assert_leaf() - */ -function df_check_leaf(CX $e):bool {return !df_xml_exists($e) || !$e->children()->count();} - -/** - * 2016-09-01 - * Вообще говоря, заголовок у XML необязателен, но моя функция @see df_xml_prettify() его добавляет, - * поэтому меня пока данный алгоритм устраивает. - * Более качественный алгоритм будет более ресурсоёмким: нам надо будет разбирать весь XML. - * @used-by \Df\Backend\Block\Widget\Grid\Column\Renderer\Text::render() - * @param mixed $v - */ -function df_check_xml($v):bool {return is_string($v) && df_starts_with($v, ' Date: Sat, 21 Sep 2024 22:39:31 +0100 Subject: [PATCH 012/717] refactoring --- Xml/lib/{main.php => other.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{main.php => other.php} (100%) diff --git a/Xml/lib/main.php b/Xml/lib/other.php similarity index 100% rename from Xml/lib/main.php rename to Xml/lib/other.php From d0939546b2a6f04596dab17835972617acdbca47 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:40:04 +0100 Subject: [PATCH 013/717] refactoring --- Xml/lib/assert.php | 11 +++++++++++ Xml/lib/other.php | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 Xml/lib/assert.php diff --git a/Xml/lib/assert.php b/Xml/lib/assert.php new file mode 100644 index 000000000..5c00e0d61 --- /dev/null +++ b/Xml/lib/assert.php @@ -0,0 +1,11 @@ + Date: Sat, 21 Sep 2024 22:41:18 +0100 Subject: [PATCH 014/717] refactoring --- Xml/lib/cdata.php | 27 +++++++++++++++++++++++++++ Xml/lib/other.php | 25 ------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) create mode 100644 Xml/lib/cdata.php diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php new file mode 100644 index 000000000..06be45e75 --- /dev/null +++ b/Xml/lib/cdata.php @@ -0,0 +1,27 @@ +";} + +/** + * 2021-12-12 https://3v4l.org/3SDsT + * @see df_cdata() + * @used-by df_cdata_raw_if_needed() + * @used-by \Df\Xml\X::importString() + */ +function df_needs_cdata(string $s):bool { + $s1 = htmlspecialchars_decode($s, ENT_XML1 | ENT_QUOTES); + $s2 = htmlspecialchars($s1, ENT_XML1 | ENT_NOQUOTES); + return $s !== $s2 && $s1 !== $s2; +} \ No newline at end of file diff --git a/Xml/lib/other.php b/Xml/lib/other.php index 1b8017aef..fd3395221 100644 --- a/Xml/lib/other.php +++ b/Xml/lib/other.php @@ -4,19 +4,6 @@ use Magento\Framework\Simplexml\Element as MX; use SimpleXMLElement as CX; -/** - * @see df_needs_cdata() - * @used-by df_clean_xml() - * @used-by \Dfe\SecurePay\Refund::process() - */ -function df_cdata(string $s):string {return X::markAsCData($s);} - -/** - * 2021-12-16 - * @used-by \Df\Xml\X::asNiceXml() - */ -function df_cdata_raw_if_needed(string $s):string {return !df_needs_cdata($s) ? $s : "";} - /** * 2015-02-27 * Обратите внимание на разницу между @see \SimpleXMLElement::asXML() @@ -163,18 +150,6 @@ function df_leaf_sne(CX $e = null, $d = ''):string {/** @var string $r */ return $r; } -/** - * 2021-12-12 https://3v4l.org/3SDsT - * @see df_cdata() - * @used-by df_cdata_raw_if_needed() - * @used-by \Df\Xml\X::importString() - */ -function df_needs_cdata(string $s):bool { - $s1 = htmlspecialchars_decode($s, ENT_XML1 | ENT_QUOTES); - $s2 = htmlspecialchars($s1, ENT_XML1 | ENT_NOQUOTES); - return $s !== $s2 && $s1 !== $s2; -} - /** * @deprecated It is unused. * @return CX|null From 346df4dba1a677f7d6927d5668744a300721f9c8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:42:11 +0100 Subject: [PATCH 015/717] refactoring --- Xml/lib/leaf.php | 149 ++++++++++++++++++++++++++++++++++++++++++++++ Xml/lib/other.php | 146 --------------------------------------------- 2 files changed, 149 insertions(+), 146 deletions(-) create mode 100644 Xml/lib/leaf.php diff --git a/Xml/lib/leaf.php b/Xml/lib/leaf.php new file mode 100644 index 000000000..4dfb69b9a --- /dev/null +++ b/Xml/lib/leaf.php @@ -0,0 +1,149 @@ + + * + * + * + * aaa + * 1 + * + * + * bbb + * 2 + * + * + * + * Здесь для $e1 = $xml->{'product'}->{'cms'}->{'class'} + * мы можем использовать $e1->__toString() и (string)$e1. + * http://3v4l.org/rAq3F + * Однако для $e2 = $xml->{'product'}->{'cms'} + * мы не можем использовать $e2->__toString() и (string)$e2, + * потому что узел «cms» не является концевым узлом (листом дерева XML). + * http://3v4l.org/Pkj37 + * Более того, метод @see \SimpleXMLElement::__toString() + * отсутствует в PHP версий 5.2.17 и ниже: + * http://3v4l.org/Wiia2#v500 + * + * 2015-03-02 + * Обратите внимание, + * то мы специально допускаем возможность для первого параметра $e принимать значение null: + * это даёт нам возможность писать код типа: + * @used-by Df_Page_Helper_Head::needSkipAsStandardCss() + * df_leaf_b(df_config_node( + * 'df/page/skip_standard_css/', df_state()->getController()->getFullActionName() + * )) + * без дополнительных проверок, имеется ли в наличии запрашиваемый лист дерева XML + * (если лист отсутствует, то @see df_config_node() вернёт null) + * + * @used-by df_leaf_b() + * @used-by df_leaf_child() + * @used-by df_leaf_f() + * @used-by df_leaf_i() + * @used-by df_leaf_s() + * @param string|null|callable $d [optional] + * @return string|null + */ +function df_leaf(CX $e = null, $d = null) {/** @var string $r */ + /** + * 2015-08-04 + * Нельзя здесь использовать !$e, + * потому что для концевых текстовых узлов с ненулевым целым значением (например: «147») + * такое выражение довольно-таки неожиданно возвращает true. + * @see \SimpleXMLElement вообще необычный класс с нестандартным поведением. + * Чтобы понять, почему в данном случае !$e равно true, посморите функцию @see df_xml_exists() + * + * Так вот, @see df_xml_exists() для текстового узла всегда возвращает false, + * даже если текстовое значение не приводится к false (то же «147»). + * + * Почему так происходит — видно из реализации @see df_xml_exists(): !empty($e) + * То есть, empty($e) для текстовых узлов возвращает true. + * + * Например: + * <Остаток> + * <Склад> + * <Ид>6f87e83f-722c-11df-b336-0011955cba6b + * <Количество>147 + * + * + * Если здесь сделать xpath Остаток/Склад/Количество, + * то для узла «147» !$e почему-то вернёт true, + * хотя в данном случае $e является полноценным объектом @see \SimpleXMLElement + * и (string)$e возвращает «147». + */ + if (is_null($e)) { + $r = df_call_if($d); + } + elseif (df_es($r = (string)df_assert_leaf($e))) { + /** + * 2015-09-25 + * Добавил данное условие, чтобы различать случай пустого узла и отсутствия узла. + * Пример пустого узла ru_RU: + * + * Order Total + * + * + * Так вот, для пустого узла empty($e) вернёт false, + * а для отсутствующего узла — true. + */ + $r = df_if1(empty($e), $d, ''); + } + return $r; +} + +/** + * @deprecated It is unused. + * @param bool|callable $default [optional] + */ +function df_leaf_b(CX $e = null, $default = false):bool {return df_bool(df_leaf($e, $default));} + +/** + * 2022-11-15 @deprecated It is unused. + * @param string|mixed|null|callable $d [optional] + * @return string|mixed|null + */ +function df_leaf_child(CX $e, string $child, $d = null) {return df_leaf($e->{$child}, $d);} + +/** + * 2015-08-16 Намеренно убрал параметр $default. + * 2022-11-15 @deprecated It is unused. + */ +function df_leaf_f(CX $e = null):float {return df_float(df_leaf($e));} + +/** + * 2015-08-16 Намеренно убрал параметр $default. + * 2022-11-15 @deprecated It is unused. + */ +function df_leaf_i(CX $e = null):int {return df_int(df_leaf($e));} + +/** + * @used-by df_leaf_sne() + * @used-by \Df\Xml\X::map() + * @used-by \Df\Xml\X::xpathMap() + * @used-by \Dfe\Robokassa\Api\Options::p() + * @param CX|null $e [optional] + * @param string|callable $d [optional] + */ +function df_leaf_s(CX $e = null, $d = ''):string {return (string)df_leaf($e, $d);} + +/** + * @used-by \Df\Xml\X::map() + * @used-by \Df\Xml\X::xpathMap() + * @used-by \Dfe\SecurePay\Refund::process() + * @param string|callable $d [optional] + */ +function df_leaf_sne(CX $e = null, $d = ''):string {/** @var string $r */ + if (df_es($r = df_leaf_s($e, $d))) { + df_error('Лист дерева XML должен быть непуст, однако он пуст.'); + } + return $r; +} \ No newline at end of file diff --git a/Xml/lib/other.php b/Xml/lib/other.php index fd3395221..525fb72ce 100644 --- a/Xml/lib/other.php +++ b/Xml/lib/other.php @@ -4,152 +4,6 @@ use Magento\Framework\Simplexml\Element as MX; use SimpleXMLElement as CX; -/** - * 2015-02-27 - * Обратите внимание на разницу между @see \SimpleXMLElement::asXML() - * и @see \SimpleXMLElement::__toString() / оператор (string)$this. - * - * @see \SimpleXMLElement::__toString() и (string)$this - * возвращают непустую строку только для концевых узлов (листьев дерева XML). - * Пример: - * - * - * - * - * aaa - * 1 - * - * - * bbb - * 2 - * - * - * - * Здесь для $e1 = $xml->{'product'}->{'cms'}->{'class'} - * мы можем использовать $e1->__toString() и (string)$e1. - * http://3v4l.org/rAq3F - * Однако для $e2 = $xml->{'product'}->{'cms'} - * мы не можем использовать $e2->__toString() и (string)$e2, - * потому что узел «cms» не является концевым узлом (листом дерева XML). - * http://3v4l.org/Pkj37 - * Более того, метод @see \SimpleXMLElement::__toString() - * отсутствует в PHP версий 5.2.17 и ниже: - * http://3v4l.org/Wiia2#v500 - * - * 2015-03-02 - * Обратите внимание, - * то мы специально допускаем возможность для первого параметра $e принимать значение null: - * это даёт нам возможность писать код типа: - * @used-by Df_Page_Helper_Head::needSkipAsStandardCss() - * df_leaf_b(df_config_node( - * 'df/page/skip_standard_css/', df_state()->getController()->getFullActionName() - * )) - * без дополнительных проверок, имеется ли в наличии запрашиваемый лист дерева XML - * (если лист отсутствует, то @see df_config_node() вернёт null) - * - * @used-by df_leaf_b() - * @used-by df_leaf_child() - * @used-by df_leaf_f() - * @used-by df_leaf_i() - * @used-by df_leaf_s() - * @param string|null|callable $d [optional] - * @return string|null - */ -function df_leaf(CX $e = null, $d = null) {/** @var string $r */ - /** - * 2015-08-04 - * Нельзя здесь использовать !$e, - * потому что для концевых текстовых узлов с ненулевым целым значением (например: «147») - * такое выражение довольно-таки неожиданно возвращает true. - * @see \SimpleXMLElement вообще необычный класс с нестандартным поведением. - * Чтобы понять, почему в данном случае !$e равно true, посморите функцию @see df_xml_exists() - * - * Так вот, @see df_xml_exists() для текстового узла всегда возвращает false, - * даже если текстовое значение не приводится к false (то же «147»). - * - * Почему так происходит — видно из реализации @see df_xml_exists(): !empty($e) - * То есть, empty($e) для текстовых узлов возвращает true. - * - * Например: - * <Остаток> - * <Склад> - * <Ид>6f87e83f-722c-11df-b336-0011955cba6b - * <Количество>147 - * - * - * Если здесь сделать xpath Остаток/Склад/Количество, - * то для узла «147» !$e почему-то вернёт true, - * хотя в данном случае $e является полноценным объектом @see \SimpleXMLElement - * и (string)$e возвращает «147». - */ - if (is_null($e)) { - $r = df_call_if($d); - } - elseif (df_es($r = (string)df_assert_leaf($e))) { - /** - * 2015-09-25 - * Добавил данное условие, чтобы различать случай пустого узла и отсутствия узла. - * Пример пустого узла ru_RU: - * - * Order Total - * - * - * Так вот, для пустого узла empty($e) вернёт false, - * а для отсутствующего узла — true. - */ - $r = df_if1(empty($e), $d, ''); - } - return $r; -} - -/** - * @deprecated It is unused. - * @param bool|callable $default [optional] - */ -function df_leaf_b(CX $e = null, $default = false):bool {return df_bool(df_leaf($e, $default));} - -/** - * 2022-11-15 @deprecated It is unused. - * @param string|mixed|null|callable $d [optional] - * @return string|mixed|null - */ -function df_leaf_child(CX $e, string $child, $d = null) {return df_leaf($e->{$child}, $d);} - -/** - * 2015-08-16 Намеренно убрал параметр $default. - * 2022-11-15 @deprecated It is unused. - */ -function df_leaf_f(CX $e = null):float {return df_float(df_leaf($e));} - -/** - * 2015-08-16 Намеренно убрал параметр $default. - * 2022-11-15 @deprecated It is unused. - */ -function df_leaf_i(CX $e = null):int {return df_int(df_leaf($e));} - -/** - * @used-by df_leaf_sne() - * @used-by \Df\Xml\X::map() - * @used-by \Df\Xml\X::xpathMap() - * @used-by \Dfe\Robokassa\Api\Options::p() - * @param CX|null $e [optional] - * @param string|callable $d [optional] - */ -function df_leaf_s(CX $e = null, $d = ''):string {return (string)df_leaf($e, $d);} - -/** - * @used-by \Df\Xml\X::map() - * @used-by \Df\Xml\X::xpathMap() - * @used-by \Dfe\SecurePay\Refund::process() - * @param string|callable $d [optional] - */ -function df_leaf_sne(CX $e = null, $d = ''):string {/** @var string $r */ - if (df_es($r = df_leaf_s($e, $d))) { - df_error('Лист дерева XML должен быть непуст, однако он пуст.'); - } - return $r; -} - /** * @deprecated It is unused. * @return CX|null From 6cf1e5f60d9408ceeecbfbc50cd9dfdd7a3a44bf Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:43:07 +0100 Subject: [PATCH 016/717] refactoring --- Xml/lib/assert.php | 11 ----------- Xml/lib/check.php | 30 ------------------------------ Xml/lib/leaf.php | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 41 deletions(-) delete mode 100644 Xml/lib/assert.php diff --git a/Xml/lib/assert.php b/Xml/lib/assert.php deleted file mode 100644 index 5c00e0d61..000000000 --- a/Xml/lib/assert.php +++ /dev/null @@ -1,11 +0,0 @@ -children())` некорректно возвращает 1 для листов в PHP 5.1: http://3v4l.org/PT6Pt - * Однако нам не нужно поддерживать PHP 5.1. - * 3) Для несуществующего узла попытка вызова @uses count() приведёт к сбою: «Warning: count(): Node no longer exists» - * http://3v4l.org/PsIPe#v512 - * 4) Текущий алгоритм проверен на работоспособность здесь: http://3v4l.org/VldTN - * 2015-08-15 - * Нельзя здесь использовать `count($e->children())`, - * потому что класс @see SimpleXmlElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * 2015-08-16 - * 1) Как ни странно, написанное выше действительно верно: http://3v4l.org/covo1 - * 2) Класс @see \SimpleXMLElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * Однако @uses count() почему-то работает для него. - * @see \SimpleXMLElement — самый загадочный класс PHP. - * @used-by df_assert_leaf() - */ -function df_check_leaf(CX $e):bool {return !df_xml_exists($e) || !$e->children()->count();} /** * 2016-09-01 diff --git a/Xml/lib/leaf.php b/Xml/lib/leaf.php index 4dfb69b9a..e7d5348b0 100644 --- a/Xml/lib/leaf.php +++ b/Xml/lib/leaf.php @@ -1,7 +1,45 @@ children())` некорректно возвращает 1 для листов в PHP 5.1: http://3v4l.org/PT6Pt + * Однако нам не нужно поддерживать PHP 5.1. + * 3) Для несуществующего узла попытка вызова @uses count() приведёт к сбою: «Warning: count(): Node no longer exists» + * http://3v4l.org/PsIPe#v512 + * 4) Текущий алгоритм проверен на работоспособность здесь: http://3v4l.org/VldTN + * 2015-08-15 + * Нельзя здесь использовать `count($e->children())`, + * потому что класс @see SimpleXmlElement не реализует интерфейс @see Iterator, + * а реализует только интерфейс @see Traversable. + * https://php.net/manual/class.iterator.php + * https://php.net/manual/class.traversable.php + * https://php.net/manual/simplexmlelement.count.php + * 2015-08-16 + * 1) Как ни странно, написанное выше действительно верно: http://3v4l.org/covo1 + * 2) Класс @see \SimpleXMLElement не реализует интерфейс @see Iterator, + * а реализует только интерфейс @see Traversable. + * https://php.net/manual/class.iterator.php + * https://php.net/manual/class.traversable.php + * https://php.net/manual/simplexmlelement.count.php + * Однако @uses count() почему-то работает для него. + * @see \SimpleXMLElement — самый загадочный класс PHP. + * @used-by df_assert_leaf() + */ +function df_check_leaf(CX $e):bool {return !df_xml_exists($e) || !$e->children()->count();} + /** * 2015-02-27 * Обратите внимание на разницу между @see \SimpleXMLElement::asXML() From 1a35508191a2da25c255b1e7b25bb53fb147192d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:43:57 +0100 Subject: [PATCH 017/717] refactoring --- Xml/lib/g.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++ Xml/lib/other.php | 49 --------------------------------------------- 2 files changed, 51 insertions(+), 49 deletions(-) create mode 100644 Xml/lib/g.php diff --git a/Xml/lib/g.php b/Xml/lib/g.php new file mode 100644 index 000000000..550a8afc8 --- /dev/null +++ b/Xml/lib/g.php @@ -0,0 +1,51 @@ + + * + * + * + * aaa + * 1 + * + * + * bbb + * 2 + * + * + * + * Здесь для $e1 = $xml->{'product'}->{'cms'}->{'class'} + * мы можем использовать $e1->__toString() и (string)$e1. + * http://3v4l.org/rAq3F + * Однако для $e2 = $xml->{'product'}->{'cms'} + * мы не можем использовать $e2->__toString() и (string)$e2, + * потому что узел «cms» не является концевым узлом (листом дерева XML): http://3v4l.org/Pkj37 + * Более того, метод @see SimpleXMLElement::__toString() отсутствует в PHP версий 5.2.17 и ниже: + * http://3v4l.org/Wiia2#v500 + * 2016-08-31 Портировал из Российской сборки Magento. + * 2022-11-15 + * 1) https://github.com/mage2pro/core/blob/2.0.0/Xml/G.php?ts=4 + * 2) $skipHeader is not used currently. + * @used-by \Df\API\Client::reqXml() + * @used-by \Df\Framework\W\Result\Xml::__toString() + * @used-by \Dfe\SecurePay\Refund::process() + * @param array(string => mixed) $contents [optional] + * @param array(string => mixed) $p [optional] + */ +function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string { + $h = $skipHeader ? '' : df_xml_header(); /** @var string $h */ + $x = df_xml_parse(df_cc_n($h, "<{$tag}/>")); /** @var X $x */ + $x->addAttributes($atts); + $x->importArray($contents); + # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 + return str_replace("\x0B", " ", $skipHeader ? $x->asXMLPart() : df_cc_n($h, $x->asNiceXml())); +} \ No newline at end of file diff --git a/Xml/lib/other.php b/Xml/lib/other.php index 525fb72ce..afcab903e 100644 --- a/Xml/lib/other.php +++ b/Xml/lib/other.php @@ -107,55 +107,6 @@ function df_xml_exists(CX $e = null):bool {return !empty($e);} */ function df_xml_exists_child(CX $e, string $child):bool {return isset($e->{$child});} -/** - * @see \Magento\Framework\Simplexml\Element::asNiceXml() не добавляет к документу заголовок XML: его надо добавить вручную. - * 2015-02-27 - * Для конвертации объекта класса @see SimpleXMLElement в строку - * надо использовать именно метод @uses SimpleXMLElement::asXML(), - * а не @see SimpleXMLElement::__toString() или оператор (string)$this. - * @see SimpleXMLElement::__toString() и (string)$this - * возвращают непустую строку только для концевых узлов (листьев дерева XML). - * Пример: - * - * - * - * - * aaa - * 1 - * - * - * bbb - * 2 - * - * - * - * Здесь для $e1 = $xml->{'product'}->{'cms'}->{'class'} - * мы можем использовать $e1->__toString() и (string)$e1. - * http://3v4l.org/rAq3F - * Однако для $e2 = $xml->{'product'}->{'cms'} - * мы не можем использовать $e2->__toString() и (string)$e2, - * потому что узел «cms» не является концевым узлом (листом дерева XML): http://3v4l.org/Pkj37 - * Более того, метод @see SimpleXMLElement::__toString() отсутствует в PHP версий 5.2.17 и ниже: - * http://3v4l.org/Wiia2#v500 - * 2016-08-31 Портировал из Российской сборки Magento. - * 2022-11-15 - * 1) https://github.com/mage2pro/core/blob/2.0.0/Xml/G.php?ts=4 - * 2) $skipHeader is not used currently. - * @used-by \Df\API\Client::reqXml() - * @used-by \Df\Framework\W\Result\Xml::__toString() - * @used-by \Dfe\SecurePay\Refund::process() - * @param array(string => mixed) $contents [optional] - * @param array(string => mixed) $p [optional] - */ -function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string { - $h = $skipHeader ? '' : df_xml_header(); /** @var string $h */ - $x = df_xml_parse(df_cc_n($h, "<{$tag}/>")); /** @var X $x */ - $x->addAttributes($atts); - $x->importArray($contents); - # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 - return str_replace("\x0B", " ", $skipHeader ? $x->asXMLPart() : df_cc_n($h, $x->asNiceXml())); -} - /** * 2016-09-01 * 2018-12-18 Single quotes are not supported by some external systems (e.g., Vantiv), so now I use double quotes. From 5bac9c741c4d4c3937233749d9577b1fec2139a3 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:45:34 +0100 Subject: [PATCH 018/717] refactoring --- Xml/lib/other.php | 85 +--------------------------------------------- Xml/lib/parse.php | 86 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 84 deletions(-) create mode 100644 Xml/lib/parse.php diff --git a/Xml/lib/other.php b/Xml/lib/other.php index afcab903e..17c297d02 100644 --- a/Xml/lib/other.php +++ b/Xml/lib/other.php @@ -129,81 +129,6 @@ function df_xml_node(string $tag, array $attr = [], array $contents = []):X { return $r; } -/** - * @used-by df_module_name_by_path() - * @used-by df_xml_g() - * @used-by df_xml_node() - * @used-by df_xml_parse_a() - * @used-by df_xml_prettify() - * @used-by df_xml_x() - * @used-by \Dfe\Robokassa\Api\Options::p() - * @used-by \Dfe\SecurePay\Refund::process() - * @param string|X $x - * @return X|null - * @throws E - */ -function df_xml_parse($x, bool $throw = true) {/** @var X $r */ - if ($x instanceof X) { - $r = $x; - } - else { - df_param_sne($x, 0); - $r = null; - try {$r = new X($x);} - catch (\Throwable $th) { - if ($throw) { - df_error( - "При синтаксическом разборе документа XML произошёл сбой:\n" - . "«%s»\n" - . "********************\n" - . "%s\n" - . "********************\n" - , df_xts($th) - , df_trim($x) - ); - } - } - } - return $r; -} - -/** - * 2018-12-19 - * @uses \Magento\Framework\Simplexml\Element::asArray() returns XML tag's attributes - * inside an `@` key, e.g: - * - * 82924701437133501 - * f838868475 - * 000 - * <...> - * - * will be converted to: - * { - * "@": { - * "customerId": "admin@mage2.pro", - * "reportGroup": "1272532" - * }, - * "litleTxnId": "82924701437133501", - * "orderId": "f838868475", - * "response": "000", - * <...> - * } - * @used-by \Dfe\Vantiv\API\Client::_construct() - * @param string|X $x - * @return array(string => mixed) - * @throws E - */ -function df_xml_parse_a($x):array {return df_xml_parse($x)->asArray();} - -/** - * 2016-09-01 - * Если XML не отформатирован, то после его заголовка перенос строки идти не обязан: http://stackoverflow.com/a/8384602 - * @used-by df_xml_prettify() - * @param string|X $x - * @return string|null - */ -function df_xml_parse_header($x) {return df_preg_match('#^<\?xml.*\?>#', df_xml_s($x));} - /** * 2016-09-01 * @used-by \Dfe\SecurePay\Refund::process() @@ -225,12 +150,4 @@ function df_xml_report(CX $e):string {return $e instanceof MX ? $e->asNiceXml() * @used-by df_xml_parse_header() * @param string|X $x */ -function df_xml_s($x):string {return is_string($x) ? $x : $x->asXML();} - -/** - * 2016-09-01 - * 2021-12-02 @deprecated It is unused. - * @see df_xml_s() - * @param string|X $x - */ -function df_xml_x($x):X {return $x instanceof X ? $x : df_xml_parse($x);} \ No newline at end of file +function df_xml_s($x):string {return is_string($x) ? $x : $x->asXML();} \ No newline at end of file diff --git a/Xml/lib/parse.php b/Xml/lib/parse.php new file mode 100644 index 000000000..9a8afad27 --- /dev/null +++ b/Xml/lib/parse.php @@ -0,0 +1,86 @@ + + * 82924701437133501 + * f838868475 + * 000 + * <...> + * + * will be converted to: + * { + * "@": { + * "customerId": "admin@mage2.pro", + * "reportGroup": "1272532" + * }, + * "litleTxnId": "82924701437133501", + * "orderId": "f838868475", + * "response": "000", + * <...> + * } + * @used-by \Dfe\Vantiv\API\Client::_construct() + * @param string|X $x + * @return array(string => mixed) + * @throws E + */ +function df_xml_parse_a($x):array {return df_xml_parse($x)->asArray();} + +/** + * 2016-09-01 + * Если XML не отформатирован, то после его заголовка перенос строки идти не обязан: http://stackoverflow.com/a/8384602 + * @used-by df_xml_prettify() + * @param string|X $x + * @return string|null + */ +function df_xml_parse_header($x) {return df_preg_match('#^<\?xml.*\?>#', df_xml_s($x));} + +/** + * 2016-09-01 + * 2021-12-02 @deprecated It is unused. + * @see df_xml_s() + * @param string|X $x + */ +function df_xml_x($x):X {return $x instanceof X ? $x : df_xml_parse($x);} \ No newline at end of file From c3043e15297595a76799b1f5dcc047c0ba51a14d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:46:24 +0100 Subject: [PATCH 019/717] refactoring --- Xml/lib/exists.php | 40 ++++++++++++++++++++++++++++++++++++++++ Xml/lib/other.php | 38 -------------------------------------- 2 files changed, 40 insertions(+), 38 deletions(-) create mode 100644 Xml/lib/exists.php diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php new file mode 100644 index 000000000..e3deac2bd --- /dev/null +++ b/Xml/lib/exists.php @@ -0,0 +1,40 @@ +{'тест'} всегда возвращает объект @see \SimpleXMLElement, + * вне зависимости от наличия узла «тест», просто для отсутствующего узла данный объект будет пуст, + * и empty() для него вернёт true. + * + * 2015-08-04 + * Заметил, что empty($e) для текстовых узлов всегда возвращает true, + * даже если узел как строка приводится к true (например: «147»). + * Например: + * Например: + * <Остаток> + * <Склад> + * <Ид>6f87e83f-722c-11df-b336-0011955cba6b + * <Количество>147 + * + * + * Если здесь сделать xpath Остаток/Склад/Количество, + * то для узла «147» @see df_xml_exists($e) вернёт false. + * + * Обратите внимание, что эту особенность использует алгоритм @see df_check_leaf(): + * return !df_xml_exists($e) || !count($e->children()); + * + * @used-by df_check_leaf() + */ +function df_xml_exists(CX $e = null):bool {return !empty($e);} + +/** + * http://stackoverflow.com/questions/1560827#comment20135428_1562158 + * @used-by df_xml_children() + */ +function df_xml_exists_child(CX $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file diff --git a/Xml/lib/other.php b/Xml/lib/other.php index 17c297d02..65495a613 100644 --- a/Xml/lib/other.php +++ b/Xml/lib/other.php @@ -69,44 +69,6 @@ function df_xml_children(CX $e, string $name, bool $req = false) { /** @var CX|n return $r; } -/** - * 2015-02-27 - * Алгоритм взят отсюда: http://stackoverflow.com/a/5344560 - * Проверил, что он работает: http://3v4l.org/tnEIJ - * Обратите внимание, что isset() вместо empty() не сработает: http://3v4l.org/2P5o0 - * isset, однако, работает для проверки наличия дочерних листов: @see df_xml_exists_child() - * - * Обратите внимание, что оператор $e->{'тест'} всегда возвращает объект @see \SimpleXMLElement, - * вне зависимости от наличия узла «тест», просто для отсутствующего узла данный объект будет пуст, - * и empty() для него вернёт true. - * - * 2015-08-04 - * Заметил, что empty($e) для текстовых узлов всегда возвращает true, - * даже если узел как строка приводится к true (например: «147»). - * Например: - * Например: - * <Остаток> - * <Склад> - * <Ид>6f87e83f-722c-11df-b336-0011955cba6b - * <Количество>147 - * - * - * Если здесь сделать xpath Остаток/Склад/Количество, - * то для узла «147» @see df_xml_exists($e) вернёт false. - * - * Обратите внимание, что эту особенность использует алгоритм @see df_check_leaf(): - * return !df_xml_exists($e) || !count($e->children()); - * - * @used-by df_check_leaf() - */ -function df_xml_exists(CX $e = null):bool {return !empty($e);} - -/** - * http://stackoverflow.com/questions/1560827#comment20135428_1562158 - * @used-by df_xml_children() - */ -function df_xml_exists_child(CX $e, string $child):bool {return isset($e->{$child});} - /** * 2016-09-01 * 2018-12-18 Single quotes are not supported by some external systems (e.g., Vantiv), so now I use double quotes. From 21d688cd8a65f3b3f4ce1d3b29e52de914185b67 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:47:10 +0100 Subject: [PATCH 020/717] refactoring --- Xml/lib/child.php | 68 +++++++++++++++++++++++++++++++++++++++++++++++ Xml/lib/other.php | 65 -------------------------------------------- 2 files changed, 68 insertions(+), 65 deletions(-) create mode 100644 Xml/lib/child.php diff --git a/Xml/lib/child.php b/Xml/lib/child.php new file mode 100644 index 000000000..6b4a2dacb --- /dev/null +++ b/Xml/lib/child.php @@ -0,0 +1,68 @@ + + * + * + * + * + * то $this->e()->{'rule'} вернёт не массив, а объект (!), + * но при этом @see count() для этого объекта работает как для массива (!), + * то есть реально возвращает количество детей типа rule. + * Далее, оператор [] также работает, как для массива (!) + * http://stackoverflow.com/a/16100099 + * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. + */ + df_assert_eq(1, count($childNodes)); + $r = $childNodes[0]; + df_assert($r instanceof CX); + } + return $r; +} + +/** + * @used-by df_xml_child() + * @return CX|null + * @throws E + */ +function df_xml_children(CX $e, string $name, bool $req = false) { /** @var CX|null $r */ + df_param_sne($name, 0); + if (df_xml_exists_child($e, $name)) { + /** + * Обратите внимание, что если мы имеем структуру: + * + * + * + * + * + * то $e->{'rule'} вернёт не массив, а объект (!), + * но при этом @see count() для этого объекта работает как для массива (!), + * то есть реально возвращает количество детей типа rule. + * Далее, оператор [] также работает, как для массива (!) + * http://stackoverflow.com/a/16100099 + * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. + */ + $r = $e->{$name}; + } + elseif (!$req) { + $r = null; + } + else { + df_error("Требуемый узел «{$name}» отсутствует в документе:\n{xml}", ['{xml}' => df_xml_report($e)]); + } + return $r; +} \ No newline at end of file diff --git a/Xml/lib/other.php b/Xml/lib/other.php index 65495a613..c6c583b94 100644 --- a/Xml/lib/other.php +++ b/Xml/lib/other.php @@ -4,71 +4,6 @@ use Magento\Framework\Simplexml\Element as MX; use SimpleXMLElement as CX; -/** - * @deprecated It is unused. - * @return CX|null - * @throws E - */ -function df_xml_child(CX $e, string $name, bool $req = false) { - $childNodes = df_xml_children($e, $name, $req); /** @var CX[] $childNodes */ - if (is_null($childNodes)) { /** @var CX|null $r */ - $r = null; - } - else { - /** - * Обратите внимание, что если мы имеем структуру: - * - * - * - * - * - * то $this->e()->{'rule'} вернёт не массив, а объект (!), - * но при этом @see count() для этого объекта работает как для массива (!), - * то есть реально возвращает количество детей типа rule. - * Далее, оператор [] также работает, как для массива (!) - * http://stackoverflow.com/a/16100099 - * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. - */ - df_assert_eq(1, count($childNodes)); - $r = $childNodes[0]; - df_assert($r instanceof CX); - } - return $r; -} - -/** - * @used-by df_xml_child() - * @return CX|null - * @throws E - */ -function df_xml_children(CX $e, string $name, bool $req = false) { /** @var CX|null $r */ - df_param_sne($name, 0); - if (df_xml_exists_child($e, $name)) { - /** - * Обратите внимание, что если мы имеем структуру: - * - * - * - * - * - * то $e->{'rule'} вернёт не массив, а объект (!), - * но при этом @see count() для этого объекта работает как для массива (!), - * то есть реально возвращает количество детей типа rule. - * Далее, оператор [] также работает, как для массива (!) - * http://stackoverflow.com/a/16100099 - * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. - */ - $r = $e->{$name}; - } - elseif (!$req) { - $r = null; - } - else { - df_error("Требуемый узел «{$name}» отсутствует в документе:\n{xml}", ['{xml}' => df_xml_report($e)]); - } - return $r; -} - /** * 2016-09-01 * 2018-12-18 Single quotes are not supported by some external systems (e.g., Vantiv), so now I use double quotes. From 3aa0403d73e3c68aee45d625deffe0824c8b5f03 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:51:18 +0100 Subject: [PATCH 021/717] refactoring --- Xml/lib/g.php | 14 ++++++++++++++ Xml/lib/leaf/assert.php | 11 +++++++++++ Xml/lib/{leaf.php => leaf/other.php} | 8 -------- Xml/lib/{other.php => s.php} | 15 --------------- 4 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 Xml/lib/leaf/assert.php rename Xml/lib/{leaf.php => leaf/other.php} (97%) rename Xml/lib/{other.php => s.php} (68%) diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 550a8afc8..09f76b062 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -48,4 +48,18 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski $x->importArray($contents); # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 return str_replace("\x0B", " ", $skipHeader ? $x->asXMLPart() : df_cc_n($h, $x->asNiceXml())); +} + +/** + * @used-by \Dfe\SecurePay\Refund::process() + * @used-by \Dfe\Vantiv\Charge::pCharge() + * @used-by \Dfe\Vantiv\Test\CaseT\Charge::t04() + * @param array(string => string) $attr [optional] + * @param array(string => mixed) $contents [optional] + */ +function df_xml_node(string $tag, array $attr = [], array $contents = []):X { + $r = df_xml_parse("<{$tag}/>"); /** @var X $r */ + $r->addAttributes($attr); + $r->importArray($contents); + return $r; } \ No newline at end of file diff --git a/Xml/lib/leaf/assert.php b/Xml/lib/leaf/assert.php new file mode 100644 index 000000000..5c00e0d61 --- /dev/null +++ b/Xml/lib/leaf/assert.php @@ -0,0 +1,11 @@ +";} -/** - * @used-by \Dfe\SecurePay\Refund::process() - * @used-by \Dfe\Vantiv\Charge::pCharge() - * @used-by \Dfe\Vantiv\Test\CaseT\Charge::t04() - * @param array(string => string) $attr [optional] - * @param array(string => mixed) $contents [optional] - */ -function df_xml_node(string $tag, array $attr = [], array $contents = []):X { - $r = df_xml_parse("<{$tag}/>"); /** @var X $r */ - $r->addAttributes($attr); - $r->importArray($contents); - return $r; -} - /** * 2016-09-01 * @used-by \Dfe\SecurePay\Refund::process() From 723a6cc299003ca2ddf0d8c93ed565264d0f4001 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:51:55 +0100 Subject: [PATCH 022/717] refactoring --- Xml/lib/leaf/check.php | 31 +++++++++++++++++++++++++++++++ Xml/lib/leaf/other.php | 30 ------------------------------ 2 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 Xml/lib/leaf/check.php diff --git a/Xml/lib/leaf/check.php b/Xml/lib/leaf/check.php new file mode 100644 index 000000000..0967d8ab3 --- /dev/null +++ b/Xml/lib/leaf/check.php @@ -0,0 +1,31 @@ +children())` некорректно возвращает 1 для листов в PHP 5.1: http://3v4l.org/PT6Pt + * Однако нам не нужно поддерживать PHP 5.1. + * 3) Для несуществующего узла попытка вызова @uses count() приведёт к сбою: «Warning: count(): Node no longer exists» + * http://3v4l.org/PsIPe#v512 + * 4) Текущий алгоритм проверен на работоспособность здесь: http://3v4l.org/VldTN + * 2015-08-15 + * Нельзя здесь использовать `count($e->children())`, + * потому что класс @see SimpleXmlElement не реализует интерфейс @see Iterator, + * а реализует только интерфейс @see Traversable. + * https://php.net/manual/class.iterator.php + * https://php.net/manual/class.traversable.php + * https://php.net/manual/simplexmlelement.count.php + * 2015-08-16 + * 1) Как ни странно, написанное выше действительно верно: http://3v4l.org/covo1 + * 2) Класс @see \SimpleXMLElement не реализует интерфейс @see Iterator, + * а реализует только интерфейс @see Traversable. + * https://php.net/manual/class.iterator.php + * https://php.net/manual/class.traversable.php + * https://php.net/manual/simplexmlelement.count.php + * Однако @uses count() почему-то работает для него. + * @see \SimpleXMLElement — самый загадочный класс PHP. + * @used-by df_assert_leaf() + */ +function df_check_leaf(CX $e):bool {return !df_xml_exists($e) || !$e->children()->count();} \ No newline at end of file diff --git a/Xml/lib/leaf/other.php b/Xml/lib/leaf/other.php index a186c0fff..4dfb69b9a 100644 --- a/Xml/lib/leaf/other.php +++ b/Xml/lib/leaf/other.php @@ -1,37 +1,7 @@ children())` некорректно возвращает 1 для листов в PHP 5.1: http://3v4l.org/PT6Pt - * Однако нам не нужно поддерживать PHP 5.1. - * 3) Для несуществующего узла попытка вызова @uses count() приведёт к сбою: «Warning: count(): Node no longer exists» - * http://3v4l.org/PsIPe#v512 - * 4) Текущий алгоритм проверен на работоспособность здесь: http://3v4l.org/VldTN - * 2015-08-15 - * Нельзя здесь использовать `count($e->children())`, - * потому что класс @see SimpleXmlElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * 2015-08-16 - * 1) Как ни странно, написанное выше действительно верно: http://3v4l.org/covo1 - * 2) Класс @see \SimpleXMLElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * Однако @uses count() почему-то работает для него. - * @see \SimpleXMLElement — самый загадочный класс PHP. - * @used-by df_assert_leaf() - */ -function df_check_leaf(CX $e):bool {return !df_xml_exists($e) || !$e->children()->count();} - /** * 2015-02-27 * Обратите внимание на разницу между @see \SimpleXMLElement::asXML() From c6fa423950e7872c5c86481a77c1d8d6dd5fbc10 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:53:29 +0100 Subject: [PATCH 023/717] refactoring --- Xml/lib/leaf/{other.php => get/.php} | 49 -------------------------- Xml/lib/leaf/get/other.php | 51 ++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 49 deletions(-) rename Xml/lib/leaf/{other.php => get/.php} (75%) create mode 100644 Xml/lib/leaf/get/other.php diff --git a/Xml/lib/leaf/other.php b/Xml/lib/leaf/get/.php similarity index 75% rename from Xml/lib/leaf/other.php rename to Xml/lib/leaf/get/.php index 4dfb69b9a..7b2bbed92 100644 --- a/Xml/lib/leaf/other.php +++ b/Xml/lib/leaf/get/.php @@ -1,5 +1,4 @@ {$child}, $d);} - -/** - * 2015-08-16 Намеренно убрал параметр $default. - * 2022-11-15 @deprecated It is unused. - */ -function df_leaf_f(CX $e = null):float {return df_float(df_leaf($e));} - -/** - * 2015-08-16 Намеренно убрал параметр $default. - * 2022-11-15 @deprecated It is unused. - */ -function df_leaf_i(CX $e = null):int {return df_int(df_leaf($e));} - -/** - * @used-by df_leaf_sne() - * @used-by \Df\Xml\X::map() - * @used-by \Df\Xml\X::xpathMap() - * @used-by \Dfe\Robokassa\Api\Options::p() - * @param CX|null $e [optional] - * @param string|callable $d [optional] - */ -function df_leaf_s(CX $e = null, $d = ''):string {return (string)df_leaf($e, $d);} - -/** - * @used-by \Df\Xml\X::map() - * @used-by \Df\Xml\X::xpathMap() - * @used-by \Dfe\SecurePay\Refund::process() - * @param string|callable $d [optional] - */ -function df_leaf_sne(CX $e = null, $d = ''):string {/** @var string $r */ - if (df_es($r = df_leaf_s($e, $d))) { - df_error('Лист дерева XML должен быть непуст, однако он пуст.'); - } - return $r; } \ No newline at end of file diff --git a/Xml/lib/leaf/get/other.php b/Xml/lib/leaf/get/other.php new file mode 100644 index 000000000..fb6fb7c65 --- /dev/null +++ b/Xml/lib/leaf/get/other.php @@ -0,0 +1,51 @@ +{$child}, $d);} + +/** + * 2015-08-16 Намеренно убрал параметр $default. + * 2022-11-15 @deprecated It is unused. + */ +function df_leaf_f(CX $e = null):float {return df_float(df_leaf($e));} + +/** + * 2015-08-16 Намеренно убрал параметр $default. + * 2022-11-15 @deprecated It is unused. + */ +function df_leaf_i(CX $e = null):int {return df_int(df_leaf($e));} + +/** + * @used-by df_leaf_sne() + * @used-by \Df\Xml\X::map() + * @used-by \Df\Xml\X::xpathMap() + * @used-by \Dfe\Robokassa\Api\Options::p() + * @param CX|null $e [optional] + * @param string|callable $d [optional] + */ +function df_leaf_s(CX $e = null, $d = ''):string {return (string)df_leaf($e, $d);} + +/** + * @used-by \Df\Xml\X::map() + * @used-by \Df\Xml\X::xpathMap() + * @used-by \Dfe\SecurePay\Refund::process() + * @param string|callable $d [optional] + */ +function df_leaf_sne(CX $e = null, $d = ''):string {/** @var string $r */ + if (df_es($r = df_leaf_s($e, $d))) { + df_error('Лист дерева XML должен быть непуст, однако он пуст.'); + } + return $r; +} \ No newline at end of file From 34bf71e3d54d489783eaeed7ee5c0478d81d5409 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:54:25 +0100 Subject: [PATCH 024/717] refactoring --- Xml/lib/leaf/get/.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 7b2bbed92..3f302d01d 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -50,9 +50,8 @@ * @used-by df_leaf_i() * @used-by df_leaf_s() * @param string|null|callable $d [optional] - * @return string|null */ -function df_leaf(CX $e = null, $d = null) {/** @var string $r */ +function df_leaf(CX $e = null, $d = null):?string {/** @var string $r */ /** * 2015-08-04 * Нельзя здесь использовать !$e, From 96522f92f454fd84a9fa8151a790a7b2f3edab01 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 22:55:12 +0100 Subject: [PATCH 025/717] refactoring --- Xml/lib/leaf/get/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 3f302d01d..6d1f80809 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -51,7 +51,7 @@ * @used-by df_leaf_s() * @param string|null|callable $d [optional] */ -function df_leaf(CX $e = null, $d = null):?string {/** @var string $r */ +function df_leaf(CX $e = null, $d = null):?string {/** @var ?string $r */ /** * 2015-08-04 * Нельзя здесь использовать !$e, From 7dfbcd0cb562a4a034f2521b98df8a8be9393406 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:04:23 +0100 Subject: [PATCH 026/717] refactoring --- Xml/lib/leaf/get/.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 6d1f80809..becd05ef0 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -87,7 +87,6 @@ function df_leaf(CX $e = null, $d = null):?string {/** @var ?string $r */ * Добавил данное условие, чтобы различать случай пустого узла и отсутствия узла. * Пример пустого узла ru_RU: * - * Order Total * * * Так вот, для пустого узла empty($e) вернёт false, From 1d7b099e23c9603b0318aa5c605ca28f95008128 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:04:45 +0100 Subject: [PATCH 027/717] refactoring --- Xml/lib/leaf/get/.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index becd05ef0..ff9503492 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -89,8 +89,7 @@ function df_leaf(CX $e = null, $d = null):?string {/** @var ?string $r */ * * * - * Так вот, для пустого узла empty($e) вернёт false, - * а для отсутствующего узла — true. + * Так вот, для пустого узла `empty($e)` вернёт `false`, а для отсутствующего узла — `true`. */ $r = df_if1(empty($e), $d, ''); } From 31d42abf22cdd24871bb4b28ddd04aa71e451447 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:05:53 +0100 Subject: [PATCH 028/717] refactoring --- Xml/lib/leaf/get/.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index ff9503492..0db656574 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -85,10 +85,7 @@ function df_leaf(CX $e = null, $d = null):?string {/** @var ?string $r */ /** * 2015-09-25 * Добавил данное условие, чтобы различать случай пустого узла и отсутствия узла. - * Пример пустого узла ru_RU: - * - * - * + * Пример пустого узла: ``. * Так вот, для пустого узла `empty($e)` вернёт `false`, а для отсутствующего узла — `true`. */ $r = df_if1(empty($e), $d, ''); From e7514ed25eb6124f7883fbab05d0972eede0809b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:08:21 +0100 Subject: [PATCH 029/717] refactoring --- Xml/lib/leaf/get/.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 0db656574..4c0cf8876 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -82,12 +82,10 @@ function df_leaf(CX $e = null, $d = null):?string {/** @var ?string $r */ $r = df_call_if($d); } elseif (df_es($r = (string)df_assert_leaf($e))) { - /** - * 2015-09-25 - * Добавил данное условие, чтобы различать случай пустого узла и отсутствия узла. - * Пример пустого узла: ``. - * Так вот, для пустого узла `empty($e)` вернёт `false`, а для отсутствующего узла — `true`. - */ + # 2015-09-25 + # `empty($e)` returns: + # `true` for an absent node + # `false` for an empty node (`` or ``) $r = df_if1(empty($e), $d, ''); } return $r; From b589b8263758e19a908e544a9c7df081277911fe Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:10:34 +0100 Subject: [PATCH 030/717] refactoring --- Xml/lib/leaf/get/b.php | 8 ++++++++ Xml/lib/leaf/get/other.php | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 Xml/lib/leaf/get/b.php diff --git a/Xml/lib/leaf/get/b.php b/Xml/lib/leaf/get/b.php new file mode 100644 index 000000000..9b7de4215 --- /dev/null +++ b/Xml/lib/leaf/get/b.php @@ -0,0 +1,8 @@ + Date: Sat, 21 Sep 2024 23:11:25 +0100 Subject: [PATCH 031/717] refactoring --- Xml/lib/leaf/get/f.php | 8 ++++++++ Xml/lib/leaf/get/other.php | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 Xml/lib/leaf/get/f.php diff --git a/Xml/lib/leaf/get/f.php b/Xml/lib/leaf/get/f.php new file mode 100644 index 000000000..791ba06d9 --- /dev/null +++ b/Xml/lib/leaf/get/f.php @@ -0,0 +1,8 @@ +{$child}, $d);} -/** - * 2015-08-16 Намеренно убрал параметр $default. - * 2022-11-15 @deprecated It is unused. - */ -function df_leaf_f(CX $e = null):float {return df_float(df_leaf($e));} - /** * 2015-08-16 Намеренно убрал параметр $default. * 2022-11-15 @deprecated It is unused. From f863cd09a3b009296336708d24331aff5f439f09 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:11:33 +0100 Subject: [PATCH 032/717] refactoring --- Xml/lib/leaf/get/f.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/f.php b/Xml/lib/leaf/get/f.php index 791ba06d9..244733edf 100644 --- a/Xml/lib/leaf/get/f.php +++ b/Xml/lib/leaf/get/f.php @@ -2,7 +2,7 @@ use Df\Xml\X; use SimpleXMLElement as CX; /** - * 2015-08-16 Намеренно убрал параметр $default. + * 2015-08-16 Намеренно убрал параметр $d. * 2022-11-15 @deprecated It is unused. */ function df_leaf_f(CX $e = null):float {return df_float(df_leaf($e));} \ No newline at end of file From 718ac4c60088d80c778281efe3d9c72e4b359ed4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:11:41 +0100 Subject: [PATCH 033/717] refactoring --- Xml/lib/leaf/get/f.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Xml/lib/leaf/get/f.php b/Xml/lib/leaf/get/f.php index 244733edf..5353762cf 100644 --- a/Xml/lib/leaf/get/f.php +++ b/Xml/lib/leaf/get/f.php @@ -1,5 +1,4 @@ Date: Sat, 21 Sep 2024 23:12:18 +0100 Subject: [PATCH 034/717] refactoring --- Xml/lib/leaf/get/i.php | 8 ++++++++ Xml/lib/leaf/get/other.php | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 Xml/lib/leaf/get/i.php diff --git a/Xml/lib/leaf/get/i.php b/Xml/lib/leaf/get/i.php new file mode 100644 index 000000000..d80fe1edf --- /dev/null +++ b/Xml/lib/leaf/get/i.php @@ -0,0 +1,8 @@ +{$child}, $d);} -/** - * 2015-08-16 Намеренно убрал параметр $default. - * 2022-11-15 @deprecated It is unused. - */ -function df_leaf_i(CX $e = null):int {return df_int(df_leaf($e));} - /** * @used-by df_leaf_sne() * @used-by \Df\Xml\X::map() From 9e480ae96238d1cb9b5b3e83dff44c1686a43cb0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:12:24 +0100 Subject: [PATCH 035/717] refactoring --- Xml/lib/leaf/get/i.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/i.php b/Xml/lib/leaf/get/i.php index d80fe1edf..cb333368a 100644 --- a/Xml/lib/leaf/get/i.php +++ b/Xml/lib/leaf/get/i.php @@ -2,7 +2,7 @@ use SimpleXMLElement as CX; /** - * 2015-08-16 Намеренно убрал параметр $default. + * 2015-08-16 Намеренно убрал параметр $d. * 2022-11-15 @deprecated It is unused. */ function df_leaf_i(CX $e = null):int {return df_int(df_leaf($e));} \ No newline at end of file From d62104a8a502a29b9f03d6c946478905625e62ff Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:13:07 +0100 Subject: [PATCH 036/717] refactoring --- Xml/lib/leaf/get/child.php | 9 +++++++++ Xml/lib/leaf/get/other.php | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 Xml/lib/leaf/get/child.php diff --git a/Xml/lib/leaf/get/child.php b/Xml/lib/leaf/get/child.php new file mode 100644 index 000000000..acc3e7512 --- /dev/null +++ b/Xml/lib/leaf/get/child.php @@ -0,0 +1,9 @@ +{$child}, $d);} \ No newline at end of file diff --git a/Xml/lib/leaf/get/other.php b/Xml/lib/leaf/get/other.php index 5e1bcd786..245358fa8 100644 --- a/Xml/lib/leaf/get/other.php +++ b/Xml/lib/leaf/get/other.php @@ -2,13 +2,6 @@ use Df\Xml\X; use SimpleXMLElement as CX; -/** - * 2022-11-15 @deprecated It is unused. - * @param string|mixed|null|callable $d [optional] - * @return string|mixed|null - */ -function df_leaf_child(CX $e, string $child, $d = null) {return df_leaf($e->{$child}, $d);} - /** * @used-by df_leaf_sne() * @used-by \Df\Xml\X::map() From e5f5605872736ac1ddd1770d12a9f573f9aed3c0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:13:59 +0100 Subject: [PATCH 037/717] refactoring --- Xml/lib/leaf/get/{other.php => s.php} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename Xml/lib/leaf/get/{other.php => s.php} (84%) diff --git a/Xml/lib/leaf/get/other.php b/Xml/lib/leaf/get/s.php similarity index 84% rename from Xml/lib/leaf/get/other.php rename to Xml/lib/leaf/get/s.php index 245358fa8..3a4bf521b 100644 --- a/Xml/lib/leaf/get/other.php +++ b/Xml/lib/leaf/get/s.php @@ -7,10 +7,9 @@ * @used-by \Df\Xml\X::map() * @used-by \Df\Xml\X::xpathMap() * @used-by \Dfe\Robokassa\Api\Options::p() - * @param CX|null $e [optional] * @param string|callable $d [optional] */ -function df_leaf_s(CX $e = null, $d = ''):string {return (string)df_leaf($e, $d);} +function df_leaf_s(?CX $e = null, $d = ''):string {return (string)df_leaf($e, $d);} /** * @used-by \Df\Xml\X::map() From b4da361e54df537aa9bf90074eb603e0284ebabb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:15:19 +0100 Subject: [PATCH 038/717] refactoring --- Xml/lib/cdata.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 06be45e75..16914a1e8 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -21,7 +21,7 @@ function df_cdata_raw_if_needed(string $s):string {return !df_needs_cdata($s) ? * @used-by \Df\Xml\X::importString() */ function df_needs_cdata(string $s):bool { - $s1 = htmlspecialchars_decode($s, ENT_XML1 | ENT_QUOTES); - $s2 = htmlspecialchars($s1, ENT_XML1 | ENT_NOQUOTES); + $s1 = htmlspecialchars_decode($s, ENT_XML1 | ENT_QUOTES); /** @var string $s1 */ + $s2 = htmlspecialchars($s1, ENT_XML1 | ENT_NOQUOTES); /** @var string $s2 */ return $s !== $s2 && $s1 !== $s2; } \ No newline at end of file From b4018b065b102f406cfdd08ec01ee4ca564e9a12 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:16:31 +0100 Subject: [PATCH 039/717] refactoring --- Xml/lib/child.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 6b4a2dacb..333347340 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -4,10 +4,9 @@ /** * @deprecated It is unused. - * @return CX|null * @throws E */ -function df_xml_child(CX $e, string $name, bool $req = false) { +function df_xml_child(CX $e, string $name, bool $req = false):?CX { $childNodes = df_xml_children($e, $name, $req); /** @var CX[] $childNodes */ if (is_null($childNodes)) { /** @var CX|null $r */ $r = null; From e6adfcb9acc728c37da39e541da3b4989358d14a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:16:54 +0100 Subject: [PATCH 040/717] refactoring --- Xml/lib/child.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 333347340..995012ffd 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -6,9 +6,9 @@ * @deprecated It is unused. * @throws E */ -function df_xml_child(CX $e, string $name, bool $req = false):?CX { +function df_xml_child(CX $e, string $name, bool $req = false):?CX { /** @var ?CX $r */ $childNodes = df_xml_children($e, $name, $req); /** @var CX[] $childNodes */ - if (is_null($childNodes)) { /** @var CX|null $r */ + if (is_null($childNodes)) { $r = null; } else { From 3ae8a8dc5a9a5cf9d4ea0f1258825ca66adb81d5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:17:15 +0100 Subject: [PATCH 041/717] refactoring --- Xml/lib/child.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 995012ffd..b624900d1 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -27,8 +27,7 @@ function df_xml_child(CX $e, string $name, bool $req = false):?CX { /** @var ?CX * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. */ df_assert_eq(1, count($childNodes)); - $r = $childNodes[0]; - df_assert($r instanceof CX); + df_assert(($r = $childNodes[0]) instanceof CX); } return $r; } From 213cc5e3b023269f9a5755fef35ae17837a301bc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:17:54 +0100 Subject: [PATCH 042/717] refactoring --- Xml/lib/child.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index b624900d1..d3f792902 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -27,7 +27,7 @@ function df_xml_child(CX $e, string $name, bool $req = false):?CX { /** @var ?CX * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. */ df_assert_eq(1, count($childNodes)); - df_assert(($r = $childNodes[0]) instanceof CX); + $r = df_assert($childNodes[0] instanceof CX); } return $r; } From 3c15c0ff41da7a669a810359c18c66cd6973c0e9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:21:42 +0100 Subject: [PATCH 043/717] refactoring --- Qa/lib/validation/assert/class.php | 1 + Qa/lib/validation/assert/main.php | 3 --- Xml/lib/child.php | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Qa/lib/validation/assert/class.php b/Qa/lib/validation/assert/class.php index d5ca17134..92e6ef529 100644 --- a/Qa/lib/validation/assert/class.php +++ b/Qa/lib/validation/assert/class.php @@ -10,6 +10,7 @@ * @used-by df_load() * @used-by df_newa() * @used-by df_trans() + * @used-by df_xml_child() * @used-by dfpex_args() * @used-by \Df\Payment\Choice::f() * @used-by \Df\Payment\Operation\Source\Creditmemo::cm() diff --git a/Qa/lib/validation/assert/main.php b/Qa/lib/validation/assert/main.php index a19fd935e..a21fc78bf 100644 --- a/Qa/lib/validation/assert/main.php +++ b/Qa/lib/validation/assert/main.php @@ -1,7 +1,5 @@ Date: Sat, 21 Sep 2024 23:22:39 +0100 Subject: [PATCH 044/717] refactoring --- Xml/lib/child.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index d9d5b6ef4..db6dc6807 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -37,7 +37,7 @@ function df_xml_child(CX $e, string $name, bool $req = false):?CX { /** @var ?CX * @return CX|null * @throws E */ -function df_xml_children(CX $e, string $name, bool $req = false) { /** @var CX|null $r */ +function df_xml_children(CX $e, string $name, bool $req = false):?CX { /** @var ?CX $r */ df_param_sne($name, 0); if (df_xml_exists_child($e, $name)) { /** From e00c5382936d4a1168855b44c09ad7f151880083 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:23:26 +0100 Subject: [PATCH 045/717] refactoring --- Xml/lib/child.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index db6dc6807..836ee946f 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -60,7 +60,7 @@ function df_xml_children(CX $e, string $name, bool $req = false):?CX { /** @var $r = null; } else { - df_error("Требуемый узел «{$name}» отсутствует в документе:\n{xml}", ['{xml}' => df_xml_report($e)]); + df_error("The required node «{$name}» is absent in the XML document:\n{xml}", ['{xml}' => df_xml_report($e)]); } return $r; } \ No newline at end of file From 3503b8e081bb1a8b4a0a47053e7a1b82fefcee09 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:24:24 +0100 Subject: [PATCH 046/717] refactoring --- Xml/lib/exists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index e3deac2bd..e45c32f11 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -31,7 +31,7 @@ * * @used-by df_check_leaf() */ -function df_xml_exists(CX $e = null):bool {return !empty($e);} +function df_xml_exists(?CX $e = null):bool {return !empty($e);} /** * http://stackoverflow.com/questions/1560827#comment20135428_1562158 From f81888fe69d7bf521f47e82f26be6d7b6818f70f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:25:29 +0100 Subject: [PATCH 047/717] refactoring --- Xml/lib/parse.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/lib/parse.php b/Xml/lib/parse.php index 9a8afad27..79892a29f 100644 --- a/Xml/lib/parse.php +++ b/Xml/lib/parse.php @@ -12,10 +12,9 @@ * @used-by \Dfe\Robokassa\Api\Options::p() * @used-by \Dfe\SecurePay\Refund::process() * @param string|X $x - * @return X|null * @throws E */ -function df_xml_parse($x, bool $throw = true) {/** @var X $r */ +function df_xml_parse($x, bool $throw = true):?X {/** @var ?X $r */ if ($x instanceof X) { $r = $x; } From 418cc6e0d235e88e2bfee0a048851c247e4c445d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:28:10 +0100 Subject: [PATCH 048/717] refactoring --- Xml/lib/leaf/get/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 4c0cf8876..08bae6fdf 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -51,7 +51,7 @@ * @used-by df_leaf_s() * @param string|null|callable $d [optional] */ -function df_leaf(CX $e = null, $d = null):?string {/** @var ?string $r */ +function df_leaf(?CX $e = null, $d = null):?string {/** @var ?string $r */ /** * 2015-08-04 * Нельзя здесь использовать !$e, From ec485363782578c9b29a7e05d85286d163119d07 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:28:22 +0100 Subject: [PATCH 049/717] refactoring --- Xml/lib/leaf/get/b.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/b.php b/Xml/lib/leaf/get/b.php index 9b7de4215..23d8866b2 100644 --- a/Xml/lib/leaf/get/b.php +++ b/Xml/lib/leaf/get/b.php @@ -5,4 +5,4 @@ * @deprecated It is unused. * @param bool|callable $d [optional] */ -function df_leaf_b(CX $e = null, $d = false):bool {return df_bool(df_leaf($e, $d));} \ No newline at end of file +function df_leaf_b(?CX $e = null, $d = false):bool {return df_bool(df_leaf($e, $d));} \ No newline at end of file From 9551b973ba42ad0b3e3f307a460d638c1ba94fe2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:28:38 +0100 Subject: [PATCH 050/717] refactoring --- Xml/lib/leaf/get/f.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/f.php b/Xml/lib/leaf/get/f.php index 5353762cf..81948e94e 100644 --- a/Xml/lib/leaf/get/f.php +++ b/Xml/lib/leaf/get/f.php @@ -4,4 +4,4 @@ * 2015-08-16 Намеренно убрал параметр $d. * 2022-11-15 @deprecated It is unused. */ -function df_leaf_f(CX $e = null):float {return df_float(df_leaf($e));} \ No newline at end of file +function df_leaf_f(?CX $e = null):float {return df_float(df_leaf($e));} \ No newline at end of file From 8fd186588ffcd481eac1cfe6362a679dd87f19da Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:28:44 +0100 Subject: [PATCH 051/717] refactoring --- Xml/lib/leaf/get/i.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/i.php b/Xml/lib/leaf/get/i.php index cb333368a..1d417a9fa 100644 --- a/Xml/lib/leaf/get/i.php +++ b/Xml/lib/leaf/get/i.php @@ -5,4 +5,4 @@ * 2015-08-16 Намеренно убрал параметр $d. * 2022-11-15 @deprecated It is unused. */ -function df_leaf_i(CX $e = null):int {return df_int(df_leaf($e));} \ No newline at end of file +function df_leaf_i(?CX $e = null):int {return df_int(df_leaf($e));} \ No newline at end of file From 3423cca360069bc90b07e89d77a3bffd89b0b7ac Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sat, 21 Sep 2024 23:28:55 +0100 Subject: [PATCH 052/717] refactoring --- Xml/lib/leaf/get/s.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/leaf/get/s.php b/Xml/lib/leaf/get/s.php index 3a4bf521b..08ce5d033 100644 --- a/Xml/lib/leaf/get/s.php +++ b/Xml/lib/leaf/get/s.php @@ -17,7 +17,7 @@ function df_leaf_s(?CX $e = null, $d = ''):string {return (string)df_leaf($e, $d * @used-by \Dfe\SecurePay\Refund::process() * @param string|callable $d [optional] */ -function df_leaf_sne(CX $e = null, $d = ''):string {/** @var string $r */ +function df_leaf_sne(?CX $e = null, $d = ''):string {/** @var string $r */ if (df_es($r = df_leaf_s($e, $d))) { df_error('Лист дерева XML должен быть непуст, однако он пуст.'); } From 87182c5c08c765bbf0ff6cc5ca9b0e1cda26ddcd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:11:35 +0100 Subject: [PATCH 053/717] refactoring --- Xml/lib/parse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/parse.php b/Xml/lib/parse.php index 79892a29f..cb884d6ff 100644 --- a/Xml/lib/parse.php +++ b/Xml/lib/parse.php @@ -25,7 +25,7 @@ function df_xml_parse($x, bool $throw = true):?X {/** @var ?X $r */ catch (\Throwable $th) { if ($throw) { df_error( - "При синтаксическом разборе документа XML произошёл сбой:\n" + "Failed to parse an XML document:\n" . "«%s»\n" . "********************\n" . "%s\n" From 518fb06ceb3ccd6c8aa53979258f5387ea1b5378 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:13:29 +0100 Subject: [PATCH 054/717] refactoring --- Xml/lib/parse.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Xml/lib/parse.php b/Xml/lib/parse.php index cb884d6ff..36f4ea79a 100644 --- a/Xml/lib/parse.php +++ b/Xml/lib/parse.php @@ -1,6 +1,7 @@ Date: Sun, 22 Sep 2024 00:16:34 +0100 Subject: [PATCH 055/717] refactoring --- Xml/lib/parse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/parse.php b/Xml/lib/parse.php index 36f4ea79a..d3b1c36ac 100644 --- a/Xml/lib/parse.php +++ b/Xml/lib/parse.php @@ -12,7 +12,7 @@ * @used-by df_xml_x() * @used-by \Dfe\Robokassa\Api\Options::p() * @used-by \Dfe\SecurePay\Refund::process() - * @param string|X $x + * @param X|string $x * @throws E */ function df_xml_parse($x, bool $throw = true):?X {/** @var ?X $r */ From 9df405a77f2b88b024bb444f2d4ecf8f3ca070fe Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:46:13 +0100 Subject: [PATCH 056/717] https://github.com/mage2pro/core/issues/436 --- Xml/X.php | 1 + Xml/lib/parse.php | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Xml/X.php b/Xml/X.php index 18d815bb6..c50ab599d 100644 --- a/Xml/X.php +++ b/Xml/X.php @@ -4,6 +4,7 @@ use Magento\Framework\Simplexml\Element as MX; use \SimpleXMLElement as CX; use \Throwable as Th; # 2023-08-03 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 +# 2024-09-22 "Refactor `Df\Xml\X`": https://github.com/mage2pro/core/issues/436 final class X extends MX { /** */ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} diff --git a/Xml/lib/parse.php b/Xml/lib/parse.php index d3b1c36ac..b0cb7127b 100644 --- a/Xml/lib/parse.php +++ b/Xml/lib/parse.php @@ -1,6 +1,7 @@ Date: Sun, 22 Sep 2024 00:49:15 +0100 Subject: [PATCH 057/717] https://github.com/mage2pro/core/issues/436 --- Xml/{X.php => G.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Xml/{X.php => G.php} (99%) diff --git a/Xml/X.php b/Xml/G.php similarity index 99% rename from Xml/X.php rename to Xml/G.php index c50ab599d..4306e7fba 100644 --- a/Xml/X.php +++ b/Xml/G.php @@ -5,7 +5,7 @@ use \SimpleXMLElement as CX; use \Throwable as Th; # 2023-08-03 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 # 2024-09-22 "Refactor `Df\Xml\X`": https://github.com/mage2pro/core/issues/436 -final class X extends MX { +final class G extends MX { /** */ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} From 6c216ee3544f8f08cd4d81976d7495d52440c58e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:50:54 +0100 Subject: [PATCH 058/717] https://github.com/mage2pro/core/issues/436 --- Core/Text/Marker.php | 8 ++++---- Core/lib/array/is.php | 2 +- Core/lib/empty.php | 6 +++--- Core/lib/text/main.php | 4 ++-- Qa/lib/exception.php | 4 ++-- Qa/lib/log/main.php | 2 +- Qa/lib/validation/assert/array.php | 2 +- Qa/lib/validation/assert/other.php | 4 ++-- Qa/lib/validation/error.php | 6 +++--- Qa/lib/validation/param.php | 4 ++-- Xml/G.php | 2 +- Xml/lib/cdata.php | 6 +++--- Xml/lib/g.php | 2 +- Xml/lib/leaf/get/s.php | 10 +++++----- Xml/lib/parse.php | 2 +- Xml/lib/s.php | 4 ++-- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index 49c8fc411..922606dc7 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -4,25 +4,25 @@ final class Marker { /** * 2021-12-12 - * @used-by \Df\Xml\X::marker() + * @used-by \Df\Xml\G::marker() */ function __construct(string $begin, string $end) {$this->_begin = $begin; $this->_end = $end;} /** * 2021-12-12 - * @used-by \Df\Xml\X::markAsCData() + * @used-by \Df\Xml\G::markAsCData() */ function mark(string $s):string {return $this->_begin . $s . $this->_end;} /** * 2021-12-12 - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::importString() */ function marked(string $s):string {return df_starts_with($s, $this->_begin) && df_ends_with($s, $this->_end);} /** * 2021-12-12 - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::importString() */ function unmark(string $s):string {return df_trim_text_left_right($s, $this->_begin, $this->_end);} diff --git a/Core/lib/array/is.php b/Core/lib/array/is.php index e7b716778..4500d3ae0 100644 --- a/Core/lib/array/is.php +++ b/Core/lib/array/is.php @@ -54,7 +54,7 @@ function array_is_list(array $a):bool { * @used-by df_filter_f() * @used-by df_ksort() * @used-by \Df\Core\Exception::__construct() - * @used-by \Df\Xml\X::importArray() + * @used-by \Df\Xml\G::importArray() * @param array(int|string => mixed)|mixed $a */ function df_is_assoc($a):bool {return is_array($a) && (!$a || !array_is_list($a));} diff --git a/Core/lib/empty.php b/Core/lib/empty.php index 6d187f341..8b5d84261 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -19,7 +19,7 @@ * @used-by \Df\Payment\W\Exception\Ignored::message() * @used-by \Df\Payment\W\Handler::log() * @used-by \Df\Typography\Css::rule() - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::importString() * @param mixed $v */ function df_es($v):bool {return '' === $v;} @@ -51,7 +51,7 @@ function df_est($v):bool {return df_es(df_trim($v));} * @used-by \Df\Config\Backend\Serialized::valueUnserialize() * @used-by \Df\Config\Settings::json() * @used-by \Df\Directory\FE\Country::getValues() - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::importString() * @used-by \Dfe\AllPay\Total\Quote::iiAdd() * @used-by \Dfe\AllPay\Total\Quote::iiGet() * @used-by \Dfe\CheckoutCom\Method::disableEvent() @@ -106,7 +106,7 @@ function df_fnes($v):bool {return is_null($v) || '' === $v || false === $v;} /** * @used-by df_fetch_one() * @used-by df_parent_name() - * @used-by \Df\Xml\X::descend() + * @used-by \Df\Xml\G::descend() * @used-by \Dfe\Stripe\Init\Action::need3DS() * @param mixed|false $v * @return mixed|null diff --git a/Core/lib/text/main.php b/Core/lib/text/main.php index 392d1a279..337b2340b 100644 --- a/Core/lib/text/main.php +++ b/Core/lib/text/main.php @@ -46,7 +46,7 @@ function df_bts_yn(bool $v):string {return $v ? 'yes' : 'no';} * @used-by \Df\Cron\Model\LoggerHandler::p() * @used-by \Df\Framework\Config\Dom\L::validate() * @used-by \Df\Sentry\Trace::get_frame_context() - * @used-by \Df\Xml\X::k() + * @used-by \Df\Xml\G::k() * @used-by \Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::parse() * @used-by \DxMoto\Core\Observer\CanLog::execute() * @used-by \RWCandy\Captcha\Assert::name() @@ -99,7 +99,7 @@ function df_contains_ci(string $haystack, string $n):bool {return df_contains(mb * Одна из таких функций — df_string. * * @used-by df_type() - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::importString() * @param mixed $v */ function df_string($v):string { diff --git a/Qa/lib/exception.php b/Qa/lib/exception.php index 75bca23c6..292365ffc 100644 --- a/Qa/lib/exception.php +++ b/Qa/lib/exception.php @@ -92,8 +92,8 @@ function df_xf(T $t):T {while ($t->getPrevious()) {$t = $t->getPrevious();} retu * @used-by \Df\Payment\PlaceOrderInternal::message() * @used-by \Df\Payment\W\Handler::handle() * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Df\Xml\X::addChild() - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::addChild() + * @used-by \Df\Xml\G::importString() * @used-by \Dfe\CheckoutCom\Handler::p() * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() * @used-by \Dfe\Klarna\Exception::messageC() diff --git a/Qa/lib/log/main.php b/Qa/lib/log/main.php index 3ab50b025..b0c6db0c3 100644 --- a/Qa/lib/log/main.php +++ b/Qa/lib/log/main.php @@ -21,7 +21,7 @@ * @used-by \Df\Qa\Failure\Error::check() * @used-by \Df\Qa\Trace\Formatter::p() * @used-by \Df\Widget\Plugin\Block\Adminhtml\Widget\Options::aroundAddFields() (https://github.com/mage2pro/core/issues/397) - * @used-by \Df\Xml\X::addAttributes() + * @used-by \Df\Xml\G::addAttributes() * @used-by \Dfe\CheckoutCom\Response::getCaptureCharge() * @used-by \Dfe\GoogleFont\Fonts\Png::url() * @used-by \Dfe\GoogleFont\Fonts\Sprite::datumPoints() diff --git a/Qa/lib/validation/assert/array.php b/Qa/lib/validation/assert/array.php index 20e1684b8..7a4daaf40 100644 --- a/Qa/lib/validation/assert/array.php +++ b/Qa/lib/validation/assert/array.php @@ -5,7 +5,7 @@ /** * @used-by df_wishlist_item_candidates() * @used-by \Dfe\GoogleFont\Fonts\Sprite::datumPoints() - * @used-by \Df\Xml\X::importArray() + * @used-by \Df\Xml\G::importArray() * @used-by \Dfe\FacebookLogin\Customer::responseJson() */ function df_assert_array(array $a):array {return $a;} diff --git a/Qa/lib/validation/assert/other.php b/Qa/lib/validation/assert/other.php index 9616d91de..e87eae241 100644 --- a/Qa/lib/validation/assert/other.php +++ b/Qa/lib/validation/assert/other.php @@ -9,7 +9,7 @@ * @used-by \Dfe\GoogleFont\Fonts\Png::colorAllocateAlpha() * @used-by \Dfe\GoogleFont\Fonts\Png::image() * @used-by \Dfe\GoogleFont\Fonts\Sprite::draw() - * @used-by \Df\Xml\X::asXMLPart() + * @used-by \Df\Xml\G::asXMLPart() * @param mixed $v * @param string|Th $m [optional] * @return mixed @@ -28,7 +28,7 @@ function df_assert_nef($v, $m = null) {return false !== $v ? $v : df_error($m ?: * @used-by \Df\Payment\W\Event::pid() * @used-by \Df\PaypalClone\Charge::p() * @used-by \Df\StripeClone\Payer::newCard() - * @used-by \Df\Xml\X::addAttributes() + * @used-by \Df\Xml\G::addAttributes() * @used-by \Dfe\Stripe\Controller\CustomerReturn\Index::isSuccess() * @used-by \Dfe\Stripe\Init\Action::redirectUrl() * @throws DFE diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index b24888db3..11c98e3c0 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -132,9 +132,9 @@ function df_abstract($caller):void { * @used-by \Df\Shipping\Method::s() * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() * @used-by \Df\StripeClone\Facade\Charge::cardData() - * @used-by \Df\Xml\X::addAttributes() - * @used-by \Df\Xml\X::addChild() - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::addAttributes() + * @used-by \Df\Xml\G::addChild() + * @used-by \Df\Xml\G::importString() * @used-by \Dfe\AmazonLogin\Customer::validate() * @used-by \Dfe\BlackbaudNetCommunity\Customer::p() * @used-by \Dfe\SecurePay\Refund::process() diff --git a/Qa/lib/validation/param.php b/Qa/lib/validation/param.php index 3f0a63631..e992c5578 100644 --- a/Qa/lib/validation/param.php +++ b/Qa/lib/validation/param.php @@ -20,8 +20,8 @@ function df_param_iso2(string $v, int $ord, int $sl = 0):string {return Q::asser * @used-by dfa_deep_unset() * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() * @used-by \Df\Payment\W\Nav::e2i() - * @used-by \Df\Xml\X::xpath() - * @used-by \Df\Xml\X::xpathA() + * @used-by \Df\Xml\G::xpath() + * @used-by \Df\Xml\G::xpathA() * @used-by \Dfe\AllPay\W\Event::tl_() * @used-by \Dfe\Markdown\DbRecord::__construct() * @throws DFE diff --git a/Xml/G.php b/Xml/G.php index 4306e7fba..bf9ba6185 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -4,7 +4,7 @@ use Magento\Framework\Simplexml\Element as MX; use \SimpleXMLElement as CX; use \Throwable as Th; # 2023-08-03 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 -# 2024-09-22 "Refactor `Df\Xml\X`": https://github.com/mage2pro/core/issues/436 +# 2024-09-22 "Refactor `Df\Xml\G`": https://github.com/mage2pro/core/issues/436 final class G extends MX { /** */ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 16914a1e8..e18cf2d88 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -1,5 +1,5 @@ ";} @@ -18,7 +18,7 @@ function df_cdata_raw_if_needed(string $s):string {return !df_needs_cdata($s) ? * 2021-12-12 https://3v4l.org/3SDsT * @see df_cdata() * @used-by df_cdata_raw_if_needed() - * @used-by \Df\Xml\X::importString() + * @used-by \Df\Xml\G::importString() */ function df_needs_cdata(string $s):bool { $s1 = htmlspecialchars_decode($s, ENT_XML1 | ENT_QUOTES); /** @var string $s1 */ diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 09f76b062..d759a3b66 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -1,5 +1,5 @@ asNiceXml());} From 87db76386f98cf1bd5b5275359cc9c1eb6001085 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:51:10 +0100 Subject: [PATCH 059/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index bf9ba6185..4306e7fba 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -4,7 +4,7 @@ use Magento\Framework\Simplexml\Element as MX; use \SimpleXMLElement as CX; use \Throwable as Th; # 2023-08-03 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 -# 2024-09-22 "Refactor `Df\Xml\G`": https://github.com/mage2pro/core/issues/436 +# 2024-09-22 "Refactor `Df\Xml\X`": https://github.com/mage2pro/core/issues/436 final class G extends MX { /** */ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} From e457a903866fe7b0ebed97987ee2f28fa6f3561b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:54:11 +0100 Subject: [PATCH 060/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 4306e7fba..775e74b89 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -208,9 +208,9 @@ function descend($p) {return df_ftn(parent::descend($p));} * @param array(string => mixed) $array * @param string[]|bool $wrapInCData [optional] */ - function importArray(array $array, $wrapInCData = []):X { + function importArray(array $array, $wrapInCData = []):G { foreach ($array as $key => $v) { /** @var string $key */ /** @var mixed $v */ - if ($v instanceof X) { + if ($v instanceof G) { /** * 2016-08-31 * Случай, который отсутствовал в Российской сборке Magento: @@ -242,8 +242,8 @@ function importArray(array $array, $wrapInCData = []):X { elseif (!is_array($v)) { $this->importString($key, $v, $wrapInCData); } - elseif (df_is_assoc($v) || array_filter($v, function($i) {return $i instanceof X;})) { - /** @var X $childNode */ + elseif (df_is_assoc($v) || array_filter($v, function($i) {return $i instanceof G;})) { + /** @var G $childNode */ $childNode = $this->addChild( /** @@ -362,8 +362,8 @@ function importArray(array $array, $wrapInCData = []):X { */ function map(string $path, string $keyName, string $valueName):array { $r = []; /** @var array(string => string) $r */ - $nodes = $this->xpathA($path); /** @var X[] $nodes */ - foreach ($nodes as $node) {/** @var X $node */ + $nodes = $this->xpathA($path); /** @var G[] $nodes */ + foreach ($nodes as $node) {/** @var G $node */ $r[df_leaf_sne($node->{$keyName})] = df_leaf_s($node->{$valueName}); } return $r; @@ -374,7 +374,7 @@ function map(string $path, string $keyName, string $valueName):array { * @override * @see \SimpleXMLElement::xpath() * @param string|string[] $p - * @return X[] + * @return G[] */ #[\ReturnTypeWillChange] function xpath($p):array { @@ -392,7 +392,7 @@ function xpath($p):array { * @used-by self::map() * @used-by self::xpathMap() * @param string|string[] $path - * @return X[] + * @return G[] */ function xpathA($path):array { if (1 < func_num_args()) { @@ -421,8 +421,8 @@ function xpathA($path):array { */ function xpathMap(string $path, string $keyName, string $valueName):array { $r = []; /** @var array(string => string) $r */ - $nodes = $this->xpathA($path); /** @var X[] $nodes */ - foreach ($nodes as $node) { /** @var X $node */ + $nodes = $this->xpathA($path); /** @var G[] $nodes */ + foreach ($nodes as $node) { /** @var G $node */ $r[df_leaf_sne($node->{$keyName})] = df_leaf_s($node->{$valueName}); } return $r; @@ -430,7 +430,7 @@ function xpathMap(string $path, string $keyName, string $valueName):array { /** @used-by self::importString() */ private function addChildText(string $tag, string $valueAsText):void { - $r = $this->addChild($tag); /** @var X $r */ + $r = $this->addChild($tag); /** @var G $r */ /** * @uses CX::addChild() создаёт и возвращает не просто CX, как говорит документация, а объект класса родителя. * Поэтому в нашем случае addChild создаст объект E. @@ -443,12 +443,12 @@ private function addChildText(string $tag, string $valueAsText):void { * @used-by self::addChildX() * @used-by self::importArray() */ - private function addChildX(X $child):void { - $childInThis = $this->addChild($child->getName(), (string)$child); /** @var X $childInThis */ + private function addChildX(G $child):void { + $childInThis = $this->addChild($child->getName(), (string)$child); /** @var G $childInThis */ foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ $childInThis->addAttribute($attr, $v); } - foreach ($child->children() as $childChild) { /** @var X $childChild */ + foreach ($child->children() as $childChild) { /** @var G $childChild */ $childInThis->addChildX($childChild); } } From 80aacf353edb67b251cf9a9ea0927519b4477ef4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:56:38 +0100 Subject: [PATCH 061/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 775e74b89..87a532217 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -69,28 +69,6 @@ function addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */ return $r; } - /** - * Отличия от родительского метода: - * 1) гарантия, что результат — массив - * 2) кэширование результата - * 2022-12-05: We do not need to check that the result is an array: https://3v4l.org/pBUvg - * @override - * @see \Magento\Framework\Simplexml\Element::asCanonicalArray() - * @return array(string => mixed) - */ - function asCanonicalArray():array { - $_this = spl_object_hash($this); /** @var string $_this */ - if (!isset(self::$_canonicalArray[$_this])) { - /** - * @uses \Magento\Framework\Simplexml\Element::asCanonicalArray() - * может возвращать строку в случае, - * когда структура исходных данных не соответствует массиву. - */ - self::$_canonicalArray[$_this] = parent::asCanonicalArray(); - } - return self::$_canonicalArray[$_this]; - } - /** * 2016-09-01 Родительский метод задаёт вложенность тремя пробелами, а я предпочитаю символ табуляции. * 2022-12-20 We can not declare arguments types because they are undeclared in the overriden method. From b717c306ec386412b74ccade1c14db4e0efbb1ef Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:56:57 +0100 Subject: [PATCH 062/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 87a532217..0f9418e15 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -115,7 +115,7 @@ function asNiceXml($filename = '', $level = 0):string { $r .= df_cdata_raw_if_needed($value); } $r .= $nl; - foreach ($this->children() as $child) {/** @var X $child */ + foreach ($this->children() as $child) {/** @var G $child */ $r .= $child->asNiceXml('', is_numeric($level) ? $level + 1 : true); } $r .= $pad . 'getName() . '>' . $nl; From e4a761bcd8884a76351051d45978c9f82b226515 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 00:59:26 +0100 Subject: [PATCH 063/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/{s.php => s/other.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{s.php => s/other.php} (100%) diff --git a/Xml/lib/s.php b/Xml/lib/s/other.php similarity index 100% rename from Xml/lib/s.php rename to Xml/lib/s/other.php From ed6496f7b13e3e066f24e68706d10569659360c8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:00:07 +0100 Subject: [PATCH 064/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/header.php | 8 ++++++++ Xml/lib/s/other.php | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 Xml/lib/s/header.php diff --git a/Xml/lib/s/header.php b/Xml/lib/s/header.php new file mode 100644 index 000000000..01e7b2e16 --- /dev/null +++ b/Xml/lib/s/header.php @@ -0,0 +1,8 @@ +";} \ No newline at end of file diff --git a/Xml/lib/s/other.php b/Xml/lib/s/other.php index 6538c8d89..fadb362a6 100644 --- a/Xml/lib/s/other.php +++ b/Xml/lib/s/other.php @@ -3,14 +3,6 @@ use Magento\Framework\Simplexml\Element as MX; use SimpleXMLElement as CX; -/** - * 2016-09-01 - * 2018-12-18 Single quotes are not supported by some external systems (e.g., Vantiv), so now I use double quotes. - * @see df_xml_parse_header() - * @used-by df_xml_g() - */ -function df_xml_header(string $enc = 'UTF-8', string $v = '1.0'):string {return "";} - /** * 2016-09-01 * @used-by \Dfe\SecurePay\Refund::process() From 52b35d8562278ee580e9b854bb576d90a29a89f6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:01:52 +0100 Subject: [PATCH 065/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/prettify.php | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Xml/lib/s/prettify.php diff --git a/Xml/lib/s/prettify.php b/Xml/lib/s/prettify.php new file mode 100644 index 000000000..53ddfd244 --- /dev/null +++ b/Xml/lib/s/prettify.php @@ -0,0 +1,10 @@ +asNiceXml());} \ No newline at end of file From 878c7bef489491fded6077db72eaedcb8277fc5c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:02:40 +0100 Subject: [PATCH 066/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/other.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Xml/lib/s/other.php b/Xml/lib/s/other.php index fadb362a6..79dbff218 100644 --- a/Xml/lib/s/other.php +++ b/Xml/lib/s/other.php @@ -1,20 +1,11 @@ asNiceXml());} - /** * @used-by df_assert_leaf() * @used-by df_xml_children() - * @param CX|MX|X $e + * @param CX|MX $e */ function df_xml_report(CX $e):string {return $e instanceof MX ? $e->asNiceXml() : $e->asXML();} @@ -22,6 +13,6 @@ function df_xml_report(CX $e):string {return $e instanceof MX ? $e->asNiceXml() * 2016-09-01 * @see df_xml_x() * @used-by df_xml_parse_header() - * @param string|X $x + * @param CX|string $x */ function df_xml_s($x):string {return is_string($x) ? $x : $x->asXML();} \ No newline at end of file From bf4ea9bdcc8e28434362c9333f1001a72729a314 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:06:25 +0100 Subject: [PATCH 067/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/child.php | 9 ++++----- Xml/lib/leaf/assert.php | 4 ++-- Xml/lib/s/.php | 13 +++++++++++++ Xml/lib/s/other.php | 18 ------------------ 4 files changed, 19 insertions(+), 25 deletions(-) create mode 100644 Xml/lib/s/.php delete mode 100644 Xml/lib/s/other.php diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 836ee946f..b645a9d4b 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -34,12 +34,11 @@ function df_xml_child(CX $e, string $name, bool $req = false):?CX { /** @var ?CX /** * @used-by df_xml_child() - * @return CX|null * @throws E */ -function df_xml_children(CX $e, string $name, bool $req = false):?CX { /** @var ?CX $r */ +function df_xml_children(CX $x, string $name, bool $req = false):?CX { /** @var ?CX $r */ df_param_sne($name, 0); - if (df_xml_exists_child($e, $name)) { + if (df_xml_exists_child($x, $name)) { /** * Обратите внимание, что если мы имеем структуру: * @@ -54,13 +53,13 @@ function df_xml_children(CX $e, string $name, bool $req = false):?CX { /** @var * http://stackoverflow.com/a/16100099 * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. */ - $r = $e->{$name}; + $r = $x->{$name}; } elseif (!$req) { $r = null; } else { - df_error("The required node «{$name}» is absent in the XML document:\n{xml}", ['{xml}' => df_xml_report($e)]); + df_error("The required node «{$name}» is absent in the XML document:\n{xml}", ['{xml}' => df_xml_s($x)]); } return $r; } \ No newline at end of file diff --git a/Xml/lib/leaf/assert.php b/Xml/lib/leaf/assert.php index 5c00e0d61..4fa201e2b 100644 --- a/Xml/lib/leaf/assert.php +++ b/Xml/lib/leaf/assert.php @@ -6,6 +6,6 @@ * @used-by df_leaf() * @throws E */ -function df_assert_leaf(CX $e):CX {return df_check_leaf($e) ? $e : df_error( - "Требуется лист XML, однако получена ветка XML:\n%s.", df_xml_report($e) +function df_assert_leaf(CX $x):CX {return df_check_leaf($x) ? $x : df_error( + "Требуется лист XML, однако получена ветка XML:\n%s.", df_xml_s($x) );} \ No newline at end of file diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php new file mode 100644 index 000000000..77392bd69 --- /dev/null +++ b/Xml/lib/s/.php @@ -0,0 +1,13 @@ +asNiceXml() : $x->asXML());} \ No newline at end of file diff --git a/Xml/lib/s/other.php b/Xml/lib/s/other.php deleted file mode 100644 index 79dbff218..000000000 --- a/Xml/lib/s/other.php +++ /dev/null @@ -1,18 +0,0 @@ -asNiceXml() : $e->asXML();} - -/** - * 2016-09-01 - * @see df_xml_x() - * @used-by df_xml_parse_header() - * @param CX|string $x - */ -function df_xml_s($x):string {return is_string($x) ? $x : $x->asXML();} \ No newline at end of file From 74cb89d2b5f4c75f266baf7a938ac89ae760c1af Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:06:38 +0100 Subject: [PATCH 068/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 0f9418e15..9c6a5f0cc 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -76,7 +76,7 @@ function addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */ * @see \Magento\Framework\Simplexml\Element::asNiceXml() * @used-by df_xml_g() * @used-by df_xml_prettify() - * @used-by df_xml_report() + * @used-by df_xml_s() * @used-by self::asNiceXml() * @param string $filename [optional] * @param int $level [optional] From 5b806b670ecdc3cd836ef69abc7859817e935c30 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:16:18 +0100 Subject: [PATCH 069/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 63 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index 77392bd69..3bf674a8f 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -4,10 +4,69 @@ /** * 2016-09-01 - * @see df_xml_x() + * @see \Magento\Framework\Simplexml\Element::asNiceXml() * @used-by df_assert_leaf() * @used-by df_xml_children() + * @used-by df_xml_g() * @used-by df_xml_parse_header() + * @used-by df_xml_prettify() + * @used-by df_xml_s() * @param CX|MX|string $x */ -function df_xml_s($x):string {return is_string($x) ? $x : ($x instanceof MX ? $x->asNiceXml() : $x->asXML());} \ No newline at end of file +function df_xml_s($x, int $level = 0):string {/** @var string $r */ + if (is_string($x)) { + $r = $x; + } + else { + /** @var string $nl */ /** @var string $pad */ + [$nl, $pad] = !$level ? ['', ''] : ["\n", str_pad('', $level * 1, "\t", STR_PAD_LEFT)]; + $r = $pad . '<' . $x->getName(); /** @var string $r */ + $attributes = $x->attributes(); + if ($attributes) { + foreach ($attributes as $key => $value) { + $r .= ' ' . $key . '="' . str_replace('"', '\"', (string)$value) . '"'; + } + } + $attributes = $x->attributes('xsi', true); + if ($attributes) { + foreach ($attributes as $key => $value) { + $r .= ' xsi:' . $key . '="' . str_replace('"', '\"', (string)$value) . '"'; + } + } + if ($x->hasChildren()) { + $r .= '>'; + $value = trim((string)$x); + if (strlen($value)) { + /** + * 2021-12-16 + * The previous code was: `$this->xmlentities($value)` + * @see \Magento\Framework\Simplexml\Element::xmlentities() + */ + $r .= df_cdata_raw_if_needed($value); + } + $r .= $nl; + foreach ($x->children() as $child) {/** @var CX $child */ + $r .= $child->asNiceXml('', is_numeric($level) ? $level + 1 : true); + } + $r .= $pad . 'getName() . '>' . $nl; + } + else { + $value = (string)$x; + if (strlen($value)) { + /** + * 2021-12-16 + * The previous code was: `$this->xmlentities($value)` + * @see \Magento\Framework\Simplexml\Element::xmlentities() + */ + $r .= '>' . df_cdata_raw_if_needed($value) . 'getName() . '>' . $nl; + } + else { + $r .= '/>' . $nl; + } + } + if ((0 === $level || false === $level) && !empty($filename)) { + file_put_contents($filename, $r); + } + } + return $r; +} \ No newline at end of file From 24b3157663a83c94fa56bb2dffb3a9b8dcb5b49b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:16:59 +0100 Subject: [PATCH 070/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index 3bf674a8f..d07ced8aa 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -20,7 +20,7 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ else { /** @var string $nl */ /** @var string $pad */ [$nl, $pad] = !$level ? ['', ''] : ["\n", str_pad('', $level * 1, "\t", STR_PAD_LEFT)]; - $r = $pad . '<' . $x->getName(); /** @var string $r */ + $r = "$pad<{$x->getName()}"; $attributes = $x->attributes(); if ($attributes) { foreach ($attributes as $key => $value) { From 6854758a34d5685ddb03016f43091398ab98ee52 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:19:03 +0100 Subject: [PATCH 071/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index d07ced8aa..e251d6515 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -21,17 +21,8 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ /** @var string $nl */ /** @var string $pad */ [$nl, $pad] = !$level ? ['', ''] : ["\n", str_pad('', $level * 1, "\t", STR_PAD_LEFT)]; $r = "$pad<{$x->getName()}"; - $attributes = $x->attributes(); - if ($attributes) { - foreach ($attributes as $key => $value) { - $r .= ' ' . $key . '="' . str_replace('"', '\"', (string)$value) . '"'; - } - } - $attributes = $x->attributes('xsi', true); - if ($attributes) { - foreach ($attributes as $key => $value) { - $r .= ' xsi:' . $key . '="' . str_replace('"', '\"', (string)$value) . '"'; - } + foreach (df_eta($x->attributes('xsi', true)) as $k => $v) { + $r .= ' xsi:' . $k . '="' . str_replace('"', '\"', (string)$v) . '"'; } if ($x->hasChildren()) { $r .= '>'; From 0af215ad87e90d5af634c5c72ee117b56bc05ec9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:23:04 +0100 Subject: [PATCH 072/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index e251d6515..a9a89dc72 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -21,9 +21,14 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ /** @var string $nl */ /** @var string $pad */ [$nl, $pad] = !$level ? ['', ''] : ["\n", str_pad('', $level * 1, "\t", STR_PAD_LEFT)]; $r = "$pad<{$x->getName()}"; - foreach (df_eta($x->attributes('xsi', true)) as $k => $v) { - $r .= ' xsi:' . $k . '="' . str_replace('"', '\"', (string)$v) . '"'; - } + # 2024-09-22 https://www.php.net/manual/en/simplexmlelement.attributes.php + if ($aa = $x->attributes('xsi', true)) { /** @var ?CX $aa */ + foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ + $v = str_replace('"', '\"', (string)$v); + $r .= " xsi:$k=\"$v\""; + } + }; + if ($x->hasChildren()) { $r .= '>'; $value = trim((string)$x); From 921ae8e27ceaac01b843dadfb9c24137b90216e2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:24:14 +0100 Subject: [PATCH 073/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index a9a89dc72..5d8c2c7a6 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -28,17 +28,16 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ $r .= " xsi:$k=\"$v\""; } }; - if ($x->hasChildren()) { $r .= '>'; - $value = trim((string)$x); - if (strlen($value)) { + $xs = trim((string)$x); + if (strlen($xs)) { /** * 2021-12-16 - * The previous code was: `$this->xmlentities($value)` + * The previous code was: `$this->xmlentities($xs)` * @see \Magento\Framework\Simplexml\Element::xmlentities() */ - $r .= df_cdata_raw_if_needed($value); + $r .= df_cdata_raw_if_needed($xs); } $r .= $nl; foreach ($x->children() as $child) {/** @var CX $child */ @@ -47,14 +46,14 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ $r .= $pad . 'getName() . '>' . $nl; } else { - $value = (string)$x; - if (strlen($value)) { + $xs = (string)$x; + if (strlen($xs)) { /** * 2021-12-16 - * The previous code was: `$this->xmlentities($value)` + * The previous code was: `$this->xmlentities($xs)` * @see \Magento\Framework\Simplexml\Element::xmlentities() */ - $r .= '>' . df_cdata_raw_if_needed($value) . 'getName() . '>' . $nl; + $r .= '>' . df_cdata_raw_if_needed($xs) . 'getName() . '>' . $nl; } else { $r .= '/>' . $nl; From d5ca904353bbb79b8688596031ad22887565556a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:31:23 +0100 Subject: [PATCH 074/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index 5d8c2c7a6..f2e92bde7 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -28,39 +28,36 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ $r .= " xsi:$k=\"$v\""; } }; - if ($x->hasChildren()) { - $r .= '>'; - $xs = trim((string)$x); - if (strlen($xs)) { + $xs = trim((string)$x); /** @var string $xs */ + $isEmpty = df_es($xs); /** @var bool $isEmpty */ + if (!$x->hasChildren()) { + if ($isEmpty) { + $r .= '/>' . $nl; + } + else { /** * 2021-12-16 * The previous code was: `$this->xmlentities($xs)` * @see \Magento\Framework\Simplexml\Element::xmlentities() */ - $r .= df_cdata_raw_if_needed($xs); - } - $r .= $nl; - foreach ($x->children() as $child) {/** @var CX $child */ - $r .= $child->asNiceXml('', is_numeric($level) ? $level + 1 : true); + $r .= '>' . df_cdata_raw_if_needed($xs) . 'getName() . '>' . $nl; } - $r .= $pad . 'getName() . '>' . $nl; } else { - $xs = (string)$x; - if (strlen($xs)) { + $r .= '>'; + if (!$isEmpty) { /** * 2021-12-16 * The previous code was: `$this->xmlentities($xs)` * @see \Magento\Framework\Simplexml\Element::xmlentities() */ - $r .= '>' . df_cdata_raw_if_needed($xs) . 'getName() . '>' . $nl; + $r .= df_cdata_raw_if_needed($xs); } - else { - $r .= '/>' . $nl; + $r .= $nl; + foreach ($x->children() as $child) {/** @var CX $child */ + $r .= df_xml_s($child, ++$level); } - } - if ((0 === $level || false === $level) && !empty($filename)) { - file_put_contents($filename, $r); + $r .= "$padgetName()}>$nl"; } } return $r; From aeb74630d03d7ea41377ee374be6815039774ff5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:34:21 +0100 Subject: [PATCH 075/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index f2e92bde7..5356dc943 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -31,17 +31,15 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ $xs = trim((string)$x); /** @var string $xs */ $isEmpty = df_es($xs); /** @var bool $isEmpty */ if (!$x->hasChildren()) { - if ($isEmpty) { - $r .= '/>' . $nl; - } - else { + $r .= $isEmpty + ? '/>' . $nl /** * 2021-12-16 * The previous code was: `$this->xmlentities($xs)` * @see \Magento\Framework\Simplexml\Element::xmlentities() */ - $r .= '>' . df_cdata_raw_if_needed($xs) . 'getName() . '>' . $nl; - } + : '>' . df_cdata_raw_if_needed($xs) . $nl "getName()}>$nl" + ; } else { $r .= '>'; From 591cdb461442ac21e86e62572e65862803db815c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:34:25 +0100 Subject: [PATCH 076/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index 5356dc943..359b70ffe 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -38,7 +38,7 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ * The previous code was: `$this->xmlentities($xs)` * @see \Magento\Framework\Simplexml\Element::xmlentities() */ - : '>' . df_cdata_raw_if_needed($xs) . $nl "getName()}>$nl" + : '>' . df_cdata_raw_if_needed($xs) . "getName()}>$nl" ; } else { From 81bc2407b2b79356b5c692878337c08ece189fbe Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:35:42 +0100 Subject: [PATCH 077/717] https://github.com/mage2pro/core/issues/436 --- Core/lib/empty.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/lib/empty.php b/Core/lib/empty.php index 8b5d84261..7c1ae9f42 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -11,6 +11,7 @@ * @used-by df_path_is_internal() * @used-by df_report() * @used-by df_result_sne() + * @used-by df_xml_s() * @used-by sift_prefix() * @used-by \Df\Config\Backend\Checkbox::dfSaveBefore() * @used-by \Df\Framework\Form\Element\Fieldset::color() From b0acb2560b5284eca33af2b3d9ce2adeed4e67c9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:36:06 +0100 Subject: [PATCH 078/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/cdata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index e18cf2d88..9fd83d2c2 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -10,7 +10,7 @@ function df_cdata(string $s):string {return X::markAsCData($s);} /** * 2021-12-16 - * @used-by \Df\Xml\G::asNiceXml() + * @used-by df_xml_s() */ function df_cdata_raw_if_needed(string $s):string {return !df_needs_cdata($s) ? $s : "";} From 7854e3b2ab36d961387ecfb0c03938ca8f1a40fc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:37:35 +0100 Subject: [PATCH 079/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 71 ------------------------------------------ Xml/lib/s/prettify.php | 2 +- 2 files changed, 1 insertion(+), 72 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 9c6a5f0cc..16934b1db 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -69,77 +69,6 @@ function addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */ return $r; } - /** - * 2016-09-01 Родительский метод задаёт вложенность тремя пробелами, а я предпочитаю символ табуляции. - * 2022-12-20 We can not declare arguments types because they are undeclared in the overriden method. - * @override - * @see \Magento\Framework\Simplexml\Element::asNiceXml() - * @used-by df_xml_g() - * @used-by df_xml_prettify() - * @used-by df_xml_s() - * @used-by self::asNiceXml() - * @param string $filename [optional] - * @param int $level [optional] - */ - function asNiceXml($filename = '', $level = 0):string { - if (is_numeric($level)) { - $pad = str_pad('', $level * 1, "\t", STR_PAD_LEFT); - $nl = "\n"; - } - else { - $pad = ''; - $nl = ''; - } - $r = $pad . '<' . $this->getName(); /** @var string $r */ - $attributes = $this->attributes(); - if ($attributes) { - foreach ($attributes as $key => $value) { - $r .= ' ' . $key . '="' . str_replace('"', '\"', (string)$value) . '"'; - } - } - $attributes = $this->attributes('xsi', true); - if ($attributes) { - foreach ($attributes as $key => $value) { - $r .= ' xsi:' . $key . '="' . str_replace('"', '\"', (string)$value) . '"'; - } - } - if ($this->hasChildren()) { - $r .= '>'; - $value = trim((string)$this); - if (strlen($value)) { - /** - * 2021-12-16 - * The previous code was: `$this->xmlentities($value)` - * @see \Magento\Framework\Simplexml\Element::xmlentities() - */ - $r .= df_cdata_raw_if_needed($value); - } - $r .= $nl; - foreach ($this->children() as $child) {/** @var G $child */ - $r .= $child->asNiceXml('', is_numeric($level) ? $level + 1 : true); - } - $r .= $pad . 'getName() . '>' . $nl; - } - else { - $value = (string)$this; - if (strlen($value)) { - /** - * 2021-12-16 - * The previous code was: `$this->xmlentities($value)` - * @see \Magento\Framework\Simplexml\Element::xmlentities() - */ - $r .= '>' . df_cdata_raw_if_needed($value) . 'getName() . '>' . $nl; - } - else { - $r .= '/>' . $nl; - } - } - if ((0 === $level || false === $level) && !empty($filename)) { - file_put_contents($filename, $r); - } - return $r; - } - /** * 2015-02-27 * Возвращает документ XML в виде текста без заголовка XML. diff --git a/Xml/lib/s/prettify.php b/Xml/lib/s/prettify.php index 53ddfd244..d41ec1a55 100644 --- a/Xml/lib/s/prettify.php +++ b/Xml/lib/s/prettify.php @@ -7,4 +7,4 @@ * @uses \Df\Xml\G::asNiceXml() не сохраняет заголовок XML. * @param G|string $x */ -function df_xml_prettify($x):string {return df_cc_n(df_xml_parse_header($x), df_xml_parse($x)->asNiceXml());} \ No newline at end of file +function df_xml_prettify($x):string {return df_cc_n(df_xml_parse_header($x), df_xml_s(df_xml_parse($x)));} \ No newline at end of file From 001ce8a7e34fea91cd93ee2efa7cdeb9ea26bc7e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:38:30 +0100 Subject: [PATCH 080/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/g.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xml/lib/g.php b/Xml/lib/g.php index d759a3b66..1ee9a06cd 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -43,11 +43,11 @@ */ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string { $h = $skipHeader ? '' : df_xml_header(); /** @var string $h */ - $x = df_xml_parse(df_cc_n($h, "<{$tag}/>")); /** @var X $x */ - $x->addAttributes($atts); - $x->importArray($contents); + $g = df_xml_parse(df_cc_n($h, "<{$tag}/>")); /** @var G $g */ + $g->addAttributes($atts); + $g->importArray($contents); # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 - return str_replace("\x0B", " ", $skipHeader ? $x->asXMLPart() : df_cc_n($h, $x->asNiceXml())); + return str_replace("\x0B", " ", $skipHeader ? $g->asXMLPart() : df_cc_n($h, df_xml_s($g))); } /** From 3423793dca98c90badb029b141f5c70ee74f344d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:41:18 +0100 Subject: [PATCH 081/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/s/.php | 1 + Xml/lib/s/prettify.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index 359b70ffe..441f0a311 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -4,6 +4,7 @@ /** * 2016-09-01 + * The result does not include the XML header. @see df_xml_header() * @see \Magento\Framework\Simplexml\Element::asNiceXml() * @used-by df_assert_leaf() * @used-by df_xml_children() diff --git a/Xml/lib/s/prettify.php b/Xml/lib/s/prettify.php index d41ec1a55..ab7ba75ed 100644 --- a/Xml/lib/s/prettify.php +++ b/Xml/lib/s/prettify.php @@ -4,7 +4,7 @@ /** * 2016-09-01 * @used-by \Dfe\SecurePay\Refund::process() - * @uses \Df\Xml\G::asNiceXml() не сохраняет заголовок XML. + * @uses df_xml_s() не сохраняет заголовок XML. * @param G|string $x */ function df_xml_prettify($x):string {return df_cc_n(df_xml_parse_header($x), df_xml_s(df_xml_parse($x)));} \ No newline at end of file From 79d03391619bb56bf5ad4902ca2eaeb109198e1e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:43:29 +0100 Subject: [PATCH 082/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/g.php | 1 - Xml/lib/s/.php | 3 +-- Xml/lib/s/prettify.php | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 1ee9a06cd..00980afca 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -2,7 +2,6 @@ use Df\Xml\G; /** - * @see \Magento\Framework\Simplexml\Element::asNiceXml() не добавляет к документу заголовок XML: его надо добавить вручную. * 2015-02-27 * Для конвертации объекта класса @see SimpleXMLElement в строку * надо использовать именно метод @uses SimpleXMLElement::asXML(), diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index 441f0a311..3dcc40251 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -3,8 +3,7 @@ use SimpleXMLElement as CX; /** - * 2016-09-01 - * The result does not include the XML header. @see df_xml_header() + * 2016-09-01 The result does not include the XML header. @see df_xml_header() * @see \Magento\Framework\Simplexml\Element::asNiceXml() * @used-by df_assert_leaf() * @used-by df_xml_children() diff --git a/Xml/lib/s/prettify.php b/Xml/lib/s/prettify.php index ab7ba75ed..015047d5f 100644 --- a/Xml/lib/s/prettify.php +++ b/Xml/lib/s/prettify.php @@ -4,7 +4,7 @@ /** * 2016-09-01 * @used-by \Dfe\SecurePay\Refund::process() - * @uses df_xml_s() не сохраняет заголовок XML. + * A result of @uses df_xml_s() does not include the XML header. * @param G|string $x */ function df_xml_prettify($x):string {return df_cc_n(df_xml_parse_header($x), df_xml_s(df_xml_parse($x)));} \ No newline at end of file From 84a0d63f1b138dfc8c3865f19d8e80c112801241 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:53:26 +0100 Subject: [PATCH 083/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/validation/assert/other.php | 4 ++-- Xml/G.php | 20 -------------------- Xml/lib/g.php | 2 +- Xml/lib/s/.php | 20 ++++++++++++++++++++ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Qa/lib/validation/assert/other.php b/Qa/lib/validation/assert/other.php index e87eae241..063a63ded 100644 --- a/Qa/lib/validation/assert/other.php +++ b/Qa/lib/validation/assert/other.php @@ -4,12 +4,12 @@ use Throwable as Th; # 2023-08-03 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 /** - * 2017-01-14 + * 2017-01-14 + * @used-by df_xml_s_simple() * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() * @used-by \Dfe\GoogleFont\Fonts\Png::colorAllocateAlpha() * @used-by \Dfe\GoogleFont\Fonts\Png::image() * @used-by \Dfe\GoogleFont\Fonts\Sprite::draw() - * @used-by \Df\Xml\G::asXMLPart() * @param mixed $v * @param string|Th $m [optional] * @return mixed diff --git a/Xml/G.php b/Xml/G.php index 16934b1db..3f8cdadcf 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -68,26 +68,6 @@ function addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */ catch (Th $th) {df_error("Tag <{$name}>. Value: «{$value}». Error: «%s».", df_xts($th));} return $r; } - - /** - * 2015-02-27 - * Возвращает документ XML в виде текста без заголовка XML. - * Раньше алгоритм был таким: - * str_replace('', '', $this->asXML()); - * Однако этот алгоритм неверен: ведь в заголовке XML может присутствовать указание кодировки, например: - * - * Новый алгоритм взят отсюда: http://stackoverflow.com/a/5947858 - * @used-by df_xml_g() - */ - function asXMLPart():string { - $dom = dom_import_simplexml($this); /** @var \DOMElement $dom */ - /** - * 2021-12-13 - * @uses \DOMDocument::saveXML() can return `false`: - * https://php.net/manual/domdocument.savexml.php#refsect1-domdocument.savexml-returnvalues - */ - return df_assert_nef($dom->ownerDocument->saveXML($dom->ownerDocument->documentElement)); - } /** * 1) Этот метод отличается от родительского только возвращением null вместо false в случае отсутствия значения. diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 00980afca..160233715 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -46,7 +46,7 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski $g->addAttributes($atts); $g->importArray($contents); # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 - return str_replace("\x0B", " ", $skipHeader ? $g->asXMLPart() : df_cc_n($h, df_xml_s($g))); + return str_replace("\x0B", " ", df_cc_n($skipHeader ? '' : $h, df_xml_s($g))); } /** diff --git a/Xml/lib/s/.php b/Xml/lib/s/.php index 3dcc40251..03262ce4a 100644 --- a/Xml/lib/s/.php +++ b/Xml/lib/s/.php @@ -59,4 +59,24 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ } } return $r; +} + +/** + * 2015-02-27 + * Возвращает документ XML в виде текста без заголовка XML. + * Раньше алгоритм был таким: + * str_replace('', '', $this->asXML()); + * Однако этот алгоритм неверен: ведь в заголовке XML может присутствовать указание кодировки, например: + * + * Новый алгоритм взят отсюда: http://stackoverflow.com/a/5947858 + * 2024-09-22 @deprecated + */ +function df_xml_s_simple(CX $x):string { + $dom = dom_import_simplexml($x); /** @var \DOMElement $dom */ + /** + * 2021-12-13 + * @uses \DOMDocument::saveXML() can return `false`: + * https://php.net/manual/domdocument.savexml.php#refsect1-domdocument.savexml-returnvalues + */ + return df_assert_nef($dom->ownerDocument->saveXML($dom->ownerDocument->documentElement)); } \ No newline at end of file From ed75d83c21490be980f4aaab552ba65c3ad52754 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:53:39 +0100 Subject: [PATCH 084/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/g.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 160233715..8ce9a0846 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -57,7 +57,7 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski * @param array(string => mixed) $contents [optional] */ function df_xml_node(string $tag, array $attr = [], array $contents = []):X { - $r = df_xml_parse("<{$tag}/>"); /** @var X $r */ + $r = df_xml_parse("<{$tag}/>"); /** @var G $r */ $r->addAttributes($attr); $r->importArray($contents); return $r; From 946196a6350b12d95dae9e371b1411f64ab6b373 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:53:50 +0100 Subject: [PATCH 085/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/g.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 8ce9a0846..7255495d1 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -56,7 +56,7 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski * @param array(string => string) $attr [optional] * @param array(string => mixed) $contents [optional] */ -function df_xml_node(string $tag, array $attr = [], array $contents = []):X { +function df_xml_node(string $tag, array $attr = [], array $contents = []):G { $r = df_xml_parse("<{$tag}/>"); /** @var G $r */ $r->addAttributes($attr); $r->importArray($contents); From 69e46c022ea5e9431dc0a910445f7377324eb29c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:54:41 +0100 Subject: [PATCH 086/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 3f8cdadcf..5c7e22cbf 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -84,9 +84,8 @@ function addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */ * @override * @see \Magento\Framework\Simplexml\Element::descend() * @param string|string[] $p - * @return X|null */ - function descend($p) {return df_ftn(parent::descend($p));} + function descend($p):?self {return df_ftn(parent::descend($p));} /** * @used-by df_xml_g() From 8eaf90c00aa71ac750aff2007ad948637d8bf850 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:55:02 +0100 Subject: [PATCH 087/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 5c7e22cbf..703287c5b 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -94,7 +94,7 @@ function descend($p):?self {return df_ftn(parent::descend($p));} * @param array(string => mixed) $array * @param string[]|bool $wrapInCData [optional] */ - function importArray(array $array, $wrapInCData = []):G { + function importArray(array $array, $wrapInCData = []):self { foreach ($array as $key => $v) { /** @var string $key */ /** @var mixed $v */ if ($v instanceof G) { /** From a3932e8ea386e859d95b22f991e1a93bab0d269a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 01:59:09 +0100 Subject: [PATCH 088/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 703287c5b..930741541 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -60,10 +60,9 @@ function addAttributes(array $atts):void { * @param string $name * @param string|null $value [optional] * @param string|null $namespace [optional] - * @return CX */ #[\ReturnTypeWillChange] - function addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */ + function addChild($name, $value = null, $namespace = null):?CX {/** @var CX $r */ try {$r = parent::addChild($this->k($name), $value, $namespace);} catch (Th $th) {df_error("Tag <{$name}>. Value: «{$value}». Error: «%s».", df_xts($th));} return $r; From a08ad4846e267d5428722133976e5661f2e931be Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:00:25 +0100 Subject: [PATCH 089/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 930741541..fa59d3260 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -48,6 +48,8 @@ function addAttributes(array $atts):void { } /** + * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, + * а объект класса родителя. * 2022-11-15 * 1) `static` as a return type is not supported by PHP < 8: https://github.com/mage2pro/core/issues/168#user-content-static * 2) We can not declare the $name argument type with PHP < 8: https://3v4l.org/ptpUM @@ -62,7 +64,7 @@ function addAttributes(array $atts):void { * @param string|null $namespace [optional] */ #[\ReturnTypeWillChange] - function addChild($name, $value = null, $namespace = null):?CX {/** @var CX $r */ + function addChild($name, $value = null, $namespace = null):self {/** @var self $r */ try {$r = parent::addChild($this->k($name), $value, $namespace);} catch (Th $th) {df_error("Tag <{$name}>. Value: «{$value}». Error: «%s».", df_xts($th));} return $r; From 6eadd67c0055ee9288a26d1e79a7c989967e21e2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:06:30 +0100 Subject: [PATCH 090/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 107 ------------------------------------------------------ 1 file changed, 107 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index fa59d3260..a005733e4 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -427,113 +427,6 @@ private function setValue($v):self {$this[0] = $v; return $v;} /** @used-by self::importArray() */ const CONTENT = '_content'; - /** - * Этот метод разработал сам, но не тестировал, - * потому что после разработки только заметил, - * что применять его к стандартным файлам XML (@see Mage::getConfig()) всё равно нельзя: - * в стандартном мега-файле, возвращаемом Mage::getConfig(), - * одноимённые дочерние узлы уже отсутствуют (перетёрты друг другом). - * - * Отличие от стандартного метода @see asArray(): - * если дерево XML содержит несколько одноимённых дочерних узлов, - * то родительский метод при конвертации дерева XML в массив - * перетирает содержимое дочерних узлов друг другом: - * @see \Magento\Framework\Simplexml\Element::_asArray(): - * $result[$childName] = $child->_asArray($isCanonical); - * Например, дерево XML - * - * http://fortis.magento-demo.ru/default/ - * http://fortis.magento-demo.ru/second/ - * http://fortis.magento-demo.ru/third/ - * http://fortis.magento-demo.ru/fourth/ - * http://fortis.magento-demo.ru/fifth/ - * http://fortis.infortis-themes.com/demo/ - * http://magento-forum.ru/forum/350/ - * http://themeforest.net/item/fortis-responsive-magento-theme/1744309?ref=dfediuk - * - * будет сконвертировано в такой массив: - * [url] => Array - * ( - * [demo] => http://fortis.magento-demo.ru/fifth/ - * [demo_images_base] => http://fortis.infortis-themes.com/demo/ - * [forum] => http://magento-forum.ru/forum/350/ - * [official_site] => http://themeforest.net/item/fortis-responsive-magento-theme/1744309?ref=dfediuk - * ) - * Обратите внимание, что содержимым ключа «demo» массива - * стало содержимое последнего (по порядку следования) дочернего узла исходного дерева XML: - * http://fortis.magento-demo.ru/fifth/ - * - * Наш метод @see asMultiArray() - * при наличии в исходном дереве XML нескольких одноимённых дочерних узлов - * добавляет их все в массив, создавая подмассив: - * [url] => Array - * ( - * [demo] => Array - * ( - * [0] => http://fortis.magento-demo.ru/default/ - * [1] => http://fortis.magento-demo.ru/second/ - * [2] => http://fortis.magento-demo.ru/third/ - * [3] => http://fortis.magento-demo.ru/fourth/ - * [4] => http://fortis.magento-demo.ru/fifth/ - * ) - * [demo_images_base] => http://fortis.infortis-themes.com/demo/ - * [forum] => http://magento-forum.ru/forum/350/ - * [official_site] => http://themeforest.net/item/fortis-responsive-magento-theme/1744309?ref=dfediuk - * ) - * - * @return array(string => string|array) - */ - static function asMultiArray(MX $e, bool $isCanonical = true):array { - $r = []; /** @var array(string => string|array) $r */ - if (!$e->hasChildren()) { - /** Просто повторяем алгоритм метода @see \Magento\Framework\Simplexml\Element::_asArray() */ - $r = $e->_asArray($isCanonical); - } - elseif (!$isCanonical) { - /** Просто повторяем алгоритм метода @see \Magento\Framework\Simplexml\Element::_asArray() */ - foreach ($e->attributes() as $attributeName => $attribute) { - /** @var string $attributeName */ - /** @var MX $attribute */ - if ($attribute) { - $r['@'][$attributeName] = (string)$attribute; - } - } - } - else { - /** - * Обратите внимание, что, - * в отличие от метода @see \Magento\Framework\Simplexml\Element::_asArray(), - * мы не можем использовать синтаксис - * foreach ($e->children() as $childName => $child) { - * потому что при таком синтаксисе мы не сможем получить доступ - * ко всем одноимённым дочерним узлам. - */ - foreach ($e->children() as $child) { - /** @var MX $child */ - /** @var string $childName */ - $childName = $child->getName(); - /** @var array(string => string|array) $childAsArray */ - $childAsArray = self::asMultiArray($child, $isCanonical); - if (!isset($r[$childName])) { - /** - * Просто повторяем алгоритм метода - * @see \Magento\Framework\Simplexml\Element::_asArray() - */ - $r[$childName] = $childAsArray; - } - else { - # у нас уже есть дочерний узел с данным именем - if (!is_array($r[$childName])) { - # преобразуем узел в массив - $r[$childName] = [$r[$childName]]; - } - $r[$childName][] = $childAsArray; - } - } - } - return $r; - } - /** * Убрал df_param_s и df_result_s для ускорения работы модуля Яндекс.Маркет * @used-by df_cdata() From 48b52314781cef87364f6dfc41151176d77cdb99 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:07:27 +0100 Subject: [PATCH 091/717] https://github.com/mage2pro/core/issues/436 --- Core/lib/empty.php | 1 - Xml/G.php | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/Core/lib/empty.php b/Core/lib/empty.php index 7c1ae9f42..5ae7e945c 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -107,7 +107,6 @@ function df_fnes($v):bool {return is_null($v) || '' === $v || false === $v;} /** * @used-by df_fetch_one() * @used-by df_parent_name() - * @used-by \Df\Xml\G::descend() * @used-by \Dfe\Stripe\Init\Action::need3DS() * @param mixed|false $v * @return mixed|null diff --git a/Xml/G.php b/Xml/G.php index a005733e4..a688032a0 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -69,24 +69,6 @@ function addChild($name, $value = null, $namespace = null):self {/** @var self $ catch (Th $th) {df_error("Tag <{$name}>. Value: «{$value}». Error: «%s».", df_xts($th));} return $r; } - - /** - * 1) Этот метод отличается от родительского только возвращением null вместо false в случае отсутствия значения. - * Мы можем так делать, потому что родительский класс сам внутри себя не использует метод descend - * (и, соответственно, не полагается на возвращение значения false). - * 2) Интерпретатор PHP не разрешает присваивать полям объектов класса CX (и его наследников) значения сложных типов. - * Такое присваивание приводит к сбою: «Warning: It is not yet possible to assign complex types to attributes». - * По этой причине не используем кэширование результата. - * 3) В комментарии к свойству @see \Magento\Framework\Simplexml\Element::$_parent - * дана рекомендация использования функции @see spl_object_hash(), однако это слишком сложно, - * и неочевидно, ускорит ли работу системы (также могут быть проблемы с расходом оперативной памяти). - * 2022-11-15 @deprecated It is unused. - * 2022-11-26 We can not declare the $path argument type because it is undeclared in the overriden method. - * @override - * @see \Magento\Framework\Simplexml\Element::descend() - * @param string|string[] $p - */ - function descend($p):?self {return df_ftn(parent::descend($p));} /** * @used-by df_xml_g() From acf26f12b624c87001a14f983e682e9a04e70b2a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:09:29 +0100 Subject: [PATCH 092/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 23 ----------------------- Xml/lib/leaf/get/s.php | 1 - 2 files changed, 24 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index a688032a0..db10438e6 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -274,29 +274,6 @@ function xpathA($path):array { return parent::xpath($path); } - /** - * 2015-08-08 - * Преобразует структуру вида: - * <СтавкиНалогов> - * <СтавкаНалога> - * <Наименование>НДС - * <Ставка>10 - * - * - * в массив array('НДС' => '10') - * 2022-10-25 @deprecated It is unused. - * @see self::map() - * @return array(string => string) - */ - function xpathMap(string $path, string $keyName, string $valueName):array { - $r = []; /** @var array(string => string) $r */ - $nodes = $this->xpathA($path); /** @var G[] $nodes */ - foreach ($nodes as $node) { /** @var G $node */ - $r[df_leaf_sne($node->{$keyName})] = df_leaf_s($node->{$valueName}); - } - return $r; - } - /** @used-by self::importString() */ private function addChildText(string $tag, string $valueAsText):void { $r = $this->addChild($tag); /** @var G $r */ diff --git a/Xml/lib/leaf/get/s.php b/Xml/lib/leaf/get/s.php index c604b1322..0e6bfed74 100644 --- a/Xml/lib/leaf/get/s.php +++ b/Xml/lib/leaf/get/s.php @@ -5,7 +5,6 @@ /** * @used-by df_leaf_sne() * @used-by \Df\Xml\G::map() - * @used-by \Df\Xml\G::xpathMap() * @used-by \Dfe\Robokassa\Api\Options::p() * @param string|callable $d [optional] */ From 71fedcdb5c9da98377e990e0f4b5c20874f843d2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:09:35 +0100 Subject: [PATCH 093/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/leaf/get/s.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Xml/lib/leaf/get/s.php b/Xml/lib/leaf/get/s.php index 0e6bfed74..b11dac316 100644 --- a/Xml/lib/leaf/get/s.php +++ b/Xml/lib/leaf/get/s.php @@ -12,7 +12,6 @@ function df_leaf_s(?CX $e = null, $d = ''):string {return (string)df_leaf($e, $d /** * @used-by \Df\Xml\G::map() - * @used-by \Df\Xml\G::xpathMap() * @used-by \Dfe\SecurePay\Refund::process() * @param string|callable $d [optional] */ From 669007df53aefbb01326937e4095ec95862c9d12 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:11:39 +0100 Subject: [PATCH 094/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 24 ------------------------ Xml/lib/leaf/get/s.php | 2 -- 2 files changed, 26 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index db10438e6..b2bc09ee3 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -215,29 +215,6 @@ function importArray(array $array, $wrapInCData = []):self { return $this; } - /** - * 2015-08-08 - * Преобразует структуру вида: - * <СтавкиНалогов> - * <СтавкаНалога> - * <Наименование>НДС - * <Ставка>10 - * - * - * в массив array('НДС' => '10') - * 2022-10-25 @deprecated It is unused. - * @see self::xpathMap() - * @return array(string => string) - */ - function map(string $path, string $keyName, string $valueName):array { - $r = []; /** @var array(string => string) $r */ - $nodes = $this->xpathA($path); /** @var G[] $nodes */ - foreach ($nodes as $node) {/** @var G $node */ - $r[df_leaf_sne($node->{$keyName})] = df_leaf_s($node->{$valueName}); - } - return $r; - } - /** * 2022-11-15 @deprecated It is unused. * @override @@ -259,7 +236,6 @@ function xpath($p):array { /** * 2022-12-05: We do not need to check that the result is an array: https://3v4l.org/pBUvg * @used-by self::map() - * @used-by self::xpathMap() * @param string|string[] $path * @return G[] */ diff --git a/Xml/lib/leaf/get/s.php b/Xml/lib/leaf/get/s.php index b11dac316..fa8612659 100644 --- a/Xml/lib/leaf/get/s.php +++ b/Xml/lib/leaf/get/s.php @@ -4,14 +4,12 @@ /** * @used-by df_leaf_sne() - * @used-by \Df\Xml\G::map() * @used-by \Dfe\Robokassa\Api\Options::p() * @param string|callable $d [optional] */ function df_leaf_s(?CX $e = null, $d = ''):string {return (string)df_leaf($e, $d);} /** - * @used-by \Df\Xml\G::map() * @used-by \Dfe\SecurePay\Refund::process() * @param string|callable $d [optional] */ From d653b1ca38f44fcc2c1bcee53abb8cf773122566 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:12:07 +0100 Subject: [PATCH 095/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/validation/param.php | 2 -- Xml/G.php | 18 ------------------ 2 files changed, 20 deletions(-) diff --git a/Qa/lib/validation/param.php b/Qa/lib/validation/param.php index e992c5578..1256cd518 100644 --- a/Qa/lib/validation/param.php +++ b/Qa/lib/validation/param.php @@ -20,8 +20,6 @@ function df_param_iso2(string $v, int $ord, int $sl = 0):string {return Q::asser * @used-by dfa_deep_unset() * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() * @used-by \Df\Payment\W\Nav::e2i() - * @used-by \Df\Xml\G::xpath() - * @used-by \Df\Xml\G::xpathA() * @used-by \Dfe\AllPay\W\Event::tl_() * @used-by \Dfe\Markdown\DbRecord::__construct() * @throws DFE diff --git a/Xml/G.php b/Xml/G.php index b2bc09ee3..e1abf5bd8 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -215,24 +215,6 @@ function importArray(array $array, $wrapInCData = []):self { return $this; } - /** - * 2022-11-15 @deprecated It is unused. - * @override - * @see \SimpleXMLElement::xpath() - * @param string|string[] $p - * @return G[] - */ - #[\ReturnTypeWillChange] - function xpath($p):array { - if (1 < func_num_args()) { - $p = df_cc_path(func_get_args()); - } - elseif (is_array($p)) { - $p = df_cc_path($p); - } - return parent::xpath(df_param_sne($p, 0)); - } - /** * 2022-12-05: We do not need to check that the result is an array: https://3v4l.org/pBUvg * @used-by self::map() From d1c8cda48941a8b66128bb4158a3c9c89057c3e2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:12:27 +0100 Subject: [PATCH 096/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index e1abf5bd8..a9bbfa4fe 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -215,23 +215,6 @@ function importArray(array $array, $wrapInCData = []):self { return $this; } - /** - * 2022-12-05: We do not need to check that the result is an array: https://3v4l.org/pBUvg - * @used-by self::map() - * @param string|string[] $path - * @return G[] - */ - function xpathA($path):array { - if (1 < func_num_args()) { - $path = df_cc_path(func_get_args()); - } - elseif (is_array($path)) { - $path = df_cc_path($path); - } - df_param_sne($path, 0); - return parent::xpath($path); - } - /** @used-by self::importString() */ private function addChildText(string $tag, string $valueAsText):void { $r = $this->addChild($tag); /** @var G $r */ From d34a00529974f58583be4de070403d4ab1cf4a63 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:14:04 +0100 Subject: [PATCH 097/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/cdata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 9fd83d2c2..7cec0c87f 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -6,7 +6,7 @@ * @used-by df_clean_xml() * @used-by \Dfe\SecurePay\Refund::process() */ -function df_cdata(string $s):string {return X::markAsCData($s);} +function df_cdata(string $s):string {return G::markAsCData($s);} /** * 2021-12-16 From 7d6c0e33c2706360994691aa258725bf3506535a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:15:11 +0100 Subject: [PATCH 098/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/child.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index b645a9d4b..88fdee18e 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -1,13 +1,13 @@ Date: Sun, 22 Sep 2024 02:15:53 +0100 Subject: [PATCH 099/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/exists.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index e45c32f11..22f170dcd 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -1,5 +1,5 @@ {$child});} \ No newline at end of file +function df_xml_exists_child(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file From 402b859067ebdc13b6a52a5f768159afb96e8210 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:19:27 +0100 Subject: [PATCH 100/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/parse/a.php | 33 ++++++++++++++++++++++++++ Xml/lib/{parse.php => parse/other.php} | 28 ---------------------- 2 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 Xml/lib/parse/a.php rename Xml/lib/{parse.php => parse/other.php} (61%) diff --git a/Xml/lib/parse/a.php b/Xml/lib/parse/a.php new file mode 100644 index 000000000..8ae7abdb9 --- /dev/null +++ b/Xml/lib/parse/a.php @@ -0,0 +1,33 @@ + + * 82924701437133501 + * f838868475 + * 000 + * <...> + * + * will be converted to: + * { + * "@": { + * "customerId": "admin@mage2.pro", + * "reportGroup": "1272532" + * }, + * "litleTxnId": "82924701437133501", + * "orderId": "f838868475", + * "response": "000", + * <...> + * } + * @used-by \Dfe\Vantiv\API\Client::_construct() + * @param string|X $x + * @return array(string => mixed) + * @throws E + */ +function df_xml_parse_a($x):array {return df_xml_parse($x)->asArray();} \ No newline at end of file diff --git a/Xml/lib/parse.php b/Xml/lib/parse/other.php similarity index 61% rename from Xml/lib/parse.php rename to Xml/lib/parse/other.php index 90359b484..dd1fda0c6 100644 --- a/Xml/lib/parse.php +++ b/Xml/lib/parse/other.php @@ -33,34 +33,6 @@ function df_xml_parse($x, bool $throw = true):?X {/** @var ?X $r */ return $r; } -/** - * 2018-12-19 - * @uses \Magento\Framework\Simplexml\Element::asArray() returns XML tag's attributes - * inside an `@` key, e.g: - * - * 82924701437133501 - * f838868475 - * 000 - * <...> - * - * will be converted to: - * { - * "@": { - * "customerId": "admin@mage2.pro", - * "reportGroup": "1272532" - * }, - * "litleTxnId": "82924701437133501", - * "orderId": "f838868475", - * "response": "000", - * <...> - * } - * @used-by \Dfe\Vantiv\API\Client::_construct() - * @param string|X $x - * @return array(string => mixed) - * @throws E - */ -function df_xml_parse_a($x):array {return df_xml_parse($x)->asArray();} - /** * 2016-09-01 * Если XML не отформатирован, то после его заголовка перенос строки идти не обязан: http://stackoverflow.com/a/8384602 From cbca42ef2e6fd6550526cf60a157f01f611ff5b4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:20:01 +0100 Subject: [PATCH 101/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/parse/other.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xml/lib/parse/other.php b/Xml/lib/parse/other.php index dd1fda0c6..ef1c00983 100644 --- a/Xml/lib/parse/other.php +++ b/Xml/lib/parse/other.php @@ -13,17 +13,17 @@ * @used-by df_xml_x() * @used-by \Dfe\Robokassa\Api\Options::p() * @used-by \Dfe\SecurePay\Refund::process() - * @param X|string $x + * @param G|string $x * @throws E */ -function df_xml_parse($x, bool $throw = true):?X {/** @var ?X $r */ - if ($x instanceof X) { +function df_xml_parse($x, bool $throw = true):?G {/** @var ?G $r */ + if ($x instanceof G) { $r = $x; } else { df_param_sne($x, 0); $r = null; - try {$r = new X($x);} + try {$r = new G($x);} catch (T $t) { if ($throw) { df_error("Failed to parse XML: «%s».\nXML:\n%s", df_xts($t), df_trim($x)); From 5e5296172f522d7818b0d90675c2e464f45dc1fa Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 02:20:23 +0100 Subject: [PATCH 102/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/parse/other.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/parse/other.php b/Xml/lib/parse/other.php index ef1c00983..5041506a5 100644 --- a/Xml/lib/parse/other.php +++ b/Xml/lib/parse/other.php @@ -46,6 +46,6 @@ function df_xml_parse_header($x) {return df_preg_match('#^<\?xml.*\?>#', df_xml_ * 2016-09-01 * 2021-12-02 @deprecated It is unused. * @see df_xml_s() - * @param string|X $x + * @param G|string $x */ -function df_xml_x($x):X {return $x instanceof X ? $x : df_xml_parse($x);} \ No newline at end of file +function df_xml_x($x):X {return $x instanceof G ? $x : df_xml_parse($x);} \ No newline at end of file From 66da4a3ac8c8e7c7302b1e3308504e2bf4d92556 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:25:33 +0100 Subject: [PATCH 103/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/{g.php => g/.php} | 0 Xml/lib/{parse => parsing}/a.php | 0 Xml/lib/{parse => parsing}/other.php | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{g.php => g/.php} (100%) rename Xml/lib/{parse => parsing}/a.php (100%) rename Xml/lib/{parse => parsing}/other.php (100%) diff --git a/Xml/lib/g.php b/Xml/lib/g/.php similarity index 100% rename from Xml/lib/g.php rename to Xml/lib/g/.php diff --git a/Xml/lib/parse/a.php b/Xml/lib/parsing/a.php similarity index 100% rename from Xml/lib/parse/a.php rename to Xml/lib/parsing/a.php diff --git a/Xml/lib/parse/other.php b/Xml/lib/parsing/other.php similarity index 100% rename from Xml/lib/parse/other.php rename to Xml/lib/parsing/other.php From e64e32c82497f4f12b7d8838dd7bff432b359cff Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:28:49 +0100 Subject: [PATCH 104/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/g/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/g/.php b/Xml/lib/g/.php index 7255495d1..52f443f43 100644 --- a/Xml/lib/g/.php +++ b/Xml/lib/g/.php @@ -42,7 +42,7 @@ */ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string { $h = $skipHeader ? '' : df_xml_header(); /** @var string $h */ - $g = df_xml_parse(df_cc_n($h, "<{$tag}/>")); /** @var G $g */ + $g = df_xml_parse("$h\n<{$tag}/>"); /** @var G $g */ $g->addAttributes($atts); $g->importArray($contents); # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 From 72b5b73392bbd2440ec71ad4dafd556ec2038951 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:32:19 +0100 Subject: [PATCH 105/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{ => g}/s/.php | 0 Xml/lib/{ => g}/s/header.php | 0 Xml/lib/{ => g}/s/prettify.php | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{ => g}/s/.php (100%) rename Xml/lib/{ => g}/s/header.php (100%) rename Xml/lib/{ => g}/s/prettify.php (100%) diff --git a/Xml/lib/s/.php b/Xml/lib/g/s/.php similarity index 100% rename from Xml/lib/s/.php rename to Xml/lib/g/s/.php diff --git a/Xml/lib/s/header.php b/Xml/lib/g/s/header.php similarity index 100% rename from Xml/lib/s/header.php rename to Xml/lib/g/s/header.php diff --git a/Xml/lib/s/prettify.php b/Xml/lib/g/s/prettify.php similarity index 100% rename from Xml/lib/s/prettify.php rename to Xml/lib/g/s/prettify.php From f2ae8304462589182ecfdfb1004e6a924cfa0880 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:34:21 +0100 Subject: [PATCH 106/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{g/s => transform}/prettify.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{g/s => transform}/prettify.php (100%) diff --git a/Xml/lib/g/s/prettify.php b/Xml/lib/transform/prettify.php similarity index 100% rename from Xml/lib/g/s/prettify.php rename to Xml/lib/transform/prettify.php From 5340c243403b5e15907f0a22e9a3dd1ddfc3c496 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:35:13 +0100 Subject: [PATCH 107/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/transform/prettify.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/transform/prettify.php b/Xml/lib/transform/prettify.php index 015047d5f..faa1d995b 100644 --- a/Xml/lib/transform/prettify.php +++ b/Xml/lib/transform/prettify.php @@ -1,10 +1,10 @@ Date: Sun, 22 Sep 2024 16:35:32 +0100 Subject: [PATCH 108/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/transform/prettify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/transform/prettify.php b/Xml/lib/transform/prettify.php index faa1d995b..a8bbd3c69 100644 --- a/Xml/lib/transform/prettify.php +++ b/Xml/lib/transform/prettify.php @@ -4,7 +4,7 @@ /** * 2016-09-01 * @used-by \Dfe\SecurePay\Refund::process() - * A result of @uses df_xml_s() does not include the XML header. + * The output of @uses df_xml_s() does not include the XML header. * @param X|string $x */ function df_xml_prettify($x):string {return df_cc_n(df_xml_parse_header($x), df_xml_s(df_xml_parse($x)));} \ No newline at end of file From 5a9b648bfba493dd26fb4805c7f2732866563efc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:38:21 +0100 Subject: [PATCH 109/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/.php | 42 +++++++++++++++++++++++++++++++++++++++ Xml/lib/parsing/other.php | 39 +----------------------------------- 2 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 Xml/lib/parsing/.php diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php new file mode 100644 index 000000000..3e253acbc --- /dev/null +++ b/Xml/lib/parsing/.php @@ -0,0 +1,42 @@ +#', df_xml_s($x));} - -/** - * 2016-09-01 - * 2021-12-02 @deprecated It is unused. - * @see df_xml_s() - * @param G|string $x - */ -function df_xml_x($x):X {return $x instanceof G ? $x : df_xml_parse($x);} \ No newline at end of file +function df_xml_parse_header($x) {return df_preg_match('#^<\?xml.*\?>#', df_xml_s($x));} \ No newline at end of file From 4f083ab3d3f20e3e88daef2f0049e7f2e8d50a1d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:39:47 +0100 Subject: [PATCH 110/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/text/trim.php | 2 +- Framework/lib/module/fs/name.php | 2 +- Qa/lib/exception.php | 2 +- Qa/lib/validation/error.php | 2 +- Qa/lib/validation/param.php | 2 +- Xml/lib/g/.php | 4 ++-- Xml/lib/parsing/.php | 12 ++---------- Xml/lib/parsing/a.php | 2 +- Xml/lib/transform/prettify.php | 2 +- 9 files changed, 11 insertions(+), 19 deletions(-) diff --git a/Core/lib/text/trim.php b/Core/lib/text/trim.php index eef8bde89..60d71bd0f 100644 --- a/Core/lib/text/trim.php +++ b/Core/lib/text/trim.php @@ -37,7 +37,7 @@ function df_chop(string $s, int $max = 0):string {return !$max || (mb_strlen($s * @used-by df_parse_colon() * @used-by df_trim() * @used-by df_trim_ds() - * @used-by df_xml_parse() + * @used-by df_xml_x() * @used-by \Df\Config\Source\LetterCase::apply() * @used-by \Df\Core\Html\Tag::content() * @used-by \Df\Framework\Form\Element::uidSt() diff --git a/Framework/lib/module/fs/name.php b/Framework/lib/module/fs/name.php index 6f0cd8591..40daf83e2 100644 --- a/Framework/lib/module/fs/name.php +++ b/Framework/lib/module/fs/name.php @@ -114,7 +114,7 @@ function df_module_name_by_path(string $f):string {/** @var string $r */ else { $p = df_cc_path('vendor', $a, 'etc/module.xml'); # 2023-07-26 "`df_contents()` should accept internal paths": https://github.com/mage2pro/core/issues/273 - $x = df_xml_parse(df_contents($p)); + $x = df_xml_x(df_contents($p)); $r = (string)$x->{'module'}['name']; } } diff --git a/Qa/lib/exception.php b/Qa/lib/exception.php index 292365ffc..d9181dc84 100644 --- a/Qa/lib/exception.php +++ b/Qa/lib/exception.php @@ -83,7 +83,7 @@ function df_xf(T $t):T {while ($t->getPrevious()) {$t = $t->getPrevious();} retu * @used-by df_message_error() * @used-by df_sprintf_strict() * @used-by df_th2x() - * @used-by df_xml_parse() + * @used-by df_xml_x() * @used-by \Df\API\Client::_p() * @used-by \Df\Core\Exception::__construct() * @used-by \Df\Config\Source\API::exception() diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index 11c98e3c0..3dfb17a9b 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -90,7 +90,7 @@ function df_abstract($caller):void { * @used-by df_subscriber() * @used-by df_try() * @used-by df_xml_children() - * @used-by df_xml_parse() + * @used-by df_xml_x() * @used-by dfa_assert_keys() * @used-by dfaf() * @used-by dfc() diff --git a/Qa/lib/validation/param.php b/Qa/lib/validation/param.php index 1256cd518..06936cfbb 100644 --- a/Qa/lib/validation/param.php +++ b/Qa/lib/validation/param.php @@ -15,7 +15,7 @@ function df_param_iso2(string $v, int $ord, int $sl = 0):string {return Q::asser * @used-by df_eav_update() * @used-by df_fs_delete() * @used-by df_xml_children() - * @used-by df_xml_parse() + * @used-by df_xml_x() * @used-by dfa_deep() * @used-by dfa_deep_unset() * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() diff --git a/Xml/lib/g/.php b/Xml/lib/g/.php index 52f443f43..5eebc990d 100644 --- a/Xml/lib/g/.php +++ b/Xml/lib/g/.php @@ -42,7 +42,7 @@ */ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string { $h = $skipHeader ? '' : df_xml_header(); /** @var string $h */ - $g = df_xml_parse("$h\n<{$tag}/>"); /** @var G $g */ + $g = df_xml_x("$h\n<{$tag}/>"); /** @var G $g */ $g->addAttributes($atts); $g->importArray($contents); # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 @@ -57,7 +57,7 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski * @param array(string => mixed) $contents [optional] */ function df_xml_node(string $tag, array $attr = [], array $contents = []):G { - $r = df_xml_parse("<{$tag}/>"); /** @var G $r */ + $r = df_xml_x("<{$tag}/>"); /** @var G $r */ $r->addAttributes($attr); $r->importArray($contents); return $r; diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 3e253acbc..dc00838c7 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -16,7 +16,7 @@ * @param X|string $x * @throws E */ -function df_xml_parse($x, bool $throw = true):?X {/** @var ?X $r */ +function df_xml_x($x, bool $throw = true):?X {/** @var ?X $r */ if ($x instanceof X) { $r = $x; } @@ -31,12 +31,4 @@ function df_xml_parse($x, bool $throw = true):?X {/** @var ?X $r */ } } return $r; -} - -/** - * 2016-09-01 - * 2021-12-02 @deprecated It is unused. - * @see df_xml_s() - * @param G|string $x - */ -function df_xml_x($x):X {return $x instanceof G ? $x : df_xml_parse($x);} \ No newline at end of file +} \ No newline at end of file diff --git a/Xml/lib/parsing/a.php b/Xml/lib/parsing/a.php index 8ae7abdb9..193d56e66 100644 --- a/Xml/lib/parsing/a.php +++ b/Xml/lib/parsing/a.php @@ -30,4 +30,4 @@ * @return array(string => mixed) * @throws E */ -function df_xml_parse_a($x):array {return df_xml_parse($x)->asArray();} \ No newline at end of file +function df_xml_parse_a($x):array {return df_xml_x($x)->asArray();} \ No newline at end of file diff --git a/Xml/lib/transform/prettify.php b/Xml/lib/transform/prettify.php index a8bbd3c69..424876acb 100644 --- a/Xml/lib/transform/prettify.php +++ b/Xml/lib/transform/prettify.php @@ -7,4 +7,4 @@ * The output of @uses df_xml_s() does not include the XML header. * @param X|string $x */ -function df_xml_prettify($x):string {return df_cc_n(df_xml_parse_header($x), df_xml_s(df_xml_parse($x)));} \ No newline at end of file +function df_xml_prettify($x):string {return df_cc_n(df_xml_parse_header($x), df_xml_s(df_xml_x($x)));} \ No newline at end of file From e12140c75646162ea3554ea742c484f4aa81d37a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:40:16 +0100 Subject: [PATCH 111/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index dc00838c7..afa86da9b 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -1,6 +1,5 @@ Date: Sun, 22 Sep 2024 16:41:28 +0100 Subject: [PATCH 112/717] https://github.com/mage2pro/core/issues/437 --- Framework/lib/module/fs/name.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Framework/lib/module/fs/name.php b/Framework/lib/module/fs/name.php index 40daf83e2..0f99973ca 100644 --- a/Framework/lib/module/fs/name.php +++ b/Framework/lib/module/fs/name.php @@ -1,6 +1,7 @@ {'module'}['name']; } } From 3c2559dbe891533f3611f29c3a668e4199f76297 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:50:14 +0100 Subject: [PATCH 113/717] https://github.com/mage2pro/core/issues/437 --- Framework/lib/module/fs/name.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Framework/lib/module/fs/name.php b/Framework/lib/module/fs/name.php index 0f99973ca..46bc3a1c7 100644 --- a/Framework/lib/module/fs/name.php +++ b/Framework/lib/module/fs/name.php @@ -116,6 +116,11 @@ function df_module_name_by_path(string $f):string {/** @var string $r */ $p = df_cc_path('vendor', $a, 'etc/module.xml'); # 2023-07-26 "`df_contents()` should accept internal paths": https://github.com/mage2pro/core/issues/273 $x = df_xml_x(df_contents($p)); /** @var X $x */ + # 2024-09-22 + # An example: + # + # + # https://github.com/mage2pro/core/blob/11.4.1/Xml/etc/module.xml#L2-L6 $r = (string)$x->{'module'}['name']; } } From df6e68c0774122969a86e19d50e7f477135b9380 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 16:57:13 +0100 Subject: [PATCH 114/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 1 + Xml/lib/parsing/.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index a9bbfa4fe..a1e5b01fe 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -5,6 +5,7 @@ use \SimpleXMLElement as CX; use \Throwable as Th; # 2023-08-03 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311 # 2024-09-22 "Refactor `Df\Xml\X`": https://github.com/mage2pro/core/issues/436 +/** @used-by df_xml_x() */ final class G extends MX { /** */ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index afa86da9b..bed544dc5 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -1,9 +1,14 @@ Date: Sun, 22 Sep 2024 16:58:16 +0100 Subject: [PATCH 115/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index bed544dc5..500489c15 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -6,9 +6,10 @@ /** * 2024-09-22 - * It returns: + * 1) It returns: * @see G if $x is a string * $x unchanged if $x is @see X + * 2) "Refactor the `Df_Xml` module": https://github.com/mage2pro/core/issues/437 * @used-by df_module_name_by_path() * @used-by df_xml_g() * @used-by df_xml_node() From 410e83d09815c39b138c4842a5794b6ec1519889 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:00:16 +0100 Subject: [PATCH 116/717] https://github.com/mage2pro/core/issues/437 --- Framework/lib/module/fs/name.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Framework/lib/module/fs/name.php b/Framework/lib/module/fs/name.php index 46bc3a1c7..f82d8277b 100644 --- a/Framework/lib/module/fs/name.php +++ b/Framework/lib/module/fs/name.php @@ -1,7 +1,7 @@ From 7343961bbeb126884e276a22e9f00576fbf78bec Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:02:58 +0100 Subject: [PATCH 117/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/g/.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Xml/lib/g/.php b/Xml/lib/g/.php index 5eebc990d..b06c64204 100644 --- a/Xml/lib/g/.php +++ b/Xml/lib/g/.php @@ -46,6 +46,7 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski $g->addAttributes($atts); $g->importArray($contents); # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 + # 2024-09-22 The result of `df_xml_s()` does not include the XML header. return str_replace("\x0B", " ", df_cc_n($skipHeader ? '' : $h, df_xml_s($g))); } From 26aaeee9972abbbccd25b43e67831c9eb296fa2f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:07:07 +0100 Subject: [PATCH 118/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 2 -- Xml/lib/g/.php | 14 ++++++-------- Xml/lib/parsing/.php | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index a1e5b01fe..468a4882e 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -28,7 +28,6 @@ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($this->k($k), $v, $ns);} /** - * @used-by df_xml_g() * @used-by df_xml_node() * @used-by self::importArray() * @param array(string => string) $atts @@ -72,7 +71,6 @@ function addChild($name, $value = null, $namespace = null):self {/** @var self $ } /** - * @used-by df_xml_g() * @used-by df_xml_node() * @used-by self::importArray() * @param array(string => mixed) $array diff --git a/Xml/lib/g/.php b/Xml/lib/g/.php index b06c64204..d82a19f4a 100644 --- a/Xml/lib/g/.php +++ b/Xml/lib/g/.php @@ -40,17 +40,15 @@ * @param array(string => mixed) $contents [optional] * @param array(string => mixed) $p [optional] */ -function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string { - $h = $skipHeader ? '' : df_xml_header(); /** @var string $h */ - $g = df_xml_x("$h\n<{$tag}/>"); /** @var G $g */ - $g->addAttributes($atts); - $g->importArray($contents); +function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string {return str_replace( # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 - # 2024-09-22 The result of `df_xml_s()` does not include the XML header. - return str_replace("\x0B", " ", df_cc_n($skipHeader ? '' : $h, df_xml_s($g))); -} + "\x0B", " ", + # 2024-09-22 The result of `df_xml_s()` does not include the XML header. + df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_node($tag, $contents, $atts))) +);} /** + * @used-by df_xml_g() * @used-by \Dfe\SecurePay\Refund::process() * @used-by \Dfe\Vantiv\Charge::pCharge() * @used-by \Dfe\Vantiv\Test\CaseT\Charge::t04() diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 500489c15..8611d5c2d 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -11,7 +11,6 @@ * $x unchanged if $x is @see X * 2) "Refactor the `Df_Xml` module": https://github.com/mage2pro/core/issues/437 * @used-by df_module_name_by_path() - * @used-by df_xml_g() * @used-by df_xml_node() * @used-by df_xml_parse_a() * @used-by df_xml_prettify() From ae04c3f315cfce5aa7fef0300bc90609592b2ffe Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:07:59 +0100 Subject: [PATCH 119/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 468a4882e..8ed55b71e 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -111,7 +111,6 @@ function importArray(array $array, $wrapInCData = []):self { $this->importString($key, $v, $wrapInCData); } elseif (df_is_assoc($v) || array_filter($v, function($i) {return $i instanceof G;})) { - /** @var G $childNode */ $childNode = $this->addChild( /** @@ -121,7 +120,7 @@ function importArray(array $array, $wrapInCData = []):self { */ $key ) - ; + ; /** @var self $childNode */ $childData = $v; /** @var array|null $childData */ # Данный программный код позволяет импортировать атрибуты тэгов /** @var array(string => string)|null $attributes $attributes */ From ce9edb1ff5b85fd9410b5eaef29b384cc825bf96 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:19:15 +0100 Subject: [PATCH 120/717] https://github.com/mage2pro/core/issues/439 --- Xml/G.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 8ed55b71e..4057f5ded 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -53,8 +53,6 @@ function addAttributes(array $atts):void { * 2022-11-15 * 1) `static` as a return type is not supported by PHP < 8: https://github.com/mage2pro/core/issues/168#user-content-static * 2) We can not declare the $name argument type with PHP < 8: https://3v4l.org/ptpUM - * @override - * @see \SimpleXMLElement::addChild() * @used-by self::addChildText() * @used-by self::addChildX() * @used-by self::importArray() @@ -63,6 +61,7 @@ function addAttributes(array $atts):void { * @param string|null $value [optional] * @param string|null $namespace [optional] */ + #[\Override] /** @see \SimpleXMLElement::addChild() */ #[\ReturnTypeWillChange] function addChild($name, $value = null, $namespace = null):self {/** @var self $r */ try {$r = parent::addChild($this->k($name), $value, $namespace);} From 2762371f06ca3f63c8682d0be8c919e93ba4aed7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:24:12 +0100 Subject: [PATCH 121/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 4057f5ded..49d6da91b 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -214,7 +214,7 @@ function importArray(array $array, $wrapInCData = []):self { /** @used-by self::importString() */ private function addChildText(string $tag, string $valueAsText):void { - $r = $this->addChild($tag); /** @var G $r */ + $r = $this->addChild($tag); /** @var self $r */ /** * @uses CX::addChild() создаёт и возвращает не просто CX, как говорит документация, а объект класса родителя. * Поэтому в нашем случае addChild создаст объект E. From 426b8ce769f4a992c785a03d02f8dfaa469f002a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:24:52 +0100 Subject: [PATCH 122/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 49d6da91b..2f5aaaf4f 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -75,7 +75,7 @@ function addChild($name, $value = null, $namespace = null):self {/** @var self $ * @param array(string => mixed) $array * @param string[]|bool $wrapInCData [optional] */ - function importArray(array $array, $wrapInCData = []):self { + function importArray(array $array, $wrapInCData = []):void { foreach ($array as $key => $v) { /** @var string $key */ /** @var mixed $v */ if ($v instanceof G) { /** @@ -209,7 +209,6 @@ function importArray(array $array, $wrapInCData = []):self { } } } - return $this; } /** @used-by self::importString() */ From 0923e76fc2ccd644fcc035613324fe7b7f3e071b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:32:06 +0100 Subject: [PATCH 123/717] https://github.com/mage2pro/core/issues/436 --- Xml/G2.php | 20 ++++++++++++++++++++ Xml/lib/parsing/.php | 1 + 2 files changed, 21 insertions(+) create mode 100644 Xml/G2.php diff --git a/Xml/G2.php b/Xml/G2.php new file mode 100644 index 000000000..e87260786 --- /dev/null +++ b/Xml/G2.php @@ -0,0 +1,20 @@ +_x = df_xml_x($x);} + + /** + * 2024-09-22 + * @used-by __construct() + * @var X + */ + private $_x; +} \ No newline at end of file diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 8611d5c2d..887aead34 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -15,6 +15,7 @@ * @used-by df_xml_parse_a() * @used-by df_xml_prettify() * @used-by df_xml_x() + * @used-by \Df\Xml\G2::__construct() * @used-by \Dfe\Robokassa\Api\Options::p() * @used-by \Dfe\SecurePay\Refund::process() * @param X|string $x From daaf1b685deb03572d2d36b0ffcedc83c14067d7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:39:27 +0100 Subject: [PATCH 124/717] https://github.com/mage2pro/core/issues/437 --- Qa/lib/validation/assert/other.php | 1 + Qa/lib/validation/param.php | 1 - Xml/lib/parsing/.php | 21 +++++++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Qa/lib/validation/assert/other.php b/Qa/lib/validation/assert/other.php index 063a63ded..30990e078 100644 --- a/Qa/lib/validation/assert/other.php +++ b/Qa/lib/validation/assert/other.php @@ -23,6 +23,7 @@ function df_assert_nef($v, $m = null) {return false !== $v ? $v : df_error($m ?: * @used-by df_currency_base() * @used-by df_file_name() * @used-by df_json_decode() + * @used-by df_xml_x() * @used-by \CanadaSatellite\Bambora\Action\Authorize::p() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) * @used-by \CanadaSatellite\Bambora\Action\_Void::p() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) * @used-by \Df\Payment\W\Event::pid() diff --git a/Qa/lib/validation/param.php b/Qa/lib/validation/param.php index 06936cfbb..73a384ef4 100644 --- a/Qa/lib/validation/param.php +++ b/Qa/lib/validation/param.php @@ -15,7 +15,6 @@ function df_param_iso2(string $v, int $ord, int $sl = 0):string {return Q::asser * @used-by df_eav_update() * @used-by df_fs_delete() * @used-by df_xml_children() - * @used-by df_xml_x() * @used-by dfa_deep() * @used-by dfa_deep_unset() * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 887aead34..874e26832 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -1,4 +1,5 @@ Date: Sun, 22 Sep 2024 17:40:32 +0100 Subject: [PATCH 125/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 874e26832..2a42b3bb4 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -24,18 +24,9 @@ * @return G|X * @throws E */ -function df_xml_x($x, $onE = true):X {/** @var G|X $r */ - if ($x instanceof X) { - $r = $x; - } - else { - ; - $r = df_try( - function() use($x) {return new G(df_assert_sne($x, 0));} - , true !== $onE ? $onE : function(T $t) use($x):E {return df_error_create( - "Failed to parse XML: «%s».\nXML:\n%s", df_xts($t), df_trim($x) - );} - ); - } - return $r; -} \ No newline at end of file +function df_xml_x($x, $onE = true):X {return $x instanceof X ? $x : df_try( + function() use($x) {return new G(df_assert_sne($x, 0));} + , true !== $onE ? $onE : function(T $t) use($x):E {return df_error_create( + "Failed to parse XML: «%s».\nXML:\n%s", df_xts($t), df_trim($x) + );} +);} \ No newline at end of file From 5a4ad2f5bab947fb2df4de1625bcd22784932313 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:42:31 +0100 Subject: [PATCH 126/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/lang/try.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/lib/lang/try.php b/Core/lib/lang/try.php index 40d93408e..2cdd3de59 100644 --- a/Core/lib/lang/try.php +++ b/Core/lib/lang/try.php @@ -20,6 +20,7 @@ * @used-by df_module_file_name() * @used-by df_phone() * @used-by df_product_att() + * @used-by df_xml_x() * @used-by df_zuri() * @used-by dfp_refund() * @used-by \Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) From 8b100b15879153c345f437b7901687f3568c1276 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:44:29 +0100 Subject: [PATCH 127/717] https://github.com/mage2pro/core/issues/439 --- Xml/G.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 2f5aaaf4f..41bfd3503 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -17,14 +17,13 @@ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} * https://stackoverflow.com/a/43566078 * 2022-11-15 We can not declare the $k argument type with PHP < 8: https://3v4l.org/ptpUM * 2022-12-20 We can not declare arguments types because they are undeclared in the overriden method. - * @override - * @see \SimpleXMLElement::addAttribute() * @used-by self::addAttributes() * @used-by self::addChildX() * @param string $k * @param string|null $v [optional] * @param string|null $ns [optional] */ + #[\Override] /** @see \SimpleXMLElement::addAttribute() */ function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($this->k($k), $v, $ns);} /** From 6cf34ecac7474ae7125d96e5731e81504170b655 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:49:30 +0100 Subject: [PATCH 128/717] https://github.com/mage2pro/core/issues/436 --- Xml/G2.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Xml/G2.php b/Xml/G2.php index e87260786..2761f3109 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -11,9 +11,17 @@ final class G2 { */ function __construct($x) {$this->_x = df_xml_x($x);} + /** + * 2021-12-13 + * @used-by self::addAttributes() + * @used-by self::addChildX() + */ + function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} + /** * 2024-09-22 - * @used-by __construct() + * @used-by self::__construct() + * @used-by self::addAttribute() * @var X */ private $_x; From ae7209cd5bec2bb666063e02298de45f0a9ff073 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:50:23 +0100 Subject: [PATCH 129/717] https://github.com/mage2pro/core/issues/436 --- Core/lib/text/main.php | 1 + Xml/G2.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Core/lib/text/main.php b/Core/lib/text/main.php index 337b2340b..2af3926c2 100644 --- a/Core/lib/text/main.php +++ b/Core/lib/text/main.php @@ -47,6 +47,7 @@ function df_bts_yn(bool $v):string {return $v ? 'yes' : 'no';} * @used-by \Df\Framework\Config\Dom\L::validate() * @used-by \Df\Sentry\Trace::get_frame_context() * @used-by \Df\Xml\G::k() + * @used-by \Df\Xml\G2::k() * @used-by \Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::parse() * @used-by \DxMoto\Core\Observer\CanLog::execute() * @used-by \RWCandy\Captcha\Assert::name() diff --git a/Xml/G2.php b/Xml/G2.php index 2761f3109..7e22b1688 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -18,6 +18,16 @@ function __construct($x) {$this->_x = df_xml_x($x);} */ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} + /** + * 2021-12-16 + * https://stackoverflow.com/a/9391673 + * https://stackoverflow.com/a/43566078 + * https://stackoverflow.com/a/6928183 + * @used-by self::addAttribute() + * @used-by self::addChild() + */ + private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns:$s";} + /** * 2024-09-22 * @used-by self::__construct() From 0537f2c50c49a2e0e2893bf31d3600a37dd1e14d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:52:13 +0100 Subject: [PATCH 130/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 11 +++-------- Xml/G2.php | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 41bfd3503..56449a787 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -26,11 +26,6 @@ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} #[\Override] /** @see \SimpleXMLElement::addAttribute() */ function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($this->k($k), $v, $ns);} - /** - * @used-by df_xml_node() - * @used-by self::importArray() - * @param array(string => string) $atts - */ function addAttributes(array $atts):void { foreach ($atts as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_sne($k); @@ -38,13 +33,13 @@ function addAttributes(array $atts):void { if (is_object($v) || is_array($v)) { df_log($atts); df_error( - "Значение поля «{$k}» должно быть строкой, однако является %s." - ,is_object($v) ? sprintf('объектом класса %s', get_class($v)) : 'массивом' + "«{$k}» should be a string, but it is %s." + ,is_object($v) ? sprintf('an object of the class `%s`', get_class($v)) : 'an array' ); } $this->addAttribute($k, $v); } - } + } /** * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, diff --git a/Xml/G2.php b/Xml/G2.php index 7e22b1688..a2943face 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -18,6 +18,26 @@ function __construct($x) {$this->_x = df_xml_x($x);} */ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} + /** + * @used-by df_xml_node() + * @used-by self::importArray() + * @param array(string => string) $atts + */ + function addAttributes(array $atts):void { + foreach ($atts as $k => $v) {/** @var string $k */ /** @var mixed $v */ + df_assert_sne($k); + # убрал strval($v) для ускорения системы + if (is_object($v) || is_array($v)) { + df_log($atts); + df_error( + "«{$k}» should be a string, but it is %s." + ,is_object($v) ? sprintf('an object of the class `%s`', get_class($v)) : 'an array' + ); + } + $this->addAttribute($k, $v); + } + } + /** * 2021-12-16 * https://stackoverflow.com/a/9391673 From 68a95d760150cf88925074a2e5ccf7b50b44e5bc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:53:19 +0100 Subject: [PATCH 131/717] https://github.com/mage2pro/core/issues/436 --- Xml/G.php | 3 +-- Xml/G2.php | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 56449a787..37c252ffe 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -29,7 +29,6 @@ function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($thi function addAttributes(array $atts):void { foreach ($atts as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_sne($k); - # убрал strval($v) для ускорения системы if (is_object($v) || is_array($v)) { df_log($atts); df_error( @@ -39,7 +38,7 @@ function addAttributes(array $atts):void { } $this->addAttribute($k, $v); } - } + } /** * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, diff --git a/Xml/G2.php b/Xml/G2.php index a2943face..1c8d96b9f 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -26,7 +26,6 @@ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_ function addAttributes(array $atts):void { foreach ($atts as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_sne($k); - # убрал strval($v) для ускорения системы if (is_object($v) || is_array($v)) { df_log($atts); df_error( From 8a2c8f31c06cbfa32c4107d535f64106914d60d5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:54:45 +0100 Subject: [PATCH 132/717] https://github.com/mage2pro/core/issues/436 --- Xml/G2.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 1c8d96b9f..4990632b5 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -27,11 +27,7 @@ function addAttributes(array $atts):void { foreach ($atts as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_sne($k); if (is_object($v) || is_array($v)) { - df_log($atts); - df_error( - "«{$k}» should be a string, but it is %s." - ,is_object($v) ? sprintf('an object of the class `%s`', get_class($v)) : 'an array' - ); + df_error("«{$k}» should be a string, but it is %s.", df_type($v)); } $this->addAttribute($k, $v); } From 229262f474ffd2f25bc730a78478e74b397d43cb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:57:02 +0100 Subject: [PATCH 133/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/dump.php | 4 ++-- Xml/G2.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Qa/lib/dump.php b/Qa/lib/dump.php index 90a18b8ff..982b05e18 100644 --- a/Qa/lib/dump.php +++ b/Qa/lib/dump.php @@ -47,8 +47,8 @@ function df_dump_ds($v):string {return df_json_dont_sort(function() use($v):stri * @used-by dfpex_args() * @param mixed $v */ -function df_type($v):string {return is_object($v) ? sprintf('an object: %s', get_class($v), df_dump($v)) : (is_array($v) - ? (10 < ($c = count($v)) ? "«an array of $c elements»" : 'an array: ' . df_dump($v)) +function df_type($v):string {return is_object($v) ? sprintf('an object: `%s`', get_class($v), df_dump($v)) : (is_array($v) + ? (10 < ($c = count($v)) ? "an array of $c elements" : 'an array: ' . df_dump($v)) /** 2020-02-04 We should not use @see df_desc() here */ : (is_null($v) ? '`null`' : sprintf('«%s» (%s)', df_string($v), gettype($v))) );} \ No newline at end of file diff --git a/Xml/G2.php b/Xml/G2.php index 4990632b5..a77b1afe4 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -23,11 +23,11 @@ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_ * @used-by self::importArray() * @param array(string => string) $atts */ - function addAttributes(array $atts):void { - foreach ($atts as $k => $v) {/** @var string $k */ /** @var mixed $v */ + function addAttributes(array $aa):void { + foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_sne($k); if (is_object($v) || is_array($v)) { - df_error("«{$k}» should be a string, but it is %s.", df_type($v)); + df_error("The value of «{$k}» should be a string, but it is %s.", df_type($v), ['attributes' => $aa]); } $this->addAttribute($k, $v); } From 79aa2a78de50a533d9ff58e6aa26bcf2fbc41ad9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 17:57:13 +0100 Subject: [PATCH 134/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/dump.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Qa/lib/dump.php b/Qa/lib/dump.php index 982b05e18..583708bdb 100644 --- a/Qa/lib/dump.php +++ b/Qa/lib/dump.php @@ -45,6 +45,7 @@ function df_dump_ds($v):string {return df_json_dont_sort(function() use($v):stri * @used-by df_result_s() * @used-by dfaf() * @used-by dfpex_args() + * @used-by \Df\Xml\G2::addAttributes() * @param mixed $v */ function df_type($v):string {return is_object($v) ? sprintf('an object: `%s`', get_class($v), df_dump($v)) : (is_array($v) From 637870d5439a5fc1019da537606e14caeac7fe57 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 18:00:47 +0100 Subject: [PATCH 135/717] https://github.com/mage2pro/core/issues/436 --- Xml/G2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G2.php b/Xml/G2.php index a77b1afe4..dae4214b1 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -27,7 +27,7 @@ function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_sne($k); if (is_object($v) || is_array($v)) { - df_error("The value of «{$k}» should be a string, but it is %s.", df_type($v), ['attributes' => $aa]); + df_error("The attribute «{$k}» has a value of a forbidden type %s.", df_type($v), ['attributes' => $aa]); } $this->addAttribute($k, $v); } From ea73104d4445ee0b49ce44ce7637a1b35ff55af0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 18:02:43 +0100 Subject: [PATCH 136/717] https://github.com/mage2pro/core/issues/436 --- Xml/G2.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index dae4214b1..3997252b4 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -26,9 +26,12 @@ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_ function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_sne($k); - if (is_object($v) || is_array($v)) { - df_error("The attribute «{$k}» has a value of a forbidden type %s.", df_type($v), ['attributes' => $aa]); - } + df_assert( + !is_object($v) && !is_array($v) + , "The attribute «{$k}» has a value of a forbidden type %s." + , df_type($v) + , ['attributes' => $aa] + ); $this->addAttribute($k, $v); } } From 8bf3054e2e1151c8ab454bea7b90d05b18affd4b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 18:03:53 +0100 Subject: [PATCH 137/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/validation/assert/main.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Qa/lib/validation/assert/main.php b/Qa/lib/validation/assert/main.php index a21fc78bf..7be775c97 100644 --- a/Qa/lib/validation/assert/main.php +++ b/Qa/lib/validation/assert/main.php @@ -47,6 +47,7 @@ * @used-by \Df\Qa\Trace\Frame::url() * @used-by \Df\StripeClone\Payer::newCard() * @used-by \Df\Typography\Font::validate() + * @used-by \Df\Xml\G2::addAttributes() * @used-by \Dfe\AllPay\InstallmentSales\Plan\Entity::validate() * @used-by \Dfe\AllPay\Total\Quote::collect() * @used-by \Dfe\AllPay\Total\Quote::iiAdd() From e98e06002e580fdb14d4f2bc05fc4ccf90304fdb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 18:07:51 +0100 Subject: [PATCH 138/717] https://github.com/mage2pro/core/issues/436 --- Xml/G2.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 3997252b4..6ce51b5ca 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -28,8 +28,7 @@ function addAttributes(array $aa):void { df_assert_sne($k); df_assert( !is_object($v) && !is_array($v) - , "The attribute «{$k}» has a value of a forbidden type %s." - , df_type($v) + , sprintf("The attribute «{$k}» has a value of a forbidden type %s.", df_type($v)) , ['attributes' => $aa] ); $this->addAttribute($k, $v); From 1b6d5c454fb1e0179c40997cb485959266b67f4f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 18:08:38 +0100 Subject: [PATCH 139/717] https://github.com/mage2pro/core/issues/436 --- Xml/G2.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 6ce51b5ca..cf28097b8 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -25,13 +25,12 @@ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_ */ function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ - df_assert_sne($k); df_assert( !is_object($v) && !is_array($v) , sprintf("The attribute «{$k}» has a value of a forbidden type %s.", df_type($v)) , ['attributes' => $aa] ); - $this->addAttribute($k, $v); + $this->addAttribute(df_assert_sne($k), $v); } } From 205a4ff137e7930b0becc3fc85cb9ea1ea90951c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:07:08 +0100 Subject: [PATCH 140/717] refactoring --- Qa/lib/dump/type..php | 20 ++++++++++++++++++++ Qa/lib/{dump.php => dump/value.php} | 22 +--------------------- 2 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 Qa/lib/dump/type..php rename Qa/lib/{dump.php => dump/value.php} (60%) diff --git a/Qa/lib/dump/type..php b/Qa/lib/dump/type..php new file mode 100644 index 000000000..84b60b538 --- /dev/null +++ b/Qa/lib/dump/type..php @@ -0,0 +1,20 @@ +dump($v);} * @used-by df_log_l() * @used-by \Df\Qa\Failure\Exception::postface() */ -function df_dump_ds($v):string {return df_json_dont_sort(function() use($v):string {return df_dump($v);});} - -/** - * 2015-04-05 - * 2022-10-14 @see get_debug_type() has been added to PHP 8: https://php.net/manual/function.get-debug-type.php - * @see df_dump() - * @used-by df_ar() - * @used-by df_assert_gd() - * @used-by df_oq_currency_c() - * @used-by df_order() - * @used-by df_result_s() - * @used-by dfaf() - * @used-by dfpex_args() - * @used-by \Df\Xml\G2::addAttributes() - * @param mixed $v - */ -function df_type($v):string {return is_object($v) ? sprintf('an object: `%s`', get_class($v), df_dump($v)) : (is_array($v) - ? (10 < ($c = count($v)) ? "an array of $c elements" : 'an array: ' . df_dump($v)) - /** 2020-02-04 We should not use @see df_desc() here */ - : (is_null($v) ? '`null`' : sprintf('«%s» (%s)', df_string($v), gettype($v))) -);} \ No newline at end of file +function df_dump_ds($v):string {return df_json_dont_sort(function() use($v):string {return df_dump($v);});} \ No newline at end of file From c0613a484d9648fda0b7aab21a829988ab09c7c9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:08:25 +0100 Subject: [PATCH 141/717] refactoring --- Core/lib/text/main.php | 77 ------------------------------------------ Qa/lib/dump/other.php | 77 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) create mode 100644 Qa/lib/dump/other.php diff --git a/Core/lib/text/main.php b/Core/lib/text/main.php index 2af3926c2..d611ceede 100644 --- a/Core/lib/text/main.php +++ b/Core/lib/text/main.php @@ -79,83 +79,6 @@ function df_contains(string $haystack, ...$n):bool {/** @var bool $r */ */ function df_contains_ci(string $haystack, string $n):bool {return df_contains(mb_strtoupper($haystack), mb_strtoupper($n));} -/** - * Иногда я для разработки использую заплатку ядра для xDebug — - * отключаю set_error_handler для режима разработчика. - * - * Так вот, xDebug при обработке фатальных сбоев (в том числе и E_RECOVERABLE_ERROR), - * выводит на экран диагностическое сообщение, и после этого останавливает работу интерпретатора. - * - * Конечно, если у нас сбой типов E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, - * E_COMPILE_ERROR, E_COMPILE_WARNING, то и set_error_handler не поможет - * (не обрабатывает эти типы сбоев, согласно официальной документации PHP). - * - * Однако сбои типа E_RECOVERABLE_ERROR обработик сбоев Magento, - * установленный посредством set_error_handler, переводит в исключительние ситуации. - * - * xDebug же при E_RECOVERABLE_ERROR останавивает работу интерпретатора, что нехорошо. - * - * Поэтому для функций, которые могут привести к E_RECOVERABLE_ERROR, - * пишем обёртки, которые вместо E_RECOVERABLE_ERROR возбуждают исключительную ситуацию. - * Одна из таких функций — df_string. - * - * @used-by df_type() - * @used-by \Df\Xml\G::importString() - * @param mixed $v - */ -function df_string($v):string { - if (is_object($v)) { - /** - * 2016-09-04 - * К сожалению, нельзя здесь для проверки публичности метода использовать @see is_callable(), - * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. - * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: - * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, - * потому что он имеет доступность `private` или `protected`. - * Пока эта проблема никак не решена. - */ - if (!method_exists($v, '__toString')) { - df_error('The developer wrongly treats an object of the class %s as a string.', get_class($v)); - } - } - elseif (is_array($v)) { - df_error('The developer wrongly treats an array as a string.'); - } - return strval($v); -} - -/** - * @used-by \Df\Zf\Validate::message() - * @param mixed $v - */ -function df_string_debug($v):string { - $r = ''; /** @var string $r */ - if (is_object($v)) { - /** - * 2016-09-04 - * К сожалению, нельзя здесь для проверки публичности метода использовать @see is_callable(), - * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. - * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: - * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, - * потому что он имеет доступность `private` или `protected`. - * Пока эта проблема никак не решена. - */ - if (!method_exists($v, '__toString')) { - $r = get_class($v); - } - } - elseif (is_array($v)) { - $r = sprintf('', count($v)); - } - elseif (is_bool($v)) { - $r = $v ? 'logical ' : 'logical '; - } - else { - $r = strval($v); - } - return $r; -} - /** * https://php.net/manual/function.str-split.php#107658 * 2022-10-31 @deprecated It is unused. diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php new file mode 100644 index 000000000..d05ec003c --- /dev/null +++ b/Qa/lib/dump/other.php @@ -0,0 +1,77 @@ +', count($v)); + } + elseif (is_bool($v)) { + $r = $v ? 'logical ' : 'logical '; + } + else { + $r = strval($v); + } + return $r; +} \ No newline at end of file From 19f2f064f7b3f6371d22473a6d1578a72a675da0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:12:08 +0100 Subject: [PATCH 142/717] refactoring --- Qa/lib/dump/other.php | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php index d05ec003c..5e4ade389 100644 --- a/Qa/lib/dump/other.php +++ b/Qa/lib/dump/other.php @@ -1,24 +1,17 @@ Date: Sun, 22 Sep 2024 19:12:51 +0100 Subject: [PATCH 143/717] refactoring --- Qa/lib/dump/other.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php index 5e4ade389..b82ce5e50 100644 --- a/Qa/lib/dump/other.php +++ b/Qa/lib/dump/other.php @@ -17,7 +17,10 @@ * @param mixed $v */ function df_string($v):string { - if (is_object($v)) { + if (is_array($v)) { + df_error('The developer wrongly treats an array as a string.'); + } + elseif (is_object($v)) { /** * 2016-09-04 * К сожалению, нельзя здесь для проверки публичности метода использовать @see is_callable(), @@ -31,9 +34,6 @@ function df_string($v):string { df_error('The developer wrongly treats an object of the class %s as a string.', get_class($v)); } } - elseif (is_array($v)) { - df_error('The developer wrongly treats an array as a string.'); - } return strval($v); } From 0ea136266f2ad23cf80841a13a3f87f459687683 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:14:13 +0100 Subject: [PATCH 144/717] refactoring --- Qa/lib/dump/other.php | 6 ++---- Qa/lib/validation/assert/main.php | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php index b82ce5e50..2e5ad2a0b 100644 --- a/Qa/lib/dump/other.php +++ b/Qa/lib/dump/other.php @@ -17,10 +17,8 @@ * @param mixed $v */ function df_string($v):string { - if (is_array($v)) { - df_error('The developer wrongly treats an array as a string.'); - } - elseif (is_object($v)) { + df_assert(!is_array($v), 'The developer wrongly treats an array as a string.'); + if (is_object($v)) { /** * 2016-09-04 * К сожалению, нельзя здесь для проверки публичности метода использовать @see is_callable(), diff --git a/Qa/lib/validation/assert/main.php b/Qa/lib/validation/assert/main.php index 7be775c97..619331ffb 100644 --- a/Qa/lib/validation/assert/main.php +++ b/Qa/lib/validation/assert/main.php @@ -35,6 +35,7 @@ * @used-by df_module_file_name() * @used-by df_oqi_amount() * @used-by df_oqi_amount() + * @used-by df_string() * @used-by dfaf() * @used-by dfp_oq() * @used-by dfr_prop() From eb182874e85be2294b4b21f5cb42a67ca096472b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:16:12 +0100 Subject: [PATCH 145/717] refactoring --- Qa/lib/dump/other.php | 26 ++++++++++++-------------- Qa/lib/validation/error.php | 1 - 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php index 2e5ad2a0b..c38fc3639 100644 --- a/Qa/lib/dump/other.php +++ b/Qa/lib/dump/other.php @@ -18,20 +18,18 @@ */ function df_string($v):string { df_assert(!is_array($v), 'The developer wrongly treats an array as a string.'); - if (is_object($v)) { - /** - * 2016-09-04 - * К сожалению, нельзя здесь для проверки публичности метода использовать @see is_callable(), - * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. - * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: - * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, - * потому что он имеет доступность `private` или `protected`. - * Пока эта проблема никак не решена. - */ - if (!method_exists($v, '__toString')) { - df_error('The developer wrongly treats an object of the class %s as a string.', get_class($v)); - } - } + /** + * 2016-09-04 + * К сожалению, нельзя здесь для проверки публичности метода `__toString()` использовать @see is_callable(), + * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. + * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: + * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, + * потому что он имеет доступность `private` или `protected`. + * Пока эта проблема никак не решена. + */ + df_assert(!is_object($v) || method_exists($v, '__toString'), + 'The developer wrongly treats an object of the class `%s` as a string.', get_class($v) + ); return strval($v); } diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index 3dfb17a9b..8ad433866 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -86,7 +86,6 @@ function df_abstract($caller):void { * @used-by df_route() * @used-by df_sentry_m() * @used-by df_sprintf_strict() - * @used-by df_string() * @used-by df_subscriber() * @used-by df_try() * @used-by df_xml_children() From 9693786512e5b46ba6b4862e5cb5d99b75d88389 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:16:41 +0100 Subject: [PATCH 146/717] refactoring --- Qa/lib/dump/other.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php index c38fc3639..16257489c 100644 --- a/Qa/lib/dump/other.php +++ b/Qa/lib/dump/other.php @@ -42,7 +42,7 @@ function df_string_debug($v):string { if (is_object($v)) { /** * 2016-09-04 - * К сожалению, нельзя здесь для проверки публичности метода использовать @see is_callable(), + * К сожалению, нельзя здесь для проверки публичности метода `__toString()` использовать @see is_callable(), * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, From e58eb3581569f13d24586c74d33fe5aac4f8b211 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:17:02 +0100 Subject: [PATCH 147/717] refactoring --- Qa/lib/dump/other.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php index 16257489c..710b90e6b 100644 --- a/Qa/lib/dump/other.php +++ b/Qa/lib/dump/other.php @@ -43,7 +43,8 @@ function df_string_debug($v):string { /** * 2016-09-04 * К сожалению, нельзя здесь для проверки публичности метода `__toString()` использовать @see is_callable(), - * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. + * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, + * что `is_callable` всегда возвращает `true`. * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, * потому что он имеет доступность `private` или `protected`. From 2fa1150b6e0bafd579afb0dee2ab77668b2a0089 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:19:46 +0100 Subject: [PATCH 148/717] refactoring --- Core/lib/lang/type/conversion/string.php | 34 ++++++++++++++++++++++++ Qa/lib/dump/other.php | 34 ------------------------ 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 Core/lib/lang/type/conversion/string.php diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php new file mode 100644 index 000000000..2b21d2bb6 --- /dev/null +++ b/Core/lib/lang/type/conversion/string.php @@ -0,0 +1,34 @@ + Date: Sun, 22 Sep 2024 19:22:23 +0100 Subject: [PATCH 149/717] refactoring --- Qa/lib/dump/other.php | 33 --------------------------------- Qa/lib/dump/value.php | 1 + Zf/Validate.php | 2 +- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 Qa/lib/dump/other.php diff --git a/Qa/lib/dump/other.php b/Qa/lib/dump/other.php deleted file mode 100644 index 7230452a7..000000000 --- a/Qa/lib/dump/other.php +++ /dev/null @@ -1,33 +0,0 @@ -', count($v)); - } - elseif (is_bool($v)) { - $r = $v ? 'logical ' : 'logical '; - } - else { - $r = strval($v); - } - return $r; -} \ No newline at end of file diff --git a/Qa/lib/dump/value.php b/Qa/lib/dump/value.php index 22c1ba28f..da5166c13 100644 --- a/Qa/lib/dump/value.php +++ b/Qa/lib/dump/value.php @@ -17,6 +17,7 @@ * @used-by \Df\Framework\Form\Element\Text::getValue() * @used-by \Df\Sentry\Client::capture() * @used-by \Df\Sentry\Extra::adjust() + * @used-by \Df\Zf\Validate::message() * @used-by \Dfe\Dynamics365\Test\OAuth::discovery() * @used-by \Dfe\Geo\Test\Basic::t01() * @used-by \Dfe\Portal\Test\Basic::t01() diff --git a/Zf/Validate.php b/Zf/Validate.php index 6e0662d74..1ab2dafe3 100644 --- a/Zf/Validate.php +++ b/Zf/Validate.php @@ -31,7 +31,7 @@ final function getMessages():array {return [__CLASS__ => $this->message()];} */ final function message():string {$v = $this->v(); return is_null($v) ? "Got `NULL` instead of {$this->expected()}." - : sprintf("Unable to recognize the value «%s» of type «%s» as {$this->expected()}.", df_string_debug($v), gettype($v)) + : sprintf("Unable to recognize the value «%s» of type «%s» as {$this->expected()}.", df_dump($v), gettype($v)) ;} /** From 0e8ee6660344c7d16631cef8eaedf31738cb51f4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:23:36 +0100 Subject: [PATCH 150/717] refactoring --- Core/lib/lang/type/conversion/string.php | 1 + Qa/lib/dump/value.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 2b21d2bb6..2d187116f 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -12,6 +12,7 @@ * 6) Поэтому для функций, которые могут привести к `E_RECOVERABLE_ERROR`, пишем обёртки, * которые вместо `E_RECOVERABLE_ERROR` возбуждают исключительную ситуацию. * 7) Одна из таких функций — df_string. + * @see df_dump() * @used-by df_type() * @used-by \Df\Xml\G::importString() * @param mixed $v diff --git a/Qa/lib/dump/value.php b/Qa/lib/dump/value.php index da5166c13..109d29f0c 100644 --- a/Qa/lib/dump/value.php +++ b/Qa/lib/dump/value.php @@ -4,6 +4,7 @@ * We do not use @uses \Df\Qa\Dumper as a singleton * because @see \Df\Qa\Dumper::dumpObject() * uses the @see \Df\Qa\Dumper::$_dumped property to avoid a recursion. + * @see df_string() * @see df_type() * @used-by df_assert_eq() * @used-by df_bool() From ac6a0bdb3fc0cff8c3eaf6c64de05ef4511b0d5e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:24:04 +0100 Subject: [PATCH 151/717] refactoring --- Qa/lib/dump/{value.php => .php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Qa/lib/dump/{value.php => .php} (100%) diff --git a/Qa/lib/dump/value.php b/Qa/lib/dump/.php similarity index 100% rename from Qa/lib/dump/value.php rename to Qa/lib/dump/.php From 06580582e57029202703fcda6b1ac6b032bee664 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:25:40 +0100 Subject: [PATCH 152/717] refactoring --- Core/lib/lang/type/complex.php | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Core/lib/lang/type/complex.php diff --git a/Core/lib/lang/type/complex.php b/Core/lib/lang/type/complex.php new file mode 100644 index 000000000..27c840402 --- /dev/null +++ b/Core/lib/lang/type/complex.php @@ -0,0 +1,5 @@ + Date: Sun, 22 Sep 2024 19:38:43 +0100 Subject: [PATCH 153/717] refactoring --- Core/lib/lang/type/stringable.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Core/lib/lang/type/stringable.php diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php new file mode 100644 index 000000000..c6c78a47d --- /dev/null +++ b/Core/lib/lang/type/stringable.php @@ -0,0 +1,16 @@ + Date: Sun, 22 Sep 2024 19:41:10 +0100 Subject: [PATCH 154/717] refactoring --- Core/lib/lang/type/stringable.php | 2 +- Qa/lib/validation/assert/stringable.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Qa/lib/validation/assert/stringable.php diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index c6c78a47d..44e9fd195 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -2,7 +2,7 @@ /** * 2024-09-22 PHP ≥ 8 has the @see Stringable interface: https://www.php.net/manual/en/class.stringable.php */ -function df_stringable($v):bool {return !is_array($v) && +function df_is_stringable($v):bool {return !is_array($v) && /** * 2016-09-04 * К сожалению, нельзя здесь для проверки публичности метода `__toString()` использовать @see is_callable(), diff --git a/Qa/lib/validation/assert/stringable.php b/Qa/lib/validation/assert/stringable.php new file mode 100644 index 000000000..5d35c9216 --- /dev/null +++ b/Qa/lib/validation/assert/stringable.php @@ -0,0 +1,16 @@ + Date: Sun, 22 Sep 2024 19:47:23 +0100 Subject: [PATCH 155/717] refactoring --- Core/lib/lang/type/stringable.php | 1 + Qa/lib/validation/assert/main.php | 3 ++- Qa/lib/validation/assert/stringable.php | 19 ++++++------------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index 44e9fd195..bc7b7bc4f 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -1,6 +1,7 @@ mixed)|mixed|T|Phrase|null ...$a + * @param string|string[]|array(string => mixed)|mixed|T|null ...$a * @return mixed * @throws DFE */ diff --git a/Qa/lib/validation/assert/stringable.php b/Qa/lib/validation/assert/stringable.php index 5d35c9216..365c3ef83 100644 --- a/Qa/lib/validation/assert/stringable.php +++ b/Qa/lib/validation/assert/stringable.php @@ -1,16 +1,9 @@ mixed)|mixed|T|null ...$a + * @return mixed + * @throws DFE */ -function df_assert_stringable($v):bool {return !is_array($v) && - /** - * 2016-09-04 - * К сожалению, нельзя здесь для проверки публичности метода `__toString()` использовать @see is_callable(), - * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. - * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: - * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, - * потому что он имеет доступность `private` или `protected`. - * Пока эта проблема никак не решена. - */ - (!is_object($v) || method_exists($v, '__toString')) -;} \ No newline at end of file +function df_assert_stringable($v, ...$a) {return df_assert(df_is_stringable($v), ...$a);} \ No newline at end of file From 4f719d89fdf83293cccbd4353441cc27b399f787 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:48:06 +0100 Subject: [PATCH 156/717] refactoring --- Core/lib/lang/type/conversion/string.php | 17 +---------------- Qa/lib/validation/assert/main.php | 1 - 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 2d187116f..54088d920 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -17,19 +17,4 @@ * @used-by \Df\Xml\G::importString() * @param mixed $v */ -function df_string($v):string { - df_assert(!is_array($v), 'The developer wrongly treats an array as a string.'); - /** - * 2016-09-04 - * К сожалению, нельзя здесь для проверки публичности метода `__toString()` использовать @see is_callable(), - * потому что наличие @see \Magento\Framework\DataObject::__call() приводит к тому, что `is_callable` всегда возвращает `true`. - * @uses method_exists(), в отличие от `is_callable`, не гарантирует публичную доступность метода: - * т.е. метод может у класса быть, но вызывать его всё равно извне класса нельзя, - * потому что он имеет доступность `private` или `protected`. - * Пока эта проблема никак не решена. - */ - df_assert(!is_object($v) || method_exists($v, '__toString'), - 'The developer wrongly treats an object of the class `%s` as a string.', get_class($v) - ); - return strval($v); -} \ No newline at end of file +function df_string($v):string {return strval(df_assert_stringable($v));} \ No newline at end of file diff --git a/Qa/lib/validation/assert/main.php b/Qa/lib/validation/assert/main.php index 092c9edf3..2cb19c485 100644 --- a/Qa/lib/validation/assert/main.php +++ b/Qa/lib/validation/assert/main.php @@ -36,7 +36,6 @@ * @used-by df_module_file_name() * @used-by df_oqi_amount() * @used-by df_oqi_amount() - * @used-by df_string() * @used-by dfaf() * @used-by dfp_oq() * @used-by dfr_prop() From c5a96f3279462c4c502c576090bf78a93429feab Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:50:01 +0100 Subject: [PATCH 157/717] refactoring --- Core/lib/lang/type/stringable.php | 1 + Core/lib/text/format.php | 3 +-- Qa/lib/validation/assert/stringable.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index bc7b7bc4f..0175a02dc 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -2,6 +2,7 @@ /** * 2024-09-22 PHP ≥ 8 has the @see Stringable interface: https://www.php.net/manual/en/class.stringable.php * @used-by df_assert_stringable() + * @used-by df_kv() */ function df_is_stringable($v):bool {return !is_array($v) && /** diff --git a/Core/lib/text/format.php b/Core/lib/text/format.php index f03071dab..df5b6c822 100644 --- a/Core/lib/text/format.php +++ b/Core/lib/text/format.php @@ -50,8 +50,7 @@ function df_format(...$a):string { /** @var string $r */ * @param array(string => string) $a */ function df_kv(array $a, int $pad = 0):string {return df_cc_n(df_map_k(df_clean($a), function($k, $v) use($pad) {return - (!$pad ? "$k: " : df_pad("$k:", $pad)) - .(is_array($v) || (is_object($v) && !method_exists($v, '__toString')) ? "\n" . df_json_encode($v) : $v) + (!$pad ? "$k: " : df_pad("$k:", $pad)) . (df_is_stringable($v) ? $v : df_json_encode($v)) ;}));} /** diff --git a/Qa/lib/validation/assert/stringable.php b/Qa/lib/validation/assert/stringable.php index 365c3ef83..bec441847 100644 --- a/Qa/lib/validation/assert/stringable.php +++ b/Qa/lib/validation/assert/stringable.php @@ -2,6 +2,7 @@ use Df\Core\Exception as DFE; /** * 2024-09-22 + * @used-by df_string() * @param string|string[]|array(string => mixed)|mixed|T|null ...$a * @return mixed * @throws DFE From 524b8caad7e9f3b9889efef82c0e29843a67b607 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:50:39 +0100 Subject: [PATCH 158/717] refactoring --- Core/lib/text/format.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/lib/text/format.php b/Core/lib/text/format.php index df5b6c822..be9700bbc 100644 --- a/Core/lib/text/format.php +++ b/Core/lib/text/format.php @@ -43,6 +43,7 @@ function df_format(...$a):string { /** @var string $r */ /** * 2017-07-09 + * @see df_dump() * @used-by df_api_rr_failed() * @used-by \Df\API\Client::p() * @used-by \Df\Qa\Failure\Error::preface() From e29dd8410345ad9d4724b41bf849af6dc5e247c3 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:51:13 +0100 Subject: [PATCH 159/717] refactoring --- Qa/lib/dump/.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Qa/lib/dump/.php b/Qa/lib/dump/.php index 109d29f0c..2e5b05957 100644 --- a/Qa/lib/dump/.php +++ b/Qa/lib/dump/.php @@ -4,6 +4,7 @@ * We do not use @uses \Df\Qa\Dumper as a singleton * because @see \Df\Qa\Dumper::dumpObject() * uses the @see \Df\Qa\Dumper::$_dumped property to avoid a recursion. + * @see df_kv() * @see df_string() * @see df_type() * @used-by df_assert_eq() From d6caa58bc88864cf0e029ba26960fbe325707f17 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:53:17 +0100 Subject: [PATCH 160/717] refactoring --- Core/lib/text/format.php | 30 ----------------------------- Qa/lib/dump/kv/.php | 13 +++++++++++++ Qa/lib/dump/kv/table.php | 17 ++++++++++++++++ Qa/lib/dump/{type..php => type.php} | 0 4 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 Qa/lib/dump/kv/.php create mode 100644 Qa/lib/dump/kv/table.php rename Qa/lib/dump/{type..php => type.php} (100%) diff --git a/Core/lib/text/format.php b/Core/lib/text/format.php index be9700bbc..b3038e84b 100644 --- a/Core/lib/text/format.php +++ b/Core/lib/text/format.php @@ -41,36 +41,6 @@ function df_format(...$a):string { /** @var string $r */ return !is_null($r) ? $r : df_sprintf($a); } -/** - * 2017-07-09 - * @see df_dump() - * @used-by df_api_rr_failed() - * @used-by \Df\API\Client::p() - * @used-by \Df\Qa\Failure\Error::preface() - * @used-by \Df\Sentry\Client::send_http() - * @param array(string => string) $a - */ -function df_kv(array $a, int $pad = 0):string {return df_cc_n(df_map_k(df_clean($a), function($k, $v) use($pad) {return - (!$pad ? "$k: " : df_pad("$k:", $pad)) . (df_is_stringable($v) ? $v : df_json_encode($v)) -;}));} - -/** - * 2019-06-13 - * @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute() - * @param array(string => string) $a - */ -function df_kv_table(array $a):string {return df_tag('table', [], df_map_k( - df_clean($a), function($k, $v) {return - df_tag('tr', [], [ - df_tag('td', [], $k) - ,df_tag('td', [], - is_array($v) || (is_object($v) && !method_exists($v, '__toString')) - ? "\n" . df_json_encode($v) : $v - ) - ]) - ;} -));} - /** * @used-by df_format() * @param string|mixed[] $s diff --git a/Qa/lib/dump/kv/.php b/Qa/lib/dump/kv/.php new file mode 100644 index 000000000..68d5b2622 --- /dev/null +++ b/Qa/lib/dump/kv/.php @@ -0,0 +1,13 @@ + string) $a + */ +function df_kv(array $a, int $pad = 0):string {return df_cc_n(df_map_k(df_clean($a), function($k, $v) use($pad) {return + (!$pad ? "$k: " : df_pad("$k:", $pad)) . (df_is_stringable($v) ? $v : df_json_encode($v)) +;}));} \ No newline at end of file diff --git a/Qa/lib/dump/kv/table.php b/Qa/lib/dump/kv/table.php new file mode 100644 index 000000000..766320f17 --- /dev/null +++ b/Qa/lib/dump/kv/table.php @@ -0,0 +1,17 @@ + string) $a + */ +function df_kv_table(array $a):string {return df_tag('table', [], df_map_k( + df_clean($a), function($k, $v) {return + df_tag('tr', [], [ + df_tag('td', [], $k) + ,df_tag('td', [], + is_array($v) || (is_object($v) && !method_exists($v, '__toString')) + ? "\n" . df_json_encode($v) : $v + ) + ]) + ;} +));} \ No newline at end of file diff --git a/Qa/lib/dump/type..php b/Qa/lib/dump/type.php similarity index 100% rename from Qa/lib/dump/type..php rename to Qa/lib/dump/type.php From b7e7a346169b00a152aeaf5e670b1d8a827b9fd8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:53:48 +0100 Subject: [PATCH 161/717] refactoring --- Qa/lib/dump/kv/.php | 1 + Qa/lib/dump/kv/table.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Qa/lib/dump/kv/.php b/Qa/lib/dump/kv/.php index 68d5b2622..98037bd85 100644 --- a/Qa/lib/dump/kv/.php +++ b/Qa/lib/dump/kv/.php @@ -2,6 +2,7 @@ /** * 2017-07-09 * @see df_dump() + * @see df_kv_table() * @used-by df_api_rr_failed() * @used-by \Df\API\Client::p() * @used-by \Df\Qa\Failure\Error::preface() diff --git a/Qa/lib/dump/kv/table.php b/Qa/lib/dump/kv/table.php index 766320f17..daf9e1774 100644 --- a/Qa/lib/dump/kv/table.php +++ b/Qa/lib/dump/kv/table.php @@ -1,6 +1,7 @@ string) $a */ From 16aa3564f430a5d76125d90d92bb058c612e15c6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:54:51 +0100 Subject: [PATCH 162/717] refactoring --- Core/lib/lang/type/stringable.php | 1 + Qa/lib/dump/kv/table.php | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index 0175a02dc..a9bca920c 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -3,6 +3,7 @@ * 2024-09-22 PHP ≥ 8 has the @see Stringable interface: https://www.php.net/manual/en/class.stringable.php * @used-by df_assert_stringable() * @used-by df_kv() + * @used-by df_kv_table() */ function df_is_stringable($v):bool {return !is_array($v) && /** diff --git a/Qa/lib/dump/kv/table.php b/Qa/lib/dump/kv/table.php index daf9e1774..d4b526f2d 100644 --- a/Qa/lib/dump/kv/table.php +++ b/Qa/lib/dump/kv/table.php @@ -9,10 +9,7 @@ function df_kv_table(array $a):string {return df_tag('table', [], df_map_k( df_clean($a), function($k, $v) {return df_tag('tr', [], [ df_tag('td', [], $k) - ,df_tag('td', [], - is_array($v) || (is_object($v) && !method_exists($v, '__toString')) - ? "\n" . df_json_encode($v) : $v - ) + ,df_tag('td', [], df_is_stringable($v) ? $v : "\n" . df_json_encode($v)) ]) ;} ));} \ No newline at end of file From be46ecb6b7ca2819723fd55f3a288b0f92503b5a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 19:56:56 +0100 Subject: [PATCH 163/717] refactoring --- Core/lib/lang/type/complex.php | 1 + Core/lib/lang/type/stringable.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Core/lib/lang/type/complex.php b/Core/lib/lang/type/complex.php index 27c840402..cbaf656fc 100644 --- a/Core/lib/lang/type/complex.php +++ b/Core/lib/lang/type/complex.php @@ -1,5 +1,6 @@ Date: Sun, 22 Sep 2024 19:57:43 +0100 Subject: [PATCH 164/717] refactoring --- Qa/lib/dump/kv/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qa/lib/dump/kv/table.php b/Qa/lib/dump/kv/table.php index d4b526f2d..2c6e68624 100644 --- a/Qa/lib/dump/kv/table.php +++ b/Qa/lib/dump/kv/table.php @@ -6,7 +6,7 @@ * @param array(string => string) $a */ function df_kv_table(array $a):string {return df_tag('table', [], df_map_k( - df_clean($a), function($k, $v) {return + df_clean($a), function(string $k, $v):string {return df_tag('tr', [], [ df_tag('td', [], $k) ,df_tag('td', [], df_is_stringable($v) ? $v : "\n" . df_json_encode($v)) From 2fa13395262ffd824593828ad7f66d1eab807144 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:06:29 +0100 Subject: [PATCH 165/717] refactoring --- Core/lib/lang/type/conversion/string.php | 1 + Core/lib/lang/type/stringable.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 54088d920..a49e7b4ad 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -13,6 +13,7 @@ * которые вместо `E_RECOVERABLE_ERROR` возбуждают исключительную ситуацию. * 7) Одна из таких функций — df_string. * @see df_dump() + * @see df_is_stringable() * @used-by df_type() * @used-by \Df\Xml\G::importString() * @param mixed $v diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index f325de627..fba674a39 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -2,6 +2,7 @@ /** * 2024-09-22 PHP ≥ 8 has the @see Stringable interface: https://www.php.net/manual/en/class.stringable.php * @see df_is_complex() + * @see df_string() * @used-by df_assert_stringable() * @used-by df_kv() * @used-by df_kv_table() From b2ac847c44b0c4218a7e0f9127ecea886e04743a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:09:58 +0100 Subject: [PATCH 166/717] refactoring --- Qa/Dumper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Qa/Dumper.php b/Qa/Dumper.php index 68c0e15fb..97a5b223d 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -67,8 +67,7 @@ private function dumpObject($o):string {/** @var string $r */ $this->_dumped[$hash] = true; # 2023-07-26 "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 /** @var array(string => mixed)|null $a */ - $a = df_has_gd($o) ? df_gd($o) : (is_iterable($o) ? df_ita($o) : null); - $r = is_null($a) + $r = is_null($a = df_has_gd($o) ? df_gd($o) : (is_iterable($o) ? df_ita($o) : null)) ? sprintf("%s %s", get_class($o), df_json_encode_partial($o)) : sprintf("%s(\n%s\n)", get_class($o), df_tab_multiline($this->dumpArrayElements($a))) ; From 33b71d377269600da9f23a51f3d966cf1d1918cc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:14:03 +0100 Subject: [PATCH 167/717] refactoring --- Core/lib/json.php | 2 -- Core/lib/lang/type/stringable.php | 2 -- Qa/lib/dump/.php | 2 ++ Qa/lib/dump/kv/.php | 2 +- Qa/lib/dump/kv/table.php | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Core/lib/json.php b/Core/lib/json.php index 713c325eb..40262969c 100644 --- a/Core/lib/json.php +++ b/Core/lib/json.php @@ -132,8 +132,6 @@ function df_json_dont_sort(F $f) {/** @var mixed $r */ * @used-by df_js_x() * @used-by df_json_encode_partial() * @used-by df_json_prettify() - * @used-by df_kv() - * @used-by df_kv_table() * @used-by df_oi_add() * @used-by df_widget() * @used-by dfp_container_add() diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index fba674a39..c81515312 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -4,8 +4,6 @@ * @see df_is_complex() * @see df_string() * @used-by df_assert_stringable() - * @used-by df_kv() - * @used-by df_kv_table() */ function df_is_stringable($v):bool {return !is_array($v) && /** diff --git a/Qa/lib/dump/.php b/Qa/lib/dump/.php index 2e5b05957..b81bc797c 100644 --- a/Qa/lib/dump/.php +++ b/Qa/lib/dump/.php @@ -11,6 +11,8 @@ * @used-by df_bool() * @used-by df_caller_m() * @used-by df_dump_ds() + * @used-by df_kv() + * @used-by df_kv_table() * @used-by df_sentry() * @used-by df_type() * @used-by dfa_assert_keys() diff --git a/Qa/lib/dump/kv/.php b/Qa/lib/dump/kv/.php index 98037bd85..35b22c24b 100644 --- a/Qa/lib/dump/kv/.php +++ b/Qa/lib/dump/kv/.php @@ -10,5 +10,5 @@ * @param array(string => string) $a */ function df_kv(array $a, int $pad = 0):string {return df_cc_n(df_map_k(df_clean($a), function($k, $v) use($pad) {return - (!$pad ? "$k: " : df_pad("$k:", $pad)) . (df_is_stringable($v) ? $v : df_json_encode($v)) + (!$pad ? "$k: " : df_pad("$k:", $pad)) . df_dump($v) ;}));} \ No newline at end of file diff --git a/Qa/lib/dump/kv/table.php b/Qa/lib/dump/kv/table.php index 2c6e68624..ff2f67184 100644 --- a/Qa/lib/dump/kv/table.php +++ b/Qa/lib/dump/kv/table.php @@ -9,7 +9,7 @@ function df_kv_table(array $a):string {return df_tag('table', [], df_map_k( df_clean($a), function(string $k, $v):string {return df_tag('tr', [], [ df_tag('td', [], $k) - ,df_tag('td', [], df_is_stringable($v) ? $v : "\n" . df_json_encode($v)) + ,df_tag('td', [], df_dump($v)) ]) ;} ));} \ No newline at end of file From 5ea82699bdbd1bd96a3fe3ae42e4e72a49c6efed Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:21:08 +0100 Subject: [PATCH 168/717] refactoring --- Core/lib/lang/type/stringable.php | 1 + Qa/Dumper.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index c81515312..c060f0a46 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -4,6 +4,7 @@ * @see df_is_complex() * @see df_string() * @used-by df_assert_stringable() + * @used-by \Df\Qa\Dumper::dumpObject() */ function df_is_stringable($v):bool {return !is_array($v) && /** diff --git a/Qa/Dumper.php b/Qa/Dumper.php index 97a5b223d..200ef0cad 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -65,12 +65,17 @@ private function dumpObject($o):string {/** @var string $r */ } else { $this->_dumped[$hash] = true; + $c = get_class($o); /** @var string $c */ + if (df_is_stringable($o)) { + $r = sprintf("`$c::__toString()`: «%s»", $o); + } # 2023-07-26 "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 /** @var array(string => mixed)|null $a */ - $r = is_null($a = df_has_gd($o) ? df_gd($o) : (is_iterable($o) ? df_ita($o) : null)) - ? sprintf("%s %s", get_class($o), df_json_encode_partial($o)) - : sprintf("%s(\n%s\n)", get_class($o), df_tab_multiline($this->dumpArrayElements($a))) - ; + $r = df_is_stringable($o) ? sprintf("`$c::__toString()`: «%s»", $o) : ( + is_null($a = df_has_gd($o) ? df_gd($o) : (is_iterable($o) ? df_ita($o) : null)) + ? sprintf("$c %s", df_json_encode_partial($o)) + : sprintf("$c(\n%s\n)", df_tab_multiline($this->dumpArrayElements($a))) + ); } return $r; } From f0f831d117d22a6a35431451dc093edba6e6e7e0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:22:03 +0100 Subject: [PATCH 169/717] refactoring --- Qa/Dumper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Qa/Dumper.php b/Qa/Dumper.php index 200ef0cad..ef2e30eaa 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -69,9 +69,10 @@ private function dumpObject($o):string {/** @var string $r */ if (df_is_stringable($o)) { $r = sprintf("`$c::__toString()`: «%s»", $o); } - # 2023-07-26 "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 - /** @var array(string => mixed)|null $a */ $r = df_is_stringable($o) ? sprintf("`$c::__toString()`: «%s»", $o) : ( + # 2023-07-26 + # "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 + /** @var array(string => mixed)|null $a */ is_null($a = df_has_gd($o) ? df_gd($o) : (is_iterable($o) ? df_ita($o) : null)) ? sprintf("$c %s", df_json_encode_partial($o)) : sprintf("$c(\n%s\n)", df_tab_multiline($this->dumpArrayElements($a))) From 9b4b0ede9abba6539d3c5c94832a7db6f8afed0e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:24:04 +0100 Subject: [PATCH 170/717] refactoring --- Qa/Dumper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Qa/Dumper.php b/Qa/Dumper.php index ef2e30eaa..d3b099905 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -59,8 +59,8 @@ private function dumpArrayElements(array $a):string {return df_cc_n(df_map_k(df_ * @param object $o */ private function dumpObject($o):string {/** @var string $r */ - $hash = spl_object_hash($o); /** @var string $hash */ - if (isset($this->_dumped[$hash])) { + /** @var string $hash */ + if (isset($this->_dumped[$hash = spl_object_hash($o)])) { $r = sprintf('[recursion: %s]', get_class($o)); } else { @@ -74,7 +74,7 @@ private function dumpObject($o):string {/** @var string $r */ # "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 /** @var array(string => mixed)|null $a */ is_null($a = df_has_gd($o) ? df_gd($o) : (is_iterable($o) ? df_ita($o) : null)) - ? sprintf("$c %s", df_json_encode_partial($o)) + ? sprintf("$c: %s", df_json_encode_partial($o)) : sprintf("$c(\n%s\n)", df_tab_multiline($this->dumpArrayElements($a))) ); } From 4e9fc72b814e6be32c7b76f75c7c1957b4de02f4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:25:19 +0100 Subject: [PATCH 171/717] refactoring --- Qa/Dumper.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/Qa/Dumper.php b/Qa/Dumper.php index d3b099905..92527bb6a 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -66,9 +66,6 @@ private function dumpObject($o):string {/** @var string $r */ else { $this->_dumped[$hash] = true; $c = get_class($o); /** @var string $c */ - if (df_is_stringable($o)) { - $r = sprintf("`$c::__toString()`: «%s»", $o); - } $r = df_is_stringable($o) ? sprintf("`$c::__toString()`: «%s»", $o) : ( # 2023-07-26 # "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 From 1a0630aafbe0578d9c8e3374c210045e3ed638cc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:26:16 +0100 Subject: [PATCH 172/717] refactoring --- Qa/Dumper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Qa/Dumper.php b/Qa/Dumper.php index 92527bb6a..f691ac557 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -60,12 +60,12 @@ private function dumpArrayElements(array $a):string {return df_cc_n(df_map_k(df_ */ private function dumpObject($o):string {/** @var string $r */ /** @var string $hash */ + $c = get_class($o); /** @var string $c */ if (isset($this->_dumped[$hash = spl_object_hash($o)])) { - $r = sprintf('[recursion: %s]', get_class($o)); + $r = "[recursion: $c]"; } else { $this->_dumped[$hash] = true; - $c = get_class($o); /** @var string $c */ $r = df_is_stringable($o) ? sprintf("`$c::__toString()`: «%s»", $o) : ( # 2023-07-26 # "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 From 1a6f791b975dc5af42cb824404217a9fe06a084e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:47:39 +0100 Subject: [PATCH 173/717] refactoring --- Core/lib/text/main.php | 17 ----------------- Qa/Dumper.php | 3 +++ Qa/lib/dump/bool.php | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 Qa/lib/dump/bool.php diff --git a/Core/lib/text/main.php b/Core/lib/text/main.php index d611ceede..9bc9fb79b 100644 --- a/Core/lib/text/main.php +++ b/Core/lib/text/main.php @@ -10,23 +10,6 @@ */ const DF_THIN_SPACE = ' '; -/** - * @see df_bts_yn() - * @used-by \Df\Qa\Dumper::dump() - * @used-by \Dfe\AlphaCommerceHub\Method::charge() - * @used-by \Dfe\Vantiv\Charge::pCharge() - * @used-by \Inkifi\Pwinty\T\CaseT\V30\Order\Validate::t02() - */ -function df_bts(bool $v):string {return $v ? 'true' : 'false';} - -/** - * 2017-11-08 - * @used-by \Dfe\Stripe\Init\Action::redirectUrl() - * @used-by \Inkifi\Pwinty\Controller\Index\Index::execute() - * @see df_bts() - */ -function df_bts_yn(bool $v):string {return $v ? 'yes' : 'no';} - /** * Я так понимаю, здесь безопасно использовать @uses strpos вместо @see mb_strpos() даже для UTF-8. * http://stackoverflow.com/questions/13913411/mb-strpos-vs-strpos-whats-the-difference diff --git a/Qa/Dumper.php b/Qa/Dumper.php index f691ac557..7f40fb28e 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -66,6 +66,9 @@ private function dumpObject($o):string {/** @var string $r */ } else { $this->_dumped[$hash] = true; + if (df_is_stringable($o)) { + $v = strval($o); /** @var string $v */ + } $r = df_is_stringable($o) ? sprintf("`$c::__toString()`: «%s»", $o) : ( # 2023-07-26 # "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 diff --git a/Qa/lib/dump/bool.php b/Qa/lib/dump/bool.php new file mode 100644 index 000000000..d2582d242 --- /dev/null +++ b/Qa/lib/dump/bool.php @@ -0,0 +1,17 @@ + Date: Sun, 22 Sep 2024 21:49:03 +0100 Subject: [PATCH 174/717] refactoring --- Core/lib/text/contains/.php | 46 +++++++++++++++++++++++++++++++++++++ Core/lib/text/main.php | 46 ------------------------------------- 2 files changed, 46 insertions(+), 46 deletions(-) create mode 100644 Core/lib/text/contains/.php diff --git a/Core/lib/text/contains/.php b/Core/lib/text/contains/.php new file mode 100644 index 000000000..d4c17d2c2 --- /dev/null +++ b/Core/lib/text/contains/.php @@ -0,0 +1,46 @@ + Date: Sun, 22 Sep 2024 21:49:20 +0100 Subject: [PATCH 175/717] refactoring --- Core/lib/text/contains/ci.php | 6 ++++++ Core/lib/text/main.php | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 Core/lib/text/contains/ci.php diff --git a/Core/lib/text/contains/ci.php b/Core/lib/text/contains/ci.php new file mode 100644 index 000000000..05ccd78d6 --- /dev/null +++ b/Core/lib/text/contains/ci.php @@ -0,0 +1,6 @@ + Date: Sun, 22 Sep 2024 21:50:15 +0100 Subject: [PATCH 176/717] refactoring --- Core/lib/text/filter.php | 9 --------- Core/lib/text/is/guid.php | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 Core/lib/text/is/guid.php diff --git a/Core/lib/text/filter.php b/Core/lib/text/filter.php index 20d5e1228..017396816 100644 --- a/Core/lib/text/filter.php +++ b/Core/lib/text/filter.php @@ -21,15 +21,6 @@ function df_e(...$a) {return df_call_a(function(string $s):string {return htmlsp $s, ENT_QUOTES, 'UTF-8', false );}, $a);} -/** - * 2019-01-11 - * 2019-11-15 https://stackoverflow.com/a/1253417 - * @used-by \Inkifi\Consolidation\Controller\Adminhtml\Index\Index::execute() - */ -function df_is_guid(string $s):bool {return 36 === strlen($s) && preg_match( - '#^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$#', $s -);} - /** * http://darklaunch.com/2009/05/06/php-normalize-newlines-line-endings-crlf-cr-lf-unix-windows-mac * @used-by df_explode_n() diff --git a/Core/lib/text/is/guid.php b/Core/lib/text/is/guid.php new file mode 100644 index 000000000..404410022 --- /dev/null +++ b/Core/lib/text/is/guid.php @@ -0,0 +1,9 @@ + Date: Sun, 22 Sep 2024 21:51:23 +0100 Subject: [PATCH 177/717] refactoring --- Core/lib/text/filter.php | 6 ------ Core/lib/text/n/normalize.php | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 Core/lib/text/n/normalize.php diff --git a/Core/lib/text/filter.php b/Core/lib/text/filter.php index 017396816..de717cb35 100644 --- a/Core/lib/text/filter.php +++ b/Core/lib/text/filter.php @@ -21,12 +21,6 @@ function df_e(...$a) {return df_call_a(function(string $s):string {return htmlsp $s, ENT_QUOTES, 'UTF-8', false );}, $a);} -/** - * http://darklaunch.com/2009/05/06/php-normalize-newlines-line-endings-crlf-cr-lf-unix-windows-mac - * @used-by df_explode_n() - */ -function df_normalize(string $s):string {return strtr($s, ["\r\n" => "\n", "\r" => "\n"]);} - /** * 2017-04-22 * «+79.6-2» => «7962» diff --git a/Core/lib/text/n/normalize.php b/Core/lib/text/n/normalize.php new file mode 100644 index 000000000..226a781a1 --- /dev/null +++ b/Core/lib/text/n/normalize.php @@ -0,0 +1,6 @@ + "\n", "\r" => "\n"]);} \ No newline at end of file From d6780dd5156cc5b7630b5cbcfaf3eaf7f9a5e3b9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 21:52:01 +0100 Subject: [PATCH 178/717] refactoring --- Core/lib/text/explode.php | 16 ---------------- Core/lib/text/n/explode.php | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 Core/lib/text/n/explode.php diff --git a/Core/lib/text/explode.php b/Core/lib/text/explode.php index 4b5ac8ecf..3da7d5d9e 100644 --- a/Core/lib/text/explode.php +++ b/Core/lib/text/explode.php @@ -15,22 +15,6 @@ function df_explode_multiple(array $delimiters, string $s):array { return explode($main, str_replace($delimiters, $main, $s)); } -/** - * 2018-04-24 I have added @uses trim() today. - * @used-by df_module_enum() - * @used-by df_parse_colon() - * @used-by df_tab_multiline() - * @used-by df_zf_http_last_req() - * @used-by \Df\Core\Text\Regex::getSubjectSplitted() - * @used-by \Dfe\AllPay\Charge::descriptionOnKiosk() - * @used-by \Dfe\Moip\P\Charge::pInstructionLines() - * @used-by \Dfe\TBCBank\W\Reader::reqFilter() - * @used-by \Doormall\Shipping\Partner\Entity::locations() - * @used-by \Inkifi\Core\Plugin\Catalog\Block\Product\View::afterSetLayout() - * @return string[] - */ -function df_explode_n(string $s):array {return explode("\n", df_normalize(df_trim($s)));} - /** * 2016-09-03 Another implementation: df_explode_multiple(['/', DS], $path) * @used-by df_store_code_from_url() diff --git a/Core/lib/text/n/explode.php b/Core/lib/text/n/explode.php new file mode 100644 index 000000000..61b2f5a8d --- /dev/null +++ b/Core/lib/text/n/explode.php @@ -0,0 +1,16 @@ + Date: Sun, 22 Sep 2024 21:53:23 +0100 Subject: [PATCH 179/717] refactoring --- Core/lib/text/n/prepend.php | 6 ++++++ Core/lib/text/prepend-append.php | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 Core/lib/text/n/prepend.php diff --git a/Core/lib/text/n/prepend.php b/Core/lib/text/n/prepend.php new file mode 100644 index 000000000..0b361cbfd --- /dev/null +++ b/Core/lib/text/n/prepend.php @@ -0,0 +1,6 @@ + Date: Sun, 22 Sep 2024 21:54:00 +0100 Subject: [PATCH 180/717] refactoring --- Core/lib/text/concatenate.php | 49 ----------------------------------- Core/lib/text/n/cc.php | 49 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 Core/lib/text/n/cc.php diff --git a/Core/lib/text/concatenate.php b/Core/lib/text/concatenate.php index 900a3fd89..35fd30a18 100644 --- a/Core/lib/text/concatenate.php +++ b/Core/lib/text/concatenate.php @@ -29,55 +29,6 @@ function df_cc(string $glue, ...$a):string {return implode($glue, dfa_flatten($a */ function df_cc_br(...$a):string {return df_ccc("
", dfa_flatten($a));} -/** - * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm - * @used-by df_api_rr_failed() - * @used-by df_error_create() - * @used-by df_fe_init() - * @used-by df_kv() - * @used-by df_log_l() - * @used-by df_tag_list() - * @used-by df_tab_multiline() - * @used-by df_xml_g() - * @used-by df_xml_prettify() - * @used-by df_zf_http_last_req() - * @used-by dfp_error_message() - * @used-by \Df\Core\Html\Tag::content() - * @used-by \Df\Core\Text\Regex::getSubjectReportPart() - * @used-by \Df\Framework\Plugin\View\Asset\Source::aroundGetContent() - * @used-by \Df\Payment\Comment\Description::getCommentText() - * @used-by \Df\Qa\Dumper::dumpArrayElements() - * @used-by \Df\Qa\Method::raiseErrorParam() - * @used-by \Df\Qa\Method::raiseErrorResult() - * @used-by \Df\Qa\Method::raiseErrorVariable() - * @used-by \Df\Typography\Css::render() - * @used-by \Dfe\AllPay\Block\Info\Barcode::paymentId() - * @used-by \Dfe\Frontend\Block\ProductView\Css::_toHtml() - * @used-by \Dfe\GoogleFont\ResponseValidator::short() - * @used-by \Dfe\Klarna\Button::_toHtml() - * @used-by \Dfe\Markdown\FormElement::css() - * @used-by \Dfe\Sift\Test\CaseT\API\Account\Decisions::t01() - * @used-by \Dfe\Stripe\Block\Multishipping::_toHtml() - * @used-by \Inkifi\Map\HTML::tiles() - * @used-by \SayItWithAGift\Options\Frontend::_toHtml() - * @used-by \CabinetsBay\Catalog\B\Category::title() (https://github.com/cabinetsbay/catalog/issues/5) - * @used-by \TFC\Core\B\Home\Slider::i() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) - * @used-by \TFC\Core\B\Home\Slider::p() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) - * @used-by \Verdepieno\Core\CustomerAddressForm::f() - * @used-by \Wyomind\SimpleGoogleShopping\Model\Observer::checkToGenerate(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/26) - * @used-by app/code/WeltPixel/QuickCart/view/frontend/templates/checkout/cart/item/price/sidebar.phtml (https://github.com/cabinetsbay/site/issues/145) - * @used-by https://github.com/tradefurniturecompany/report/blob/1.0.3/view/frontend/templates/index.phtml#L25 - * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l2/l3/filters.phtml (https://github.com/cabinetsbay/catalog/issues/18) - * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l3/tabs/overview.phtml (https://github.com/cabinetsbay/catalog/issues/22) - * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/products/not-empty.phtml (https://github.com/cabinetsbay/catalog/issues/38) - * @used-by vendor/cabinetsbay/core/view/frontend/templates/Magento/Tax/item/price/unit.phtml (https://github.com/cabinetsbay/site/issues/143) - * @used-by vendor/cabinetsbay/core/view/frontend/templates/head.phtml (https://github.com/cabinetsbay/catalog/issues/39) - * @used-by vendor/mage2pro/portal-stripe/view/frontend/templates/page/customers.phtml - * @used-by vendor/mage2pro/portal/view/frontend/templates/root.phtml - * @param string|array(string) ...$a - */ -function df_cc_n(...$a):string {return df_ccc("\n", ...$a);} - /** * 2016-08-10 * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm diff --git a/Core/lib/text/n/cc.php b/Core/lib/text/n/cc.php new file mode 100644 index 000000000..669aaf6d8 --- /dev/null +++ b/Core/lib/text/n/cc.php @@ -0,0 +1,49 @@ + Date: Sun, 22 Sep 2024 22:06:13 +0100 Subject: [PATCH 181/717] refactoring --- Core/lib/lang/type/conversion/string.php | 3 ++- Core/lib/text/contains/.php | 1 + Core/lib/text/n/has.php | 6 ++++++ Core/lib/text/n/normalize.php | 2 ++ Core/lib/text/n/prepend.php | 1 + .../{prepend-append.php => prepend-append/other.php} | 1 + Core/lib/text/trim.php | 1 + Qa/Dumper.php | 10 ++++++---- 8 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 Core/lib/text/n/has.php rename Core/lib/text/{prepend-append.php => prepend-append/other.php} (98%) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index a49e7b4ad..6982d393f 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -15,7 +15,8 @@ * @see df_dump() * @see df_is_stringable() * @used-by df_type() + * @used-by \Df\Qa\Dumper::dumpObject() * @used-by \Df\Xml\G::importString() * @param mixed $v */ -function df_string($v):string {return strval(df_assert_stringable($v));} \ No newline at end of file +function df_string($v):string {return df_trim(df_normalize(strval(df_assert_stringable($v))));} \ No newline at end of file diff --git a/Core/lib/text/contains/.php b/Core/lib/text/contains/.php index d4c17d2c2..284c40297 100644 --- a/Core/lib/text/contains/.php +++ b/Core/lib/text/contains/.php @@ -8,6 +8,7 @@ * @used-by df_block_output() * @used-by df_bt_filter_head() * @used-by df_is_bin_magento() + * @used-by df_is_multiline() * @used-by df_request_ua() * @used-by df_rp_has() * @used-by ikf_ite() diff --git a/Core/lib/text/n/has.php b/Core/lib/text/n/has.php new file mode 100644 index 000000000..9a02aeec9 --- /dev/null +++ b/Core/lib/text/n/has.php @@ -0,0 +1,6 @@ + "\n", "\r" => "\n"]);} \ No newline at end of file diff --git a/Core/lib/text/n/prepend.php b/Core/lib/text/n/prepend.php index 0b361cbfd..bc4b4832e 100644 --- a/Core/lib/text/n/prepend.php +++ b/Core/lib/text/n/prepend.php @@ -1,6 +1,7 @@ _dumped[$hash] = true; - if (df_is_stringable($o)) { - $v = strval($o); /** @var string $v */ - } - $r = df_is_stringable($o) ? sprintf("`$c::__toString()`: «%s»", $o) : ( + /** @var string $v */ + $r = df_is_stringable($o) + ? sprintf("`$c::__toString()`%s", + !df_is_multiline($v = df_string($o)) ? " «{$v}»" : df_n_prepend(df_tab_multiline($v)) + ) + : ( # 2023-07-26 # "`df_dump()` should handle `Traversable` similar to arrays": https://github.com/mage2pro/core/issues/253 /** @var array(string => mixed)|null $a */ From 284b57de17b9d6cc4c33d567b70d5b18d264dc88 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:06:45 +0100 Subject: [PATCH 182/717] refactoring --- Core/lib/text/prepend-append/other.php | 8 -------- Core/lib/text/prepend-append/tab.php | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 Core/lib/text/prepend-append/tab.php diff --git a/Core/lib/text/prepend-append/other.php b/Core/lib/text/prepend-append/other.php index 5eae8f31f..a430b10b5 100644 --- a/Core/lib/text/prepend-append/other.php +++ b/Core/lib/text/prepend-append/other.php @@ -66,14 +66,6 @@ function df_pad0(int $length, string $number):string {return str_pad($number, $l */ function df_prepend(string $s, string $head):string {return df_starts_with($s, $head) ? $s : $head . $s;} -/** - * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm - * @used-by df_tab_multiline() - * @param string|string[] ...$a - * @return string|string[]|array(string => string) - */ -function df_tab(...$a) {return df_call_a($a, function(string $s):string {return "\t" . $s;});} - /** * @used-by \Df\Core\Html\Tag::content() * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() diff --git a/Core/lib/text/prepend-append/tab.php b/Core/lib/text/prepend-append/tab.php new file mode 100644 index 000000000..5ab6434d5 --- /dev/null +++ b/Core/lib/text/prepend-append/tab.php @@ -0,0 +1,8 @@ + string) + */ +function df_tab(...$a) {return df_call_a($a, function(string $s):string {return "\t" . $s;});} \ No newline at end of file From 56e8129af4780d323b3fc9888d83c87ae3bb90a8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:07:19 +0100 Subject: [PATCH 183/717] refactoring --- Core/lib/text/prepend-append/other.php | 12 +----------- Core/lib/text/prepend-append/tab.php | 12 +++++++++++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Core/lib/text/prepend-append/other.php b/Core/lib/text/prepend-append/other.php index a430b10b5..8275cf308 100644 --- a/Core/lib/text/prepend-append/other.php +++ b/Core/lib/text/prepend-append/other.php @@ -64,14 +64,4 @@ function df_pad0(int $length, string $number):string {return str_pad($number, $l * @used-by ikf_ite() * @used-by \Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterGetElementHtml() */ -function df_prepend(string $s, string $head):string {return df_starts_with($s, $head) ? $s : $head . $s;} - -/** - * @used-by \Df\Core\Html\Tag::content() - * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() - * @used-by \Df\Qa\Dumper::dumpArray() - * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Typography\Css::render() - */ -function df_tab_multiline(string $s):string {return df_cc_n(df_tab(df_explode_n($s)));} \ No newline at end of file +function df_prepend(string $s, string $head):string {return df_starts_with($s, $head) ? $s : $head . $s;} \ No newline at end of file diff --git a/Core/lib/text/prepend-append/tab.php b/Core/lib/text/prepend-append/tab.php index 5ab6434d5..ce5b1ebba 100644 --- a/Core/lib/text/prepend-append/tab.php +++ b/Core/lib/text/prepend-append/tab.php @@ -5,4 +5,14 @@ * @param string|string[] ...$a * @return string|string[]|array(string => string) */ -function df_tab(...$a) {return df_call_a($a, function(string $s):string {return "\t" . $s;});} \ No newline at end of file +function df_tab(...$a) {return df_call_a($a, function(string $s):string {return "\t" . $s;});} + +/** + * @used-by \Df\Core\Html\Tag::content() + * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() + * @used-by \Df\Qa\Dumper::dumpArray() + * @used-by \Df\Qa\Dumper::dumpObject() + * @used-by \Df\Qa\Dumper::dumpObject() + * @used-by \Df\Typography\Css::render() + */ +function df_tab_multiline(string $s):string {return df_cc_n(df_tab(df_explode_n($s)));} \ No newline at end of file From 491833cfd5700651fbee13cd5af8f95ccf980dca Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:08:08 +0100 Subject: [PATCH 184/717] refactoring --- Core/lib/text/prepend-append/other.php | 52 -------------------------- Core/lib/text/prepend-append/pad.php | 52 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 Core/lib/text/prepend-append/pad.php diff --git a/Core/lib/text/prepend-append/other.php b/Core/lib/text/prepend-append/other.php index 8275cf308..7b8b33f5c 100644 --- a/Core/lib/text/prepend-append/other.php +++ b/Core/lib/text/prepend-append/other.php @@ -6,58 +6,6 @@ */ function df_append(string $s, string $tail):string {return df_ends_with($s, $tail) ? $s : $s . $tail;} -/** - * Аналог @see str_pad() для Unicode: http://stackoverflow.com/a/14773638 - * @used-by df_kv() - * @used-by \Dfe\Moip\CardFormatter::label() - */ -function df_pad(string $phrase, int $length, string $pattern = ' ', int $position = STR_PAD_RIGHT):string {/** @var string $r */ - $encoding = 'UTF-8'; /** @var string $encoding */ - $input_length = mb_strlen($phrase, $encoding); /** @var int $input_length */ - $pad_string_length = mb_strlen($pattern, $encoding); /** @var int $pad_string_length */ - if ($length <= 0 || $length - $input_length <= 0) { - $r = $phrase; - } - else { - $num_pad_chars = $length - $input_length; /** @var int $num_pad_chars */ - /** @var int $left_pad */ /** @var int $right_pad */ - switch ($position) { - case STR_PAD_RIGHT: - # 2024-06-06 "Use the «Symmetric array destructuring» PHP 7.1 feature": https://github.com/mage2pro/core/issues/379 - [$left_pad, $right_pad] = [0, $num_pad_chars]; - break; - case STR_PAD_LEFT: - # 2024-06-06 "Use the «Symmetric array destructuring» PHP 7.1 feature": https://github.com/mage2pro/core/issues/379 - [$left_pad, $right_pad] = [$num_pad_chars, 0]; - break; - case STR_PAD_BOTH: - $left_pad = floor($num_pad_chars / 2); - $right_pad = $num_pad_chars - $left_pad; - break; - default: - df_error(); - } - $r = ''; - for ($i = 0; $i < $left_pad; ++$i) { - $r .= mb_substr($pattern, $i % $pad_string_length, 1, $encoding); - } - $r .= $phrase; - for ($i = 0; $i < $right_pad; ++$i) { - $r .= mb_substr($pattern, $i % $pad_string_length, 1, $encoding); - } - } - return $r; -} - -/** - * 2015-11-29 Добавляет к строковому представлению целого числа нули слева. - * 2015-12-01 - * Строковое представление может быть 16-ричным (код цвета), поэтому убрал @see df_int() - * http://stackoverflow.com/a/1699980 - * @used-by df_rgb2hex() - */ -function df_pad0(int $length, string $number):string {return str_pad($number, $length, '0', STR_PAD_LEFT);} - /** * 2016-03-08 It adds the $head prefix to the $s string if the prefix is absent in $s. * @used-by df_sys_path_abs() diff --git a/Core/lib/text/prepend-append/pad.php b/Core/lib/text/prepend-append/pad.php new file mode 100644 index 000000000..878440e24 --- /dev/null +++ b/Core/lib/text/prepend-append/pad.php @@ -0,0 +1,52 @@ + Date: Sun, 22 Sep 2024 22:08:32 +0100 Subject: [PATCH 185/717] refactoring --- Core/lib/text/prepend-append/append.php | 7 +++++++ Core/lib/text/prepend-append/other.php | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 Core/lib/text/prepend-append/append.php diff --git a/Core/lib/text/prepend-append/append.php b/Core/lib/text/prepend-append/append.php new file mode 100644 index 000000000..521664bff --- /dev/null +++ b/Core/lib/text/prepend-append/append.php @@ -0,0 +1,7 @@ + Date: Sun, 22 Sep 2024 22:10:15 +0100 Subject: [PATCH 186/717] refactoring --- Core/lib/text/{prepend-append => }/append.php | 0 .../text/{prepend-append/other.php => prepend/.php} | 0 Core/lib/text/prepend/pad.php | 9 +++++++++ .../{prepend-append/pad.php => prepend/space.php} | 11 +---------- Core/lib/text/{prepend-append => prepend}/tab.php | 0 5 files changed, 10 insertions(+), 10 deletions(-) rename Core/lib/text/{prepend-append => }/append.php (100%) rename Core/lib/text/{prepend-append/other.php => prepend/.php} (100%) create mode 100644 Core/lib/text/prepend/pad.php rename Core/lib/text/{prepend-append/pad.php => prepend/space.php} (77%) rename Core/lib/text/{prepend-append => prepend}/tab.php (100%) diff --git a/Core/lib/text/prepend-append/append.php b/Core/lib/text/append.php similarity index 100% rename from Core/lib/text/prepend-append/append.php rename to Core/lib/text/append.php diff --git a/Core/lib/text/prepend-append/other.php b/Core/lib/text/prepend/.php similarity index 100% rename from Core/lib/text/prepend-append/other.php rename to Core/lib/text/prepend/.php diff --git a/Core/lib/text/prepend/pad.php b/Core/lib/text/prepend/pad.php new file mode 100644 index 000000000..9f60d39e4 --- /dev/null +++ b/Core/lib/text/prepend/pad.php @@ -0,0 +1,9 @@ + Date: Sun, 22 Sep 2024 22:13:27 +0100 Subject: [PATCH 187/717] refactoring --- Core/lib/text/append.php | 7 ------- Core/lib/text/{prepend => prepend-append}/.php | 7 +++++++ Core/lib/text/{prepend/pad.php => prepend-append/0.php} | 0 Core/lib/text/{prepend => prepend-append}/space.php | 0 Core/lib/text/{prepend => prepend-append}/tab.php | 0 5 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 Core/lib/text/append.php rename Core/lib/text/{prepend => prepend-append}/.php (57%) rename Core/lib/text/{prepend/pad.php => prepend-append/0.php} (100%) rename Core/lib/text/{prepend => prepend-append}/space.php (100%) rename Core/lib/text/{prepend => prepend-append}/tab.php (100%) diff --git a/Core/lib/text/append.php b/Core/lib/text/append.php deleted file mode 100644 index 521664bff..000000000 --- a/Core/lib/text/append.php +++ /dev/null @@ -1,7 +0,0 @@ - Date: Sun, 22 Sep 2024 22:14:12 +0100 Subject: [PATCH 188/717] refactoring --- Core/lib/text/prepend-append/0.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/text/prepend-append/0.php b/Core/lib/text/prepend-append/0.php index 9f60d39e4..d36926389 100644 --- a/Core/lib/text/prepend-append/0.php +++ b/Core/lib/text/prepend-append/0.php @@ -1,6 +1,6 @@ Date: Sun, 22 Sep 2024 22:15:39 +0100 Subject: [PATCH 189/717] refactoring --- Core/lib/text/prepend-append/0.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/text/prepend-append/0.php b/Core/lib/text/prepend-append/0.php index d36926389..2322d9c0a 100644 --- a/Core/lib/text/prepend-append/0.php +++ b/Core/lib/text/prepend-append/0.php @@ -1,9 +1,9 @@ Date: Sun, 22 Sep 2024 22:17:38 +0100 Subject: [PATCH 190/717] refactoring --- Core/lib/text/prepend-append/{space.php => pad.php} | 1 + Core/lib/text/prepend-append/{0.php => pad0.php} | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename Core/lib/text/prepend-append/{space.php => pad.php} (98%) rename Core/lib/text/prepend-append/{0.php => pad0.php} (75%) diff --git a/Core/lib/text/prepend-append/space.php b/Core/lib/text/prepend-append/pad.php similarity index 98% rename from Core/lib/text/prepend-append/space.php rename to Core/lib/text/prepend-append/pad.php index caa02f4b8..13a8b071b 100644 --- a/Core/lib/text/prepend-append/space.php +++ b/Core/lib/text/prepend-append/pad.php @@ -2,6 +2,7 @@ /** * Аналог @see str_pad() для Unicode: http://stackoverflow.com/a/14773638 * @used-by df_kv() + * @used-by df_pad0() * @used-by \Dfe\Moip\CardFormatter::label() */ function df_pad(string $phrase, int $length, string $pattern = ' ', int $position = STR_PAD_RIGHT):string {/** @var string $r */ diff --git a/Core/lib/text/prepend-append/0.php b/Core/lib/text/prepend-append/pad0.php similarity index 75% rename from Core/lib/text/prepend-append/0.php rename to Core/lib/text/prepend-append/pad0.php index 2322d9c0a..7862da171 100644 --- a/Core/lib/text/prepend-append/0.php +++ b/Core/lib/text/prepend-append/pad0.php @@ -6,4 +6,4 @@ * http://stackoverflow.com/a/1699980 * @used-by df_rgb2hex() */ -function df_pad0(int $count, string $s):string {return str_pad($s, $count, '0', STR_PAD_LEFT);} \ No newline at end of file +function df_pad0(int $count, string $s):string {return df_pad($s, $count, '0', STR_PAD_LEFT);} \ No newline at end of file From d21a15a80c82bbd518568585b29b318ba3542314 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:23:40 +0100 Subject: [PATCH 191/717] refactoring --- Core/lib/json.php | 1 - Qa/lib/dump/.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/json.php b/Core/lib/json.php index 40262969c..b8b55c98f 100644 --- a/Core/lib/json.php +++ b/Core/lib/json.php @@ -152,7 +152,6 @@ function df_json_dont_sort(F $f) {/** @var mixed $r */ * @used-by \Df\Security\BlackList::save() * @used-by \Df\Sentry\Client::encode() * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() - * @used-by \Dfe\BlackbaudNetCommunity\Customer::p() * @used-by \Dfe\Color\Plugin\Swatches\Model\Swatch::beforeBeforeSave() * @used-by \Dfe\Dynamics365\API\Validator\JSON::long() * @used-by \Dfe\Moip\API\Validator::long() diff --git a/Qa/lib/dump/.php b/Qa/lib/dump/.php index b81bc797c..da9cacdee 100644 --- a/Qa/lib/dump/.php +++ b/Qa/lib/dump/.php @@ -22,6 +22,7 @@ * @used-by \Df\Sentry\Client::capture() * @used-by \Df\Sentry\Extra::adjust() * @used-by \Df\Zf\Validate::message() + * @used-by \Dfe\BlackbaudNetCommunity\Customer::p() * @used-by \Dfe\Dynamics365\Test\OAuth::discovery() * @used-by \Dfe\Geo\Test\Basic::t01() * @used-by \Dfe\Portal\Test\Basic::t01() From 8f2106fb7ae40f43d38ee4405626411fa59bc3b5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:34:17 +0100 Subject: [PATCH 192/717] refactoring --- Core/lib/json.php | 2 ++ Core/lib/lang/type/conversion/string.php | 2 +- Core/lib/text/n/normalize.php | 1 + Core/lib/text/trim.php | 1 + Qa/Dumper.php | 8 +++++++- Qa/lib/dump/.php | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Core/lib/json.php b/Core/lib/json.php index b8b55c98f..a0c887610 100644 --- a/Core/lib/json.php +++ b/Core/lib/json.php @@ -8,6 +8,7 @@ * Но оно меня не устроило. И без собаки будет Warning. * @used-by df_check_json_complex() * @used-by \Df\API\Client::_p() + * @used-by \Df\Qa\Dumper::dumpS() * @param mixed $v */ function df_check_json($v):bool {return !is_null(@json_decode($v));} @@ -199,6 +200,7 @@ function df_json_file_read(string $p) {return df_json_decode(df_contents($p));} /** * 2017-07-05 * @used-by \Df\API\Client::_p() + * @used-by \Df\Qa\Dumper::dumpS() * @param string|array(string => mixed) $j */ function df_json_prettify($j):string {return df_json_encode(df_json_decode($j));} diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 6982d393f..a542dc89e 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -19,4 +19,4 @@ * @used-by \Df\Xml\G::importString() * @param mixed $v */ -function df_string($v):string {return df_trim(df_normalize(strval(df_assert_stringable($v))));} \ No newline at end of file +function df_string($v):string {return df_dump(strval(df_assert_stringable($v)));} \ No newline at end of file diff --git a/Core/lib/text/n/normalize.php b/Core/lib/text/n/normalize.php index c0ee21bf4..7348ea706 100644 --- a/Core/lib/text/n/normalize.php +++ b/Core/lib/text/n/normalize.php @@ -4,5 +4,6 @@ * @used-by df_explode_n() * @used-by df_is_multiline() * @used-by df_string() + * @used-by \Df\Qa\Dumper::dumpS() */ function df_normalize(string $s):string {return strtr($s, ["\r\n" => "\n", "\r" => "\n"]);} \ No newline at end of file diff --git a/Core/lib/text/trim.php b/Core/lib/text/trim.php index a82c6b045..1fc6dcd37 100644 --- a/Core/lib/text/trim.php +++ b/Core/lib/text/trim.php @@ -42,6 +42,7 @@ function df_chop(string $s, int $max = 0):string {return !$max || (mb_strlen($s * @used-by \Df\Config\Source\LetterCase::apply() * @used-by \Df\Core\Html\Tag::content() * @used-by \Df\Framework\Form\Element::uidSt() + * @used-by \Df\Qa\Dumper::dumpS() * @used-by \Df\Qa\Failure::sections() * @used-by \Dfe\Portal\Block\Content::getTemplate() * @used-by \Dfe\Portal\Controller\Index\Index::execute() diff --git a/Qa/Dumper.php b/Qa/Dumper.php index 9565bb46b..33979ee39 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -8,7 +8,7 @@ final class Dumper { * @param mixed $v */ function dump($v):string {return is_object($v) ? $this->dumpObject($v) : ( - is_array($v) ? $this->dumpArray($v) : (is_bool($v) ? df_bts($v) : (is_string($v) ? $v : print_r($v, true))) + is_array($v) ? $this->dumpArray($v) : (is_bool($v) ? df_bts($v) : (is_string($v) ? $this->dumpS($v) : print_r($v, true))) );} /** @used-by self::dump() */ @@ -83,6 +83,12 @@ private function dumpObject($o):string {/** @var string $r */ return $r; } + /** + * 2024-09-23 + * @used-by self::dump() + */ + private function dumpS(string $s):string {return !df_check_json($r = df_trim(df_normalize($s))) ? $r : df_json_prettify($r);} + /** * @used-by self::dumpObject() * @var array(string => bool) diff --git a/Qa/lib/dump/.php b/Qa/lib/dump/.php index da9cacdee..249b78161 100644 --- a/Qa/lib/dump/.php +++ b/Qa/lib/dump/.php @@ -14,6 +14,7 @@ * @used-by df_kv() * @used-by df_kv_table() * @used-by df_sentry() + * @used-by df_string() * @used-by df_type() * @used-by dfa_assert_keys() * @used-by dfc() From 888d2bb8aa6779b0fe24a36b62ad3c97209bbb75 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:35:41 +0100 Subject: [PATCH 193/717] refactoring --- API/Client.php | 3 +-- Core/lib/json.php | 2 -- Qa/lib/dump/.php | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/API/Client.php b/API/Client.php index 77170c132..49690cb75 100644 --- a/API/Client.php +++ b/API/Client.php @@ -389,8 +389,7 @@ private function _p():array { $path = df_url_path($this->url()); /** @var string $path */ df_log( (!$path ? 'A' : "A `{$path}`") . " {$title} API request has succeeded\n" - . "Request:\n$req\nResponse:\n" - . (!df_check_json($resBody) ? $resBody : df_json_prettify($resBody)) + . "Request:\n$req\nResponse:\n" . df_dump($resBody) , $m ); } diff --git a/Core/lib/json.php b/Core/lib/json.php index a0c887610..eed39b15e 100644 --- a/Core/lib/json.php +++ b/Core/lib/json.php @@ -7,7 +7,6 @@ * Видел решение здесь: http://stackoverflow.com/a/6041773 * Но оно меня не устроило. И без собаки будет Warning. * @used-by df_check_json_complex() - * @used-by \Df\API\Client::_p() * @used-by \Df\Qa\Dumper::dumpS() * @param mixed $v */ @@ -199,7 +198,6 @@ function df_json_file_read(string $p) {return df_json_decode(df_contents($p));} /** * 2017-07-05 - * @used-by \Df\API\Client::_p() * @used-by \Df\Qa\Dumper::dumpS() * @param string|array(string => mixed) $j */ diff --git a/Qa/lib/dump/.php b/Qa/lib/dump/.php index 249b78161..78d59ed3f 100644 --- a/Qa/lib/dump/.php +++ b/Qa/lib/dump/.php @@ -19,6 +19,7 @@ * @used-by dfa_assert_keys() * @used-by dfc() * @used-by dfs_con() + * @used-by \Df\API\Client::_p() * @used-by \Df\Framework\Form\Element\Text::getValue() * @used-by \Df\Sentry\Client::capture() * @used-by \Df\Sentry\Extra::adjust() From 0cd4bb3a7b50de2871cc3f8c71504e8fad0c25cd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:36:14 +0100 Subject: [PATCH 194/717] refactoring --- API/Client.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/API/Client.php b/API/Client.php index 49690cb75..9700e1916 100644 --- a/API/Client.php +++ b/API/Client.php @@ -413,9 +413,7 @@ private function _p():array { $e2 = df_error_create( (!$path ? 'A' : "A `{$path}`") . " {$title} API request has failed" . ($short ? ": «{$short}»" : ' without error messages') . ".\n" - . ($long === $short ? "Request:\n$req" : df_kv([ - 'The full error description' => $long, 'Request' => $req - ])) + . ($long === $short ? "Request:\n$req" : df_kv(['The full error description' => $long, 'Request' => $req])) ); /** @var DFE $e2 */ if (!$this->_silent) { df_log_l($m, $e2); From 180c71a59dc364d249c9bd61e9038b7f597595b6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:37:54 +0100 Subject: [PATCH 195/717] refactoring --- Core/Helper/Text.php | 3 --- Core/Text/Regex.php | 4 +--- Core/lib/text/main.php | 1 - Core/lib/text/n/has.php | 1 + 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Core/Helper/Text.php b/Core/Helper/Text.php index c992e0fde..ee7a2da4a 100644 --- a/Core/Helper/Text.php +++ b/Core/Helper/Text.php @@ -1,9 +1,6 @@ isMultiline( - $this->getSubject() - );});} + private function isSubjectMultiline():bool {return dfc($this, function() {return df_is_multiline($this->getSubject());});} /** * @used-by self::getSubjectReportPart() diff --git a/Core/lib/text/main.php b/Core/lib/text/main.php index 023ce6eed..3e2eeae22 100644 --- a/Core/lib/text/main.php +++ b/Core/lib/text/main.php @@ -24,7 +24,6 @@ function df_strings_are_equal_ci(string $s1, string $s2):bool {return 0 === strc * @used-by df_quote_double() * @used-by df_quote_russian() * @used-by df_quote_single() - * @used-by \Df\Core\Text\Regex::isSubjectMultiline() */ function df_t():T {return T::s();} diff --git a/Core/lib/text/n/has.php b/Core/lib/text/n/has.php index 9a02aeec9..b9bdd5192 100644 --- a/Core/lib/text/n/has.php +++ b/Core/lib/text/n/has.php @@ -1,6 +1,7 @@ Date: Sun, 22 Sep 2024 22:46:07 +0100 Subject: [PATCH 196/717] refactoring --- Core/Helper/Text.php | 42 ----------------------------------- Core/lib/text/n/normalize.php | 1 + Core/lib/text/n/remove.php | 21 ++++++++++++++++++ 3 files changed, 22 insertions(+), 42 deletions(-) create mode 100644 Core/lib/text/n/remove.php diff --git a/Core/Helper/Text.php b/Core/Helper/Text.php index ee7a2da4a..f26187c51 100644 --- a/Core/Helper/Text.php +++ b/Core/Helper/Text.php @@ -27,48 +27,6 @@ function quote($s, string $t = self::QUOTE__RUSSIAN) { return !is_array($s) ? $f($s) : array_map($f, $s); } - /** - * 2015-03-03 Алгоритм аналогичен @see singleLine() - * 2015-07-07 - * 1) Раньше алгоритм был таким: `strtr($text, "\r\n", ' ')`. - * Однако он не совсем правилен, потому что если перенос строки записан в формате Windows - * (то есть, в качестве переноса строки используется последовательность \r\n), - * то прошлый алгоритм заменит эту последовательность на 2 пробела, а надо — на один: - * «If given three arguments, - * this function returns a copy of str where all occurrences of each (single-byte) character in from - * have been translated to the corresponding character in to, - * i.e., every occurrence of $from[$n] has been replaced with $to[$n], - * where $n is a valid offset in both arguments. - * If from and to have different lengths, - * the extra characters in the longer of the two are ignored. - * The length of str will be the same as the return value's.» - * https://php.net/strtr - * Новый алгоритм взял отсюда: http://stackoverflow.com/a/20717751 - * 2021-12-13 @deprecated It is unused. - */ - function removeLineBreaks(string $s):string {return str_replace(["\r\n", "\r", "\n"], ' ', $s);} - - /** - * 2015-03-03 Алгоритм аналогичен @see self::removeLineBreaks() - * 2015-07-07 - * Раньше алгоритм был таким: `strtr($text, "\r\n", ' ')`. - * Однако он не совсем правилен, потому что если перенос строки записан в формате Windows - * (то есть, в качестве переноса строки используется последовательность \r\n), - * то прошлый алгоритм заменит эту последовательность на 2 пробела, а надо — на один: - * «If given three arguments, - * this function returns a copy of str where all occurrences of each (single-byte) character in from - * have been translated to the corresponding character in to, - * i.e., every occurrence of $from[$n] has been replaced with $to[$n], - * where $n is a valid offset in both arguments. - * If from and to have different lengths, - * the extra characters in the longer of the two are ignored. - * The length of str will be the same as the return value's.» - * https://php.net/strtr - * Новый алгоритм взял отсюда: http://stackoverflow.com/a/20717751 - * 2023-07-29 @deprecated It is unused. - */ - function singleLine(string $s):string {return str_replace(["\r\n", "\r", "\n", "\t"], ' ', $s);} - /** * @used-by df_quote_double() * @used-by self::quote() diff --git a/Core/lib/text/n/normalize.php b/Core/lib/text/n/normalize.php index 7348ea706..c49a5190d 100644 --- a/Core/lib/text/n/normalize.php +++ b/Core/lib/text/n/normalize.php @@ -3,6 +3,7 @@ * http://darklaunch.com/2009/05/06/php-normalize-newlines-line-endings-crlf-cr-lf-unix-windows-mac * @used-by df_explode_n() * @used-by df_is_multiline() + * @used-by df_single_line() * @used-by df_string() * @used-by \Df\Qa\Dumper::dumpS() */ diff --git a/Core/lib/text/n/remove.php b/Core/lib/text/n/remove.php new file mode 100644 index 000000000..c7dcbe186 --- /dev/null +++ b/Core/lib/text/n/remove.php @@ -0,0 +1,21 @@ + Date: Sun, 22 Sep 2024 22:49:34 +0100 Subject: [PATCH 197/717] refactoring --- Core/Html/Tag.php | 2 +- Core/lib/text/n/has.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/Html/Tag.php b/Core/Html/Tag.php index e2e589c78..c48418dc7 100644 --- a/Core/Html/Tag.php +++ b/Core/Html/Tag.php @@ -51,7 +51,7 @@ function render():string {return /** @used-by self::render() */ private function content():string {return dfc($this, function() { $c = df_trim(df_cc_n($this->_content), "\n"); /** @var string $c */ - return $this->tagIs('pre', 'code') || !df_contains($c, "\n") ? $c : "\n" . df_tab_multiline($c) . "\n"; + return $this->tagIs('pre', 'code') || !df_is_multiline($c) ? $c : "\n" . df_tab_multiline($c) . "\n"; });} /** @used-by self::render() */ diff --git a/Core/lib/text/n/has.php b/Core/lib/text/n/has.php index b9bdd5192..4155d9a4f 100644 --- a/Core/lib/text/n/has.php +++ b/Core/lib/text/n/has.php @@ -1,6 +1,7 @@ Date: Sun, 22 Sep 2024 22:52:42 +0100 Subject: [PATCH 198/717] refactoring --- Core/lib/text/format.php | 2 +- Qa/lib/dump/.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/lib/text/format.php b/Core/lib/text/format.php index b3038e84b..a08fdf9ae 100644 --- a/Core/lib/text/format.php +++ b/Core/lib/text/format.php @@ -98,7 +98,7 @@ function df_sprintf_strict($s):string {/** @var string $r */ /** @var mixed[] $a 'df_sprintf_strict failed: «{message}».' . "\nPattern: {$s}." . "\nParameters:\n{params}." - ,['{message}' => df_xts($th), '{params}' => print_r(df_tail($args), true)] + ,['{message}' => df_xts($th), '{params}' => df_dump(df_tail($args))] ); }); } diff --git a/Qa/lib/dump/.php b/Qa/lib/dump/.php index 78d59ed3f..b8421cb3d 100644 --- a/Qa/lib/dump/.php +++ b/Qa/lib/dump/.php @@ -14,6 +14,7 @@ * @used-by df_kv() * @used-by df_kv_table() * @used-by df_sentry() + * @used-by df_sprintf_strict() * @used-by df_string() * @used-by df_type() * @used-by dfa_assert_keys() From c8e50af58faaecc481c8bad4ced52461ae9ecceb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:53:44 +0100 Subject: [PATCH 199/717] refactoring --- Core/Text/Regex.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Core/Text/Regex.php b/Core/Text/Regex.php index c417e7206..c25650fc0 100644 --- a/Core/Text/Regex.php +++ b/Core/Text/Regex.php @@ -180,8 +180,7 @@ private function throwInternalError():void { } elseif (!$this->isSubjectTooLongToReport()) { $m = - "При применении регулярного выражения «{$this->getPattern()}»" - ." произошёл сбой{$errorCodeForUser}." + "При применении регулярного выражения «{$this->getPattern()}» произошёл сбой{$errorCodeForUser}." ."\nТекст, к которому применялось регулярное выражение:" ."\nНАЧАЛО ТЕКСТА:\n{$this->getSubject()}\nКОНЕЦ ТЕКСТА" ; @@ -189,8 +188,7 @@ private function throwInternalError():void { else { df_report($this->getReportFileName(), $this->getSubject()); $m = - "При применении регулярного выражения «{$this->getPattern()}»" - ." произошёл сбой{$errorCodeForUser}." + "При применении регулярного выражения «{$this->getPattern()}» произошёл сбой{$errorCodeForUser}." ."\nТекст, к которому применялось регулярное выражение," ." смотрите в файле {$this->getReportFilePath()}." ."\nПервые {$this->getSubjectMaxLinesToReport()} строк текста:" From 5d84aaff54046203df3fa9aecdbb45768f68f327 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:57:12 +0100 Subject: [PATCH 200/717] refactoring --- Core/lib/json.php | 1 - Qa/lib/dump/.php | 1 + StripeClone/Block/Info.php | 4 +--- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Core/lib/json.php b/Core/lib/json.php index eed39b15e..6130d82d1 100644 --- a/Core/lib/json.php +++ b/Core/lib/json.php @@ -151,7 +151,6 @@ function df_json_dont_sort(F $f) {/** @var mixed $r */ * @used-by \Df\Qa\Dumper::dumpArray() * @used-by \Df\Security\BlackList::save() * @used-by \Df\Sentry\Client::encode() - * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() * @used-by \Dfe\Color\Plugin\Swatches\Model\Swatch::beforeBeforeSave() * @used-by \Dfe\Dynamics365\API\Validator\JSON::long() * @used-by \Dfe\Moip\API\Validator::long() diff --git a/Qa/lib/dump/.php b/Qa/lib/dump/.php index b8421cb3d..b5473cfbf 100644 --- a/Qa/lib/dump/.php +++ b/Qa/lib/dump/.php @@ -24,6 +24,7 @@ * @used-by \Df\Framework\Form\Element\Text::getValue() * @used-by \Df\Sentry\Client::capture() * @used-by \Df\Sentry\Extra::adjust() + * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() * @used-by \Df\Zf\Validate::message() * @used-by \Dfe\BlackbaudNetCommunity\Customer::p() * @used-by \Dfe\Dynamics365\Test\OAuth::discovery() diff --git a/StripeClone/Block/Info.php b/StripeClone/Block/Info.php index b7ff419db..923f70230 100644 --- a/StripeClone/Block/Info.php +++ b/StripeClone/Block/Info.php @@ -54,9 +54,7 @@ final protected function cardDataFromChargeResponse($r):array { $r = is_array($r) ? $r : df_json_decode($r); /** @var array(string => mixed) $r */ /** @var string $pathToCard */ if (!($r = dfa_deep($r, $pathToCard = fCharge::s($this->m())->pathToCard()))) { - df_error("Unable to extract the bank card data by path «{$pathToCard}» from the charge:\n%s", - df_json_encode($r) - ); + df_error("Unable to extract the bank card data by path «{$pathToCard}» from the charge:\n%s", df_dump($r)); } return $r; } From 5e8f82ded46a1cd86693fbbb6b2f9ae5f2d11b2f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 22:58:34 +0100 Subject: [PATCH 201/717] refactoring --- Typography/Css.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Typography/Css.php b/Typography/Css.php index ee4ded982..c77a89c7d 100644 --- a/Typography/Css.php +++ b/Typography/Css.php @@ -7,11 +7,9 @@ final class Css extends \Df\Core\O { * @used-by \Df\Typography\Font::css() * @used-by \Dfe\Frontend\Block\ProductView\Css::customCss() */ - function render():string {return df_cc_n(df_map_k($this->_blocks, function(string $selector, array $rules) { - /** @var string[] $rules */ - $rulesS = df_tab_multiline(df_cc_n($rules)); /** @var string $rulesS */ - return "{$selector} {\n{$rulesS}\n}"; - }));} + function render():string {return df_cc_n(df_map_k($this->_blocks, function(string $selector, array $rules) {return sprintf( + "{$selector} {\n%s\n}", df_tab_multiline(df_cc_n($rules)) + );}));} /** * 2015-12-16 From 7f47b955fbc06bb81333e7a99a21c4824dcd3a3b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:00:13 +0100 Subject: [PATCH 202/717] refactoring --- Core/lib/text/prepend-append/tab.php | 2 +- Typography/Css.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/text/prepend-append/tab.php b/Core/lib/text/prepend-append/tab.php index ce5b1ebba..d4c3a5574 100644 --- a/Core/lib/text/prepend-append/tab.php +++ b/Core/lib/text/prepend-append/tab.php @@ -2,6 +2,7 @@ /** * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @used-by df_tab_multiline() + * @used-by \Df\Typography\Css::render() * @param string|string[] ...$a * @return string|string[]|array(string => string) */ @@ -13,6 +14,5 @@ function df_tab(...$a) {return df_call_a($a, function(string $s):string {return * @used-by \Df\Qa\Dumper::dumpArray() * @used-by \Df\Qa\Dumper::dumpObject() * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Typography\Css::render() */ function df_tab_multiline(string $s):string {return df_cc_n(df_tab(df_explode_n($s)));} \ No newline at end of file diff --git a/Typography/Css.php b/Typography/Css.php index c77a89c7d..e4f89c516 100644 --- a/Typography/Css.php +++ b/Typography/Css.php @@ -8,7 +8,7 @@ final class Css extends \Df\Core\O { * @used-by \Dfe\Frontend\Block\ProductView\Css::customCss() */ function render():string {return df_cc_n(df_map_k($this->_blocks, function(string $selector, array $rules) {return sprintf( - "{$selector} {\n%s\n}", df_tab_multiline(df_cc_n($rules)) + "{$selector} {\n%s\n}", df_cc_n(df_tab($rules)) );}));} /** From 1aa9440d4a1e3975c661e61f18f608f5524f117d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:12:58 +0100 Subject: [PATCH 203/717] refactoring --- Core/Html/Tag.php | 4 ++-- Core/lib/array/map/.php | 1 + Core/lib/lang/call/a.php | 1 - Core/lib/text/n/cc.php | 2 +- Core/lib/text/n/explode.php | 2 +- Core/lib/text/prepend-append/tab.php | 17 +++++++---------- Qa/Dumper.php | 6 +++--- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Core/Html/Tag.php b/Core/Html/Tag.php index c48418dc7..285c8054c 100644 --- a/Core/Html/Tag.php +++ b/Core/Html/Tag.php @@ -51,7 +51,7 @@ function render():string {return /** @used-by self::render() */ private function content():string {return dfc($this, function() { $c = df_trim(df_cc_n($this->_content), "\n"); /** @var string $c */ - return $this->tagIs('pre', 'code') || !df_is_multiline($c) ? $c : "\n" . df_tab_multiline($c) . "\n"; + return $this->tagIs('pre', 'code') || !df_is_multiline($c) ? $c : "\n" . df_tab($c) . "\n"; });} /** @used-by self::render() */ @@ -59,7 +59,7 @@ private function openTagWithAttributesAsText():string {return df_cc_s( $this->_tag ,$this->_multiline ? "\n" : null ,call_user_func( - $this->_multiline ? 'df_tab_multiline' : 'df_nop' + $this->_multiline ? 'df_tab' : 'df_nop' ,implode( $this->_multiline ? "\n" : ' ' /** diff --git a/Core/lib/array/map/.php b/Core/lib/array/map/.php index b2eac060c..80d501d9c 100644 --- a/Core/lib/array/map/.php +++ b/Core/lib/array/map/.php @@ -30,6 +30,7 @@ * @used-by df_mail() * @used-by df_prices() * @used-by df_qty() + * @used-by df_tab() * @used-by df_trim_text_left() * @used-by ikf_api_oi() * @used-by \CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) diff --git a/Core/lib/lang/call/a.php b/Core/lib/lang/call/a.php index 7a903573b..4fb0250bc 100644 --- a/Core/lib/lang/call/a.php +++ b/Core/lib/lang/call/a.php @@ -16,7 +16,6 @@ * @used-by df_mvar_name() * @used-by df_strtolower() * @used-by df_strtoupper() - * @used-by df_tab() * @used-by df_trim_ds() * @used-by df_ucfirst() * @used-by df_ucwords() diff --git a/Core/lib/text/n/cc.php b/Core/lib/text/n/cc.php index 669aaf6d8..071c8288e 100644 --- a/Core/lib/text/n/cc.php +++ b/Core/lib/text/n/cc.php @@ -7,7 +7,7 @@ * @used-by df_kv() * @used-by df_log_l() * @used-by df_tag_list() - * @used-by df_tab_multiline() + * @used-by df_tab() * @used-by df_xml_g() * @used-by df_xml_prettify() * @used-by df_zf_http_last_req() diff --git a/Core/lib/text/n/explode.php b/Core/lib/text/n/explode.php index 61b2f5a8d..914f13535 100644 --- a/Core/lib/text/n/explode.php +++ b/Core/lib/text/n/explode.php @@ -3,7 +3,7 @@ * 2018-04-24 I have added @uses trim() today. * @used-by df_module_enum() * @used-by df_parse_colon() - * @used-by df_tab_multiline() + * @used-by df_tab() * @used-by df_zf_http_last_req() * @used-by \Df\Core\Text\Regex::getSubjectSplitted() * @used-by \Dfe\AllPay\Charge::descriptionOnKiosk() diff --git a/Core/lib/text/prepend-append/tab.php b/Core/lib/text/prepend-append/tab.php index d4c3a5574..3bf596506 100644 --- a/Core/lib/text/prepend-append/tab.php +++ b/Core/lib/text/prepend-append/tab.php @@ -1,18 +1,15 @@ string) - */ -function df_tab(...$a) {return df_call_a($a, function(string $s):string {return "\t" . $s;});} - -/** + * 2022-11-26, 2024-09-23 + * @used-by df_tab() * @used-by \Df\Core\Html\Tag::content() * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() * @used-by \Df\Qa\Dumper::dumpArray() * @used-by \Df\Qa\Dumper::dumpObject() * @used-by \Df\Qa\Dumper::dumpObject() + * @used-by \Df\Typography\Css::render() + * @param string|string[] $v */ -function df_tab_multiline(string $s):string {return df_cc_n(df_tab(df_explode_n($s)));} \ No newline at end of file +function df_tab($v):string {return !is_array($v) ? df_tab(df_explode_n($v)) : + df_cc_n(df_map($v, function(string $s):string {return "\t$s";})) +;} \ No newline at end of file diff --git a/Qa/Dumper.php b/Qa/Dumper.php index 33979ee39..ab8b30e15 100644 --- a/Qa/Dumper.php +++ b/Qa/Dumper.php @@ -16,7 +16,7 @@ private function dumpArray(array $a):string {return # 2023-07-25 # "Return JSON from `\Df\Qa\Dumper::dumpArray()` for arrays without object elements": # https://github.com/mage2pro/core/issues/252 - !dfa_has_objects($a) ? df_json_encode($a) : "[\n" . df_tab_multiline($this->dumpArrayElements($a)) . "\n]" + !dfa_has_objects($a) ? df_json_encode($a) : "[\n" . df_tab($this->dumpArrayElements($a)) . "\n]" ;} /** @@ -69,7 +69,7 @@ private function dumpObject($o):string {/** @var string $r */ /** @var string $v */ $r = df_is_stringable($o) ? sprintf("`$c::__toString()`%s", - !df_is_multiline($v = df_string($o)) ? " «{$v}»" : df_n_prepend(df_tab_multiline($v)) + !df_is_multiline($v = df_string($o)) ? " «{$v}»" : df_n_prepend(df_tab($v)) ) : ( # 2023-07-26 @@ -77,7 +77,7 @@ private function dumpObject($o):string {/** @var string $r */ /** @var array(string => mixed)|null $a */ is_null($a = df_has_gd($o) ? df_gd($o) : (is_iterable($o) ? df_ita($o) : null)) ? sprintf("$c: %s", df_json_encode_partial($o)) - : sprintf("$c(\n%s\n)", df_tab_multiline($this->dumpArrayElements($a))) + : sprintf("$c(\n%s\n)", df_tab($this->dumpArrayElements($a))) ); } return $r; From f919a61e457512551d90895891bd251abb5dead2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:13:50 +0100 Subject: [PATCH 204/717] refactoring --- Core/lib/text/prepend-append/tab.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/text/prepend-append/tab.php b/Core/lib/text/prepend-append/tab.php index 3bf596506..bb19260ef 100644 --- a/Core/lib/text/prepend-append/tab.php +++ b/Core/lib/text/prepend-append/tab.php @@ -8,8 +8,8 @@ * @used-by \Df\Qa\Dumper::dumpObject() * @used-by \Df\Qa\Dumper::dumpObject() * @used-by \Df\Typography\Css::render() - * @param string|string[] $v + * @param string|iterable $v */ -function df_tab($v):string {return !is_array($v) ? df_tab(df_explode_n($v)) : +function df_tab($v):string {return !is_iterable($v) ? df_tab(df_explode_n($v)) : df_cc_n(df_map($v, function(string $s):string {return "\t$s";})) ;} \ No newline at end of file From deb0d860e35810bc0f4d5322d3b74771df9f8cbf Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:14:15 +0100 Subject: [PATCH 205/717] refactoring --- Typography/Css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Typography/Css.php b/Typography/Css.php index e4f89c516..c24266519 100644 --- a/Typography/Css.php +++ b/Typography/Css.php @@ -8,7 +8,7 @@ final class Css extends \Df\Core\O { * @used-by \Dfe\Frontend\Block\ProductView\Css::customCss() */ function render():string {return df_cc_n(df_map_k($this->_blocks, function(string $selector, array $rules) {return sprintf( - "{$selector} {\n%s\n}", df_cc_n(df_tab($rules)) + "{$selector} {\n%s\n}", df_tab($rules) );}));} /** From 0fa4a782e75e7e988c55247da12c4352bafb32dd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:26:55 +0100 Subject: [PATCH 206/717] refactoring --- Core/lib/lang/type/conversion/string.php | 1 + Core/lib/lang/type/stringable.php | 1 + Framework/W/Result/Json.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index a542dc89e..2b11dd98b 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -15,6 +15,7 @@ * @see df_dump() * @see df_is_stringable() * @used-by df_type() + * @used-by \Df\Framework\W\Result\Json::prepare() * @used-by \Df\Qa\Dumper::dumpObject() * @used-by \Df\Xml\G::importString() * @param mixed $v diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index c060f0a46..6168d1fea 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -4,6 +4,7 @@ * @see df_is_complex() * @see df_string() * @used-by df_assert_stringable() + * @used-by \Df\Framework\W\Result\Json::prepare() * @used-by \Df\Qa\Dumper::dumpObject() */ function df_is_stringable($v):bool {return !is_array($v) && diff --git a/Framework/W/Result/Json.php b/Framework/W/Result/Json.php index 7c95b4c53..90c6fbd94 100644 --- a/Framework/W/Result/Json.php +++ b/Framework/W/Result/Json.php @@ -36,5 +36,5 @@ final protected function contentType():string {return 'application/json';} * @used-by \Df\Framework\W\Result\Text::i() * @param string|object|mixed[] $s */ - final protected function prepare($s):string {return !is_array($s) && !is_object($s) ? $s : df_json_encode($s);} + final protected function prepare($s):string {return df_is_stringable($s) ? df_string($s) : df_json_encode($s);} } \ No newline at end of file From 65eb0fc54e599e5f40e63dc42954420be30972a9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:30:50 +0100 Subject: [PATCH 207/717] refactoring --- Core/lib/lang/type/stringable.php | 1 + Webapi/lib/encode.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index 6168d1fea..ff8bbc84e 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -4,6 +4,7 @@ * @see df_is_complex() * @see df_string() * @used-by df_assert_stringable() + * @used-by dfw_encode() * @used-by \Df\Framework\W\Result\Json::prepare() * @used-by \Df\Qa\Dumper::dumpObject() */ diff --git a/Webapi/lib/encode.php b/Webapi/lib/encode.php index 216a4dc8e..6249fe995 100644 --- a/Webapi/lib/encode.php +++ b/Webapi/lib/encode.php @@ -47,6 +47,6 @@ * * @used-by \Df\Payment\PlaceOrderInternal::p() * @param mixed $v - * @return string|int|float|bool + * @return string|int|float|bool|Stringable */ -function dfw_encode($v) {return is_null($v) ? '' : (is_array($v) || is_object($v) ? df_json_encode($v) : $v);} \ No newline at end of file +function dfw_encode($v) {return is_null($v) ? '' : (df_is_stringable($v) ? $v : df_json_encode($v));} \ No newline at end of file From 5f9d847d7b8383f79c53f3828e59a537293ac3c4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:33:58 +0100 Subject: [PATCH 208/717] refactoring --- Qa/lib/validation/assert/stringable.php | 1 + Xml/G2.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Qa/lib/validation/assert/stringable.php b/Qa/lib/validation/assert/stringable.php index bec441847..2403beccd 100644 --- a/Qa/lib/validation/assert/stringable.php +++ b/Qa/lib/validation/assert/stringable.php @@ -3,6 +3,7 @@ /** * 2024-09-22 * @used-by df_string() + * @used-by \Df\Xml\G2::addAttributes() * @param string|string[]|array(string => mixed)|mixed|T|null ...$a * @return mixed * @throws DFE diff --git a/Xml/G2.php b/Xml/G2.php index cf28097b8..f76ec7f89 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -25,10 +25,10 @@ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_ */ function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ - df_assert( - !is_object($v) && !is_array($v) - , sprintf("The attribute «{$k}» has a value of a forbidden type %s.", df_type($v)) - , ['attributes' => $aa] + df_assert_stringable( + $v + ,sprintf("The attribute «{$k}» has a not-`Strinable` type %s.", df_type($v)) + ,['attributes' => $aa] ); $this->addAttribute(df_assert_sne($k), $v); } From 3b48bd1c96af641ce5ac86a9e4cb1598178bfcf5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:35:11 +0100 Subject: [PATCH 209/717] refactoring --- Qa/lib/log/main.php | 1 - Qa/lib/validation/error.php | 1 - Xml/G.php | 19 ++++++++----------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Qa/lib/log/main.php b/Qa/lib/log/main.php index b0c6db0c3..9da4fb677 100644 --- a/Qa/lib/log/main.php +++ b/Qa/lib/log/main.php @@ -21,7 +21,6 @@ * @used-by \Df\Qa\Failure\Error::check() * @used-by \Df\Qa\Trace\Formatter::p() * @used-by \Df\Widget\Plugin\Block\Adminhtml\Widget\Options::aroundAddFields() (https://github.com/mage2pro/core/issues/397) - * @used-by \Df\Xml\G::addAttributes() * @used-by \Dfe\CheckoutCom\Response::getCaptureCharge() * @used-by \Dfe\GoogleFont\Fonts\Png::url() * @used-by \Dfe\GoogleFont\Fonts\Sprite::datumPoints() diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index 8ad433866..e3fe06972 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -131,7 +131,6 @@ function df_abstract($caller):void { * @used-by \Df\Shipping\Method::s() * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() * @used-by \Df\StripeClone\Facade\Charge::cardData() - * @used-by \Df\Xml\G::addAttributes() * @used-by \Df\Xml\G::addChild() * @used-by \Df\Xml\G::importString() * @used-by \Dfe\AmazonLogin\Customer::validate() diff --git a/Xml/G.php b/Xml/G.php index 37c252ffe..035a51633 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -26,17 +26,14 @@ function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} #[\Override] /** @see \SimpleXMLElement::addAttribute() */ function addAttribute($k, $v = null, $ns = null):void {parent::addAttribute($this->k($k), $v, $ns);} - function addAttributes(array $atts):void { - foreach ($atts as $k => $v) {/** @var string $k */ /** @var mixed $v */ - df_assert_sne($k); - if (is_object($v) || is_array($v)) { - df_log($atts); - df_error( - "«{$k}» should be a string, but it is %s." - ,is_object($v) ? sprintf('an object of the class `%s`', get_class($v)) : 'an array' - ); - } - $this->addAttribute($k, $v); + function addAttributes(array $aa):void { + foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ + df_assert_stringable( + $v + ,sprintf("The attribute «{$k}» has a not-`Strinable` type %s.", df_type($v)) + ,['attributes' => $aa] + ); + $this->addAttribute(df_assert_sne($k), $v); } } From 486a440e4e90d5806b98870f08ee93401a73e92c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:36:08 +0100 Subject: [PATCH 210/717] refactoring --- Core/lib/lang/type/complex.php | 6 ------ Core/lib/lang/type/stringable.php | 1 - 2 files changed, 7 deletions(-) delete mode 100644 Core/lib/lang/type/complex.php diff --git a/Core/lib/lang/type/complex.php b/Core/lib/lang/type/complex.php deleted file mode 100644 index cbaf656fc..000000000 --- a/Core/lib/lang/type/complex.php +++ /dev/null @@ -1,6 +0,0 @@ - Date: Sun, 22 Sep 2024 23:36:42 +0100 Subject: [PATCH 211/717] refactoring --- Xml/G2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G2.php b/Xml/G2.php index f76ec7f89..1e8b7d3d0 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -27,7 +27,7 @@ function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_stringable( $v - ,sprintf("The attribute «{$k}» has a not-`Strinable` type %s.", df_type($v)) + ,sprintf("The attribute «{$k}» has a non-`Strinable` type %s.", df_type($v)) ,['attributes' => $aa] ); $this->addAttribute(df_assert_sne($k), $v); From 8748875d2f1b4484c21530c46cf5f4c3c4b45bb8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:39:06 +0100 Subject: [PATCH 212/717] refactoring --- Xml/G2.php | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index 1e8b7d3d0..38c58f9fd 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -1,6 +1,7 @@ getName() : $k; /** @var string $kAsString */ + $vIsString = is_string($v); /** @var bool $vIsString */ + $vAsString = ''; /** @var string $vAsString */ + try {$vAsString = $vIsString ? $v : df_string($v);} + catch (T $t) {df_error("Unable to convert the value of the key «{$kAsString}» to a string.\n%s", df_xts($t));} + if ($vIsString && $vAsString) { + /** + * Поддержка синтаксиса + * [ + * 'Представление' => + * df_cdata($this->getAddress()->format(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_TEXT)) + * ] + * Обратите внимание, что проверка на синтаксис[[]] должна предшествовать + * проверке на принадлежность ключа $kAsString в массиве $wrapInCData, + * потому что при соответствии синтаксису[[]] нам надо удалить из значения символы[[]]. + * Обратите внимание, что нам нужно выполнить проверку на синтаксис df_cdata ([[]]) + * даже при $needWrapInCData = true, потому что маркеры [[ и ]] из данных надо удалять. + */ + if (self::marker()->marked($vAsString)) { + $vAsString = self::marker()->unmark($vAsString); + $needWrapInCData = true; + } + $needWrapInCData = $needWrapInCData || in_array($kAsString, $wrapInCData) || df_needs_cdata($vAsString); + } + $needWrapInCData + ? ($kIsEmpty ? $this->cdata($vAsString) : $this->addChildText($kAsString, $vAsString)) + : ( + $kIsEmpty + ? $this->setValue($vAsString) + : $this->addChild( + $kAsString + /** + * Обратите внимание, что мы намеренно не добавляем htmlspecialchars: + * пусть вместо этого источник данных помечает те даннные, которые + * могут содержать неразрешённые в качестве содержимого тегов XML + * значения посредством @see df_cdata() + */ + ,$vAsString + ) + ) + ; + } + /** * 2021-12-16 * https://stackoverflow.com/a/9391673 From c4f8d8b835c5bd2e9aa034461a6ceeb5e742f8d0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:39:41 +0100 Subject: [PATCH 213/717] refactoring --- Xml/G2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xml/G2.php b/Xml/G2.php index 38c58f9fd..6e35998ef 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -46,7 +46,7 @@ private function importString(string $k, $v, $wrapInCData = []):void { # '' означает, что метод `importString` не должен создавать дочерний тэг `$k`, # а должен добавить текст в качестве единственного содержимого текущего тэга. $kIsEmpty = df_es($k); /** @var bool $kIsEmpty */ - $kAsString = $kIsEmpty ? $this->getName() : $k; /** @var string $kAsString */ + $kAsString = $kIsEmpty ? $this->_x->getName() : $k; /** @var string $kAsString */ $vIsString = is_string($v); /** @var bool $vIsString */ $vAsString = ''; /** @var string $vAsString */ try {$vAsString = $vIsString ? $v : df_string($v);} @@ -103,6 +103,7 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns * 2024-09-22 * @used-by self::__construct() * @used-by self::addAttribute() + * @used-by self::importString() * @var X */ private $_x; From d7edfeb7101909da5513626c3cb0b95533ed39a3 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:40:39 +0100 Subject: [PATCH 214/717] refactoring --- Core/lib/lang/type/conversion/string.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 2b11dd98b..3cd9593d2 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -18,6 +18,7 @@ * @used-by \Df\Framework\W\Result\Json::prepare() * @used-by \Df\Qa\Dumper::dumpObject() * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::importString() * @param mixed $v */ function df_string($v):string {return df_dump(strval(df_assert_stringable($v)));} \ No newline at end of file From 357a64664e541c34afc32009116789995d29c890 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:42:53 +0100 Subject: [PATCH 215/717] refactoring --- Xml/G2.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index 6e35998ef..0547c03a7 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -1,5 +1,6 @@ Date: Sun, 22 Sep 2024 23:43:16 +0100 Subject: [PATCH 216/717] refactoring --- Core/Text/Marker.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index 922606dc7..1947cb956 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -5,6 +5,7 @@ final class Marker { /** * 2021-12-12 * @used-by \Df\Xml\G::marker() + * @used-by \Df\Xml\G2::marker() */ function __construct(string $begin, string $end) {$this->_begin = $begin; $this->_end = $end;} From 8838d4cd724de1291aaa4acfbdeab46e58d11967 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:44:01 +0100 Subject: [PATCH 217/717] refactoring --- Core/Text/Marker.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index 1947cb956..c3751d36a 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -18,12 +18,14 @@ function mark(string $s):string {return $this->_begin . $s . $this->_end;} /** * 2021-12-12 * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::importString() */ function marked(string $s):string {return df_starts_with($s, $this->_begin) && df_ends_with($s, $this->_end);} /** * 2021-12-12 * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::importString() */ function unmark(string $s):string {return df_trim_text_left_right($s, $this->_begin, $this->_end);} From 7d08c379cba1d5d401283421b85eb81c8d59910b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:44:49 +0100 Subject: [PATCH 218/717] refactoring --- Xml/G2.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index 0547c03a7..465593d0c 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -36,6 +36,16 @@ function addAttributes(array $aa):void { } } + /** + * http://stackoverflow.com/a/6260295 + * @used-by self::addChildText() + * @used-by self::importString() + */ + private function cdata(string $s):void { + $e = dom_import_simplexml($this); /** @var \DOMElement $e */ + $e->appendChild($e->ownerDocument->createCDATASection($s)); + } + /** * @used-by self::importArray() * @param mixed $v From 51eba7b5a965de245cd6a95f5e09e80693f028b2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:49:42 +0100 Subject: [PATCH 219/717] refactoring --- Xml/G2.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index 465593d0c..826cf08b2 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -9,6 +9,7 @@ final class G2 { /** * 2024-09-22 + * @used-by self::addChild() * @param X|string $x */ function __construct($x) {$this->_x = df_xml_x($x);} @@ -36,6 +37,23 @@ function addAttributes(array $aa):void { } } + /** + * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, + * а объект класса родителя. + * 2022-11-15 + * 1) `static` as a return type is not supported by PHP < 8: https://github.com/mage2pro/core/issues/168#user-content-static + * 2) We can not declare the $name argument type with PHP < 8: https://3v4l.org/ptpUM + * @used-by self::addChildText() + * @used-by self::addChildX() + * @used-by self::importArray() + * @used-by self::importString() + */ + private function addChild(string $name, string $value = '', string $namespace = ''):self {/** @var self $r */ + try {$r = new self($this->_x->addChild($this->k($name), $value, $namespace));} + catch (T $t) {df_error("Tag <{$name}>. Value: «{$value}». Error: «%s».", df_xts($t));} + return $r; + } + /** * http://stackoverflow.com/a/6260295 * @used-by self::addChildText() From 1159c074e7727552e53e0c64c1b6256fa3bfed9b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:50:09 +0100 Subject: [PATCH 220/717] refactoring --- Xml/G2.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 826cf08b2..3025fcafe 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -48,9 +48,9 @@ function addAttributes(array $aa):void { * @used-by self::importArray() * @used-by self::importString() */ - private function addChild(string $name, string $value = '', string $namespace = ''):self {/** @var self $r */ - try {$r = new self($this->_x->addChild($this->k($name), $value, $namespace));} - catch (T $t) {df_error("Tag <{$name}>. Value: «{$value}». Error: «%s».", df_xts($t));} + private function addChild(string $k, string $v = '', string $ns = ''):self {/** @var self $r */ + try {$r = new self($this->_x->addChild($this->k($k), $v, $ns));} + catch (T $t) {df_error("Tag <{$k}>. Value: «{$v}». Error: «%s».", df_xts($t));} return $r; } From 4140a6701c9d3316ff30ffca7ce7859d3b8fc484 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:51:44 +0100 Subject: [PATCH 221/717] refactoring --- Xml/G2.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index 3025fcafe..c2d0a9521 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -1,5 +1,6 @@ _x->addChild($this->k($k), $v, $ns));} From 1ecff32003497e2f2cbacec579e09edd5f09b37c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:53:25 +0100 Subject: [PATCH 222/717] refactoring --- Xml/G.php | 2 +- Xml/G2.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 035a51633..3122a4f0d 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -305,7 +305,7 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns * @used-by self::importString() * @param mixed $v */ - private function setValue($v):self {$this[0] = $v; return $v;} + private function setValue($v):void {$this[0] = $v;} /** @used-by self::importArray() */ const ATTR = '_attr'; diff --git a/Xml/G2.php b/Xml/G2.php index c2d0a9521..b12da8d12 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -130,6 +130,13 @@ private function importString(string $k, $v, $wrapInCData = []):void { */ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns:$s";} + /** + * http://stackoverflow.com/a/3153704 + * @used-by self::importString() + * @param mixed $v + */ + private function setValue($v):void {$this->_x[0] = $v;} + /** * 2024-09-22 * @used-by self::__construct() From 4ea6589ee5fe1449bf025ed1862c202877a30a03 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:54:22 +0100 Subject: [PATCH 223/717] refactoring --- Xml/G2.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index b12da8d12..115769d6e 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -105,7 +105,7 @@ private function importString(string $k, $v, $wrapInCData = []):void { ? ($kIsEmpty ? $this->cdata($vAsString) : $this->addChildText($kAsString, $vAsString)) : ( $kIsEmpty - ? $this->setValue($vAsString) + ? $this->_x[0] = $vAsString # http://stackoverflow.com/a/3153704 : $this->addChild( $kAsString /** @@ -130,13 +130,6 @@ private function importString(string $k, $v, $wrapInCData = []):void { */ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns:$s";} - /** - * http://stackoverflow.com/a/3153704 - * @used-by self::importString() - * @param mixed $v - */ - private function setValue($v):void {$this->_x[0] = $v;} - /** * 2024-09-22 * @used-by self::__construct() From 7ac4a1db1d13ecc7bf655770b5b125a0aee5548f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:54:57 +0100 Subject: [PATCH 224/717] refactoring --- Xml/G.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 3122a4f0d..cb3c937c0 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -275,7 +275,7 @@ private function importString(string $k, $v, $wrapInCData = []):void { ? ($kIsEmpty ? $this->cdata($vAsString) : $this->addChildText($kAsString, $vAsString)) : ( $kIsEmpty - ? $this->setValue($vAsString) + ? $this[0] = $vAsString # http://stackoverflow.com/a/3153704 : $this->addChild( $kAsString /** @@ -300,13 +300,6 @@ private function importString(string $k, $v, $wrapInCData = []):void { */ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns:$s";} - /** - * http://stackoverflow.com/a/3153704 - * @used-by self::importString() - * @param mixed $v - */ - private function setValue($v):void {$this[0] = $v;} - /** @used-by self::importArray() */ const ATTR = '_attr'; From febf62c1dcc5621ff7f080a7924e9579adbec5b6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:56:08 +0100 Subject: [PATCH 225/717] refactoring --- Xml/G2.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Xml/G2.php b/Xml/G2.php index 115769d6e..6a26a1503 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -56,13 +56,23 @@ private function addChild(string $k, string $v = '', string $ns = ''):self {/** return $r; } + /** @used-by self::importString() */ + private function addChildText(string $tag, string $valueAsText):void { + $r = $this->addChild($tag); /** @var self $r */ + /** + * @uses CX::addChild() создаёт и возвращает не просто CX, как говорит документация, а объект класса родителя. + * Поэтому в нашем случае addChild создаст объект E. + */ + $r->cdata($valueAsText); + } + /** * http://stackoverflow.com/a/6260295 * @used-by self::addChildText() * @used-by self::importString() */ private function cdata(string $s):void { - $e = dom_import_simplexml($this); /** @var \DOMElement $e */ + $e = dom_import_simplexml($this->_x); /** @var \DOMElement $e */ $e->appendChild($e->ownerDocument->createCDATASection($s)); } From e68db0f8c601558cadd88a4b55837b3100b76a3c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:57:46 +0100 Subject: [PATCH 226/717] refactoring --- Xml/G2.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 6a26a1503..a1bbd7ebd 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -59,10 +59,6 @@ private function addChild(string $k, string $v = '', string $ns = ''):self {/** /** @used-by self::importString() */ private function addChildText(string $tag, string $valueAsText):void { $r = $this->addChild($tag); /** @var self $r */ - /** - * @uses CX::addChild() создаёт и возвращает не просто CX, как говорит документация, а объект класса родителя. - * Поэтому в нашем случае addChild создаст объект E. - */ $r->cdata($valueAsText); } From 58d3b0be6c7fe9f3fdb544ffcc1798d4af45756b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Sun, 22 Sep 2024 23:59:51 +0100 Subject: [PATCH 227/717] refactoring --- Xml/G.php | 2 +- Xml/G2.php | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index cb3c937c0..ef871f8e9 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -67,7 +67,7 @@ function addChild($name, $value = null, $namespace = null):self {/** @var self $ */ function importArray(array $array, $wrapInCData = []):void { foreach ($array as $key => $v) { /** @var string $key */ /** @var mixed $v */ - if ($v instanceof G) { + if ($v instanceof self) { /** * 2016-08-31 * Случай, который отсутствовал в Российской сборке Magento: diff --git a/Xml/G2.php b/Xml/G2.php index a1bbd7ebd..e942981d9 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -72,6 +72,148 @@ private function cdata(string $s):void { $e->appendChild($e->ownerDocument->createCDATASection($s)); } + /** + * @used-by df_xml_node() + * @used-by self::importArray() + * @param array(string => mixed) $array + * @param string[]|bool $wrapInCData [optional] + */ + function importArray(array $array, $wrapInCData = []):void { + foreach ($array as $key => $v) { /** @var string $key */ /** @var mixed $v */ + if ($v instanceof self) { + /** + * 2016-08-31 + * Случай, который отсутствовал в Российской сборке Magento: + * 'Payment' => [ + * df_xml_node('TxnList', ['count' => 1], [ + * df_xml_node('Txn', ['ID' => 1], [ + * 'amount' => 200 + * ,'purchaseOrderNo' => 'test' + * ,'txnID' => '009887' + * ,'txnSource' => 23 + * ,'txnType' => 4 + * ]) + * ]) + * ] + * + * + * + * 4 + * 23 + * 200 + * test + * 009887 + * + * + * + */ + $this->addChildX($v); + } + elseif (!is_array($v)) { + $this->importString($key, $v, $wrapInCData); + } + elseif (df_is_assoc($v) || array_filter($v, function($i) {return $i instanceof G;})) { + $childNode = + $this->addChild( + /** + * Раньше тут стояло df_string($key) + * Для ускорения модуля Яндекс.Маркет @see df_string() убрал. + * Вроде ничего не ломается. + */ + $key + ) + ; /** @var self $childNode */ + $childData = $v; /** @var array|null $childData */ + # Данный программный код позволяет импортировать атрибуты тэгов + /** @var array(string => string)|null $attributes $attributes */ + $attributes = dfa($v, self::ATTR); + if (!is_null($attributes)) { + $childNode->addAttributes(df_assert_array($attributes)); + # Если $v содержит атрибуты, + # то дочерние значения должны содержаться не непосредственно в $v, а в подмассиве с ключём self::CONTENT. + $childData = dfa($v, self::CONTENT); + } + if (!is_null($childData)) { + /** + * $childData запросто может не быть массивом. + * Например, в такой ситуации: + * ( + * [_attributes] => Array + * ( + * [Код] => 796 + * [НаименованиеПолное] => Штука + * [МеждународноеСокращение] => PCE + * ) + * [_value] => шт + * ) + * Здесь $childData — это «шт». + */ + if (is_array($childData)) { + $childNode->importArray($childData, $wrapInCData); + } + else { + # '' означает, что метод importString() не должен создавать дочерний тэг $key, + # а должен добавить текст в качестве единственного содержимого текущего тэга. + $childNode->importString('', $childData, $wrapInCData); + } + } + } + else { + # Данный код позволяет импортировать структуры с повторяющимися тегами. + # Например, нам надо сформировать такой документ: + # <АдресРегистрации> + # <АдресноеПоле> + # <Тип>Почтовый индекс + # <Значение>127238 + # + # <АдресноеПоле> + # <Тип>Улица + # <Значение>Красная Площадь + # + # + # + # Для этого мы вызываем: + # + # $this->getDocument() + # ->importArray( + # array( + # 'АдресРегистрации' => + # array( + # 'АдресноеПоле' => + # array( + # array( + # 'Тип' => 'Почтовый индекс' + # ,'Значение' => '127238' + # ) + # ,array( + # 'Тип' => 'Улица' + # ,'Значение' => 'Красная Площадь' + # ) + # ) + # ) + # ) + # ) + # ; + foreach ($v as $vItem) { + /** @var array(string => mixed)|string $vItem */ + /** + * 2015-01-20 + * Обратите внимание, что $vItem может быть не только массивом, но и строкой. + * Например, такая структура: + * <Группы> + * <Ид>1 + * <Ид>1 + * <Ид>1 + * + * кодируется так: + * array('Группы' => array('Ид' => array(1, 2, 3))) + */ + $this->importArray([$key => $vItem], $wrapInCData); + } + } + } + } + /** * @used-by self::importArray() * @param mixed $v From 8ca4037f37fec0d85bf8bddc608b943151baf297 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:00:52 +0100 Subject: [PATCH 228/717] refactoring --- Xml/G2.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index e942981d9..e35ca5786 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -287,6 +287,12 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns */ private $_x; + /** @used-by self::importArray() */ + const ATTR = '_attr'; + + /** @used-by self::importArray() */ + const CONTENT = '_content'; + /** * 2021-12-12 * @used-by self::importString() From 113126622895dee7e17609f37927b33eee07b3bf Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:01:13 +0100 Subject: [PATCH 229/717] refactoring --- Xml/G2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G2.php b/Xml/G2.php index e35ca5786..59e4b5ea6 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -112,7 +112,7 @@ function importArray(array $array, $wrapInCData = []):void { elseif (!is_array($v)) { $this->importString($key, $v, $wrapInCData); } - elseif (df_is_assoc($v) || array_filter($v, function($i) {return $i instanceof G;})) { + elseif (df_is_assoc($v) || array_filter($v, function($i) {return $i instanceof self;})) { $childNode = $this->addChild( /** From 870abbfb95adbfb48ad0e7be2b07ba6e44451fcb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:02:00 +0100 Subject: [PATCH 230/717] refactoring --- Xml/G2.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index 59e4b5ea6..90b08b98c 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -62,6 +62,21 @@ private function addChildText(string $tag, string $valueAsText):void { $r->cdata($valueAsText); } + /** + * 2016-08-31 http://stackoverflow.com/a/11727581 + * @used-by self::addChildX() + * @used-by self::importArray() + */ + private function addChildX(G $child):void { + $childInThis = $this->addChild($child->getName(), (string)$child); /** @var G $childInThis */ + foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ + $childInThis->addAttribute($attr, $v); + } + foreach ($child->children() as $childChild) { /** @var G $childChild */ + $childInThis->addChildX($childChild); + } + } + /** * http://stackoverflow.com/a/6260295 * @used-by self::addChildText() From 4c75fb599b2f3373bcb87544de90d86da76f5499 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:02:14 +0100 Subject: [PATCH 231/717] refactoring --- Xml/G.php | 2 +- Xml/G2.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index ef871f8e9..362e1648e 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -217,7 +217,7 @@ private function addChildText(string $tag, string $valueAsText):void { * @used-by self::importArray() */ private function addChildX(G $child):void { - $childInThis = $this->addChild($child->getName(), (string)$child); /** @var G $childInThis */ + $childInThis = $this->addChild($child->getName(), (string)$child); /** @var self $childInThis */ foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ $childInThis->addAttribute($attr, $v); } diff --git a/Xml/G2.php b/Xml/G2.php index 90b08b98c..b2a0ff7f4 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -68,7 +68,7 @@ private function addChildText(string $tag, string $valueAsText):void { * @used-by self::importArray() */ private function addChildX(G $child):void { - $childInThis = $this->addChild($child->getName(), (string)$child); /** @var G $childInThis */ + $childInThis = $this->addChild($child->getName(), (string)$child); /** @var self $childInThis */ foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ $childInThis->addAttribute($attr, $v); } From 4756d98a5908440e7cf32336b0acc6de55c73ebb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:03:29 +0100 Subject: [PATCH 232/717] refactoring --- Xml/G.php | 10 ------ Xml/G2.php | 98 +++++++++++++++++++++++++++--------------------------- 2 files changed, 49 insertions(+), 59 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 362e1648e..42d779423 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -7,9 +7,6 @@ # 2024-09-22 "Refactor `Df\Xml\X`": https://github.com/mage2pro/core/issues/436 /** @used-by df_xml_x() */ final class G extends MX { - /** */ - function __destruct() {unset(self::$_canonicalArray[spl_object_hash($this)]);} - /** * 2021-12-13 * https://php.net/manual/en/simplexmlelement.addattribute.php @@ -318,11 +315,4 @@ static function markAsCData(string $s):string {return self::marker()->mark($s);} * @used-by self::markAsCData() */ private static function marker():Marker {static $r; return $r ?: $r = new Marker('[[', ']]');} - - /** - * @used-by self::__destruct() - * @used-by self::asCanonicalArray() - * @var array(string => array(string => mixed)) - */ - private static $_canonicalArray = []; } \ No newline at end of file diff --git a/Xml/G2.php b/Xml/G2.php index b2a0ff7f4..6e26c2819 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -38,55 +38,6 @@ function addAttributes(array $aa):void { } } - /** - * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, - * а объект класса родителя. - * 2022-11-15 - * 1) `static` as a return type is not supported by PHP < 8: https://github.com/mage2pro/core/issues/168#user-content-static - * 2) We can not declare the $name argument type with PHP < 8: https://3v4l.org/ptpUM - * @used-by self::addChildText() - * @used-by self::addChildX() - * @used-by self::importArray() - * @used-by self::importString() - * @throws E - */ - private function addChild(string $k, string $v = '', string $ns = ''):self {/** @var self $r */ - try {$r = new self($this->_x->addChild($this->k($k), $v, $ns));} - catch (T $t) {df_error("Tag <{$k}>. Value: «{$v}». Error: «%s».", df_xts($t));} - return $r; - } - - /** @used-by self::importString() */ - private function addChildText(string $tag, string $valueAsText):void { - $r = $this->addChild($tag); /** @var self $r */ - $r->cdata($valueAsText); - } - - /** - * 2016-08-31 http://stackoverflow.com/a/11727581 - * @used-by self::addChildX() - * @used-by self::importArray() - */ - private function addChildX(G $child):void { - $childInThis = $this->addChild($child->getName(), (string)$child); /** @var self $childInThis */ - foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ - $childInThis->addAttribute($attr, $v); - } - foreach ($child->children() as $childChild) { /** @var G $childChild */ - $childInThis->addChildX($childChild); - } - } - - /** - * http://stackoverflow.com/a/6260295 - * @used-by self::addChildText() - * @used-by self::importString() - */ - private function cdata(string $s):void { - $e = dom_import_simplexml($this->_x); /** @var \DOMElement $e */ - $e->appendChild($e->ownerDocument->createCDATASection($s)); - } - /** * @used-by df_xml_node() * @used-by self::importArray() @@ -229,6 +180,55 @@ function importArray(array $array, $wrapInCData = []):void { } } + /** + * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, + * а объект класса родителя. + * 2022-11-15 + * 1) `static` as a return type is not supported by PHP < 8: https://github.com/mage2pro/core/issues/168#user-content-static + * 2) We can not declare the $name argument type with PHP < 8: https://3v4l.org/ptpUM + * @used-by self::addChildText() + * @used-by self::addChildX() + * @used-by self::importArray() + * @used-by self::importString() + * @throws E + */ + private function addChild(string $k, string $v = '', string $ns = ''):self {/** @var self $r */ + try {$r = new self($this->_x->addChild($this->k($k), $v, $ns));} + catch (T $t) {df_error("Tag <{$k}>. Value: «{$v}». Error: «%s».", df_xts($t));} + return $r; + } + + /** @used-by self::importString() */ + private function addChildText(string $tag, string $valueAsText):void { + $r = $this->addChild($tag); /** @var self $r */ + $r->cdata($valueAsText); + } + + /** + * 2016-08-31 http://stackoverflow.com/a/11727581 + * @used-by self::addChildX() + * @used-by self::importArray() + */ + private function addChildX(G $child):void { + $childInThis = $this->addChild($child->getName(), (string)$child); /** @var self $childInThis */ + foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ + $childInThis->addAttribute($attr, $v); + } + foreach ($child->children() as $childChild) { /** @var G $childChild */ + $childInThis->addChildX($childChild); + } + } + + /** + * http://stackoverflow.com/a/6260295 + * @used-by self::addChildText() + * @used-by self::importString() + */ + private function cdata(string $s):void { + $e = dom_import_simplexml($this->_x); /** @var \DOMElement $e */ + $e->appendChild($e->ownerDocument->createCDATASection($s)); + } + /** * @used-by self::importArray() * @param mixed $v From 80412cd35d78155fd9ed93c9fe61526f14685256 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:05:41 +0100 Subject: [PATCH 233/717] refactoring --- Xml/G2.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xml/G2.php b/Xml/G2.php index 6e26c2819..5a01d18f5 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -297,6 +297,8 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns * 2024-09-22 * @used-by self::__construct() * @used-by self::addAttribute() + * @used-by self::addChild() + * @used-by self::cdata() * @used-by self::importString() * @var X */ From 0f2e0427c49abb9b7f62968aca272d6f457728cd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:06:25 +0100 Subject: [PATCH 234/717] refactoring --- Xml/G2.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 5a01d18f5..da914a2bc 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -30,9 +30,7 @@ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_ function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ df_assert_stringable( - $v - ,sprintf("The attribute «{$k}» has a non-`Strinable` type %s.", df_type($v)) - ,['attributes' => $aa] + $v, sprintf("The attribute «{$k}» has a non-`Strinable` type %s.", df_type($v)), ['attributes' => $aa] ); $this->addAttribute(df_assert_sne($k), $v); } From 72a476b9a896821ae4bbca036bc14963891407dd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:06:59 +0100 Subject: [PATCH 235/717] refactoring --- Xml/G2.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index da914a2bc..7ef55c026 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -29,10 +29,9 @@ function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_ */ function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ - df_assert_stringable( + $this->addAttribute(df_assert_sne($k), df_assert_stringable( $v, sprintf("The attribute «{$k}» has a non-`Strinable` type %s.", df_type($v)), ['attributes' => $aa] - ); - $this->addAttribute(df_assert_sne($k), $v); + )); } } From c51906fcbee5b293ee818ad28878d174b7c180d7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:09:01 +0100 Subject: [PATCH 236/717] refactoring --- Xml/G2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 7ef55c026..52fb441a6 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -206,12 +206,12 @@ private function addChildText(string $tag, string $valueAsText):void { * @used-by self::addChildX() * @used-by self::importArray() */ - private function addChildX(G $child):void { - $childInThis = $this->addChild($child->getName(), (string)$child); /** @var self $childInThis */ - foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ + private function addChildX(X $x):void { + $childInThis = $this->addChild($x->getName(), (string)$x); /** @var self $childInThis */ + foreach ($x->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ $childInThis->addAttribute($attr, $v); } - foreach ($child->children() as $childChild) { /** @var G $childChild */ + foreach ($x->children() as $childChild) { /** @var G $childChild */ $childInThis->addChildX($childChild); } } From f9d058c13948fb52c5032112c59166dba2a786d7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:10:20 +0100 Subject: [PATCH 237/717] refactoring --- Xml/G2.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index 52fb441a6..deab6ec43 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -207,12 +207,12 @@ private function addChildText(string $tag, string $valueAsText):void { * @used-by self::importArray() */ private function addChildX(X $x):void { - $childInThis = $this->addChild($x->getName(), (string)$x); /** @var self $childInThis */ + $g = $this->addChild($x->getName(), (string)$x); /** @var self $g */ foreach ($x->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ - $childInThis->addAttribute($attr, $v); + $g->addAttribute($attr, $v); } foreach ($x->children() as $childChild) { /** @var G $childChild */ - $childInThis->addChildX($childChild); + $g->addChildX($childChild); } } From 220dcc3398f3722ce468b02e3e3b936f1fb43967 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:12:14 +0100 Subject: [PATCH 238/717] refactoring --- Xml/G2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index deab6ec43..f682b6259 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -208,11 +208,11 @@ private function addChildText(string $tag, string $valueAsText):void { */ private function addChildX(X $x):void { $g = $this->addChild($x->getName(), (string)$x); /** @var self $g */ - foreach ($x->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ - $g->addAttribute($attr, $v); + foreach ($x->attributes() as $k => $v) { /** @var string $k */ /** @var string $v */ + $g->addAttribute($k, $v); } - foreach ($x->children() as $childChild) { /** @var G $childChild */ - $g->addChildX($childChild); + foreach ($x->children() as $xc) { /** @var X $xc */ + $g->addChildX($xc); } } From bd481301d6249e88a9378dc669cc94be19bc37c9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:12:59 +0100 Subject: [PATCH 239/717] refactoring --- Xml/G2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index f682b6259..ea5bbc217 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -196,9 +196,9 @@ private function addChild(string $k, string $v = '', string $ns = ''):self {/** } /** @used-by self::importString() */ - private function addChildText(string $tag, string $valueAsText):void { + private function addChildText(string $tag, string $vs):void { $r = $this->addChild($tag); /** @var self $r */ - $r->cdata($valueAsText); + $r->cdata($vs); } /** From c1c1f0f7f887f8da69844a418265a5a2b8691ea1 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:13:08 +0100 Subject: [PATCH 240/717] refactoring --- Xml/G2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/G2.php b/Xml/G2.php index ea5bbc217..81375faf8 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -196,9 +196,9 @@ private function addChild(string $k, string $v = '', string $ns = ''):self {/** } /** @used-by self::importString() */ - private function addChildText(string $tag, string $vs):void { + private function addChildText(string $tag, string $s):void { $r = $this->addChild($tag); /** @var self $r */ - $r->cdata($vs); + $r->cdata($s); } /** From a52a00df1a65883d299213985379219977117ef9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:17:40 +0100 Subject: [PATCH 241/717] refactoring --- Core/lib/lang/try.php | 1 + Qa/lib/exception.php | 1 + Xml/G2.php | 9 ++++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Core/lib/lang/try.php b/Core/lib/lang/try.php index 2cdd3de59..b8d3abeef 100644 --- a/Core/lib/lang/try.php +++ b/Core/lib/lang/try.php @@ -31,6 +31,7 @@ * @used-by \Df\Qa\Trace\Formatter::p() * @used-by \Df\Qa\Trace\Frame::methodR() * @used-by \Df\Theme\Controller\Result\MessagePlugin::getCookiesMessages() + * @used-by \Df\Xml\G2::addChild() * @used-by \Dfe\CheckoutCom\Method::leh() * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() * @used-by \Dfe\GoogleFont\Fonts\Png::url() diff --git a/Qa/lib/exception.php b/Qa/lib/exception.php index d9181dc84..456c93c0e 100644 --- a/Qa/lib/exception.php +++ b/Qa/lib/exception.php @@ -93,6 +93,7 @@ function df_xf(T $t):T {while ($t->getPrevious()) {$t = $t->getPrevious();} retu * @used-by \Df\Payment\W\Handler::handle() * @used-by \Df\Qa\Trace\Formatter::p() * @used-by \Df\Xml\G::addChild() + * @used-by \Df\Xml\G2::addChild() * @used-by \Df\Xml\G::importString() * @used-by \Dfe\CheckoutCom\Handler::p() * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() diff --git a/Xml/G2.php b/Xml/G2.php index 81375faf8..b2105fe04 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -189,11 +189,10 @@ function importArray(array $array, $wrapInCData = []):void { * @used-by self::importString() * @throws E */ - private function addChild(string $k, string $v = '', string $ns = ''):self {/** @var self $r */ - try {$r = new self($this->_x->addChild($this->k($k), $v, $ns));} - catch (T $t) {df_error("Tag <{$k}>. Value: «{$v}». Error: «%s».", df_xts($t));} - return $r; - } + private function addChild(string $k, string $v = '', string $ns = ''):self {return df_try( + function() use($k, $v, $ns):self {return new self($this->_x->addChild($this->k($k), $v, $ns));} + ,function(T $t) use($k, $v):void {df_error("Tag <{$k}>. Value: «{$v}». Error: «%s».", df_xts($t));} + );} /** @used-by self::importString() */ private function addChildText(string $tag, string $s):void { From 131de764c90bfb9ded49ac0afbac66ec34f5b015 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:19:45 +0100 Subject: [PATCH 242/717] refactoring --- Xml/G.php | 318 ------------------------------------------------------ 1 file changed, 318 deletions(-) delete mode 100644 Xml/G.php diff --git a/Xml/G.php b/Xml/G.php deleted file mode 100644 index 42d779423..000000000 --- a/Xml/G.php +++ /dev/null @@ -1,318 +0,0 @@ -k($k), $v, $ns);} - - function addAttributes(array $aa):void { - foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ - df_assert_stringable( - $v - ,sprintf("The attribute «{$k}» has a not-`Strinable` type %s.", df_type($v)) - ,['attributes' => $aa] - ); - $this->addAttribute(df_assert_sne($k), $v); - } - } - - /** - * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, - * а объект класса родителя. - * 2022-11-15 - * 1) `static` as a return type is not supported by PHP < 8: https://github.com/mage2pro/core/issues/168#user-content-static - * 2) We can not declare the $name argument type with PHP < 8: https://3v4l.org/ptpUM - * @used-by self::addChildText() - * @used-by self::addChildX() - * @used-by self::importArray() - * @used-by self::importString() - * @param string $name - * @param string|null $value [optional] - * @param string|null $namespace [optional] - */ - #[\Override] /** @see \SimpleXMLElement::addChild() */ - #[\ReturnTypeWillChange] - function addChild($name, $value = null, $namespace = null):self {/** @var self $r */ - try {$r = parent::addChild($this->k($name), $value, $namespace);} - catch (Th $th) {df_error("Tag <{$name}>. Value: «{$value}». Error: «%s».", df_xts($th));} - return $r; - } - - /** - * @used-by df_xml_node() - * @used-by self::importArray() - * @param array(string => mixed) $array - * @param string[]|bool $wrapInCData [optional] - */ - function importArray(array $array, $wrapInCData = []):void { - foreach ($array as $key => $v) { /** @var string $key */ /** @var mixed $v */ - if ($v instanceof self) { - /** - * 2016-08-31 - * Случай, который отсутствовал в Российской сборке Magento: - * 'Payment' => [ - * df_xml_node('TxnList', ['count' => 1], [ - * df_xml_node('Txn', ['ID' => 1], [ - * 'amount' => 200 - * ,'purchaseOrderNo' => 'test' - * ,'txnID' => '009887' - * ,'txnSource' => 23 - * ,'txnType' => 4 - * ]) - * ]) - * ] - * - * - * - * 4 - * 23 - * 200 - * test - * 009887 - * - * - * - */ - $this->addChildX($v); - } - elseif (!is_array($v)) { - $this->importString($key, $v, $wrapInCData); - } - elseif (df_is_assoc($v) || array_filter($v, function($i) {return $i instanceof G;})) { - $childNode = - $this->addChild( - /** - * Раньше тут стояло df_string($key) - * Для ускорения модуля Яндекс.Маркет @see df_string() убрал. - * Вроде ничего не ломается. - */ - $key - ) - ; /** @var self $childNode */ - $childData = $v; /** @var array|null $childData */ - # Данный программный код позволяет импортировать атрибуты тэгов - /** @var array(string => string)|null $attributes $attributes */ - $attributes = dfa($v, self::ATTR); - if (!is_null($attributes)) { - $childNode->addAttributes(df_assert_array($attributes)); - # Если $v содержит атрибуты, - # то дочерние значения должны содержаться не непосредственно в $v, а в подмассиве с ключём self::CONTENT. - $childData = dfa($v, self::CONTENT); - } - if (!is_null($childData)) { - /** - * $childData запросто может не быть массивом. - * Например, в такой ситуации: - * ( - * [_attributes] => Array - * ( - * [Код] => 796 - * [НаименованиеПолное] => Штука - * [МеждународноеСокращение] => PCE - * ) - * [_value] => шт - * ) - * Здесь $childData — это «шт». - */ - if (is_array($childData)) { - $childNode->importArray($childData, $wrapInCData); - } - else { - # '' означает, что метод importString() не должен создавать дочерний тэг $key, - # а должен добавить текст в качестве единственного содержимого текущего тэга. - $childNode->importString('', $childData, $wrapInCData); - } - } - } - else { - # Данный код позволяет импортировать структуры с повторяющимися тегами. - # Например, нам надо сформировать такой документ: - # <АдресРегистрации> - # <АдресноеПоле> - # <Тип>Почтовый индекс - # <Значение>127238 - # - # <АдресноеПоле> - # <Тип>Улица - # <Значение>Красная Площадь - # - # - # - # Для этого мы вызываем: - # - # $this->getDocument() - # ->importArray( - # array( - # 'АдресРегистрации' => - # array( - # 'АдресноеПоле' => - # array( - # array( - # 'Тип' => 'Почтовый индекс' - # ,'Значение' => '127238' - # ) - # ,array( - # 'Тип' => 'Улица' - # ,'Значение' => 'Красная Площадь' - # ) - # ) - # ) - # ) - # ) - # ; - foreach ($v as $vItem) { - /** @var array(string => mixed)|string $vItem */ - /** - * 2015-01-20 - * Обратите внимание, что $vItem может быть не только массивом, но и строкой. - * Например, такая структура: - * <Группы> - * <Ид>1 - * <Ид>1 - * <Ид>1 - * - * кодируется так: - * array('Группы' => array('Ид' => array(1, 2, 3))) - */ - $this->importArray([$key => $vItem], $wrapInCData); - } - } - } - } - - /** @used-by self::importString() */ - private function addChildText(string $tag, string $valueAsText):void { - $r = $this->addChild($tag); /** @var self $r */ - /** - * @uses CX::addChild() создаёт и возвращает не просто CX, как говорит документация, а объект класса родителя. - * Поэтому в нашем случае addChild создаст объект E. - */ - $r->cdata($valueAsText); - } - - /** - * 2016-08-31 http://stackoverflow.com/a/11727581 - * @used-by self::addChildX() - * @used-by self::importArray() - */ - private function addChildX(G $child):void { - $childInThis = $this->addChild($child->getName(), (string)$child); /** @var self $childInThis */ - foreach ($child->attributes() as $attr => $v) { /** @var string $name */ /** @var string $v */ - $childInThis->addAttribute($attr, $v); - } - foreach ($child->children() as $childChild) { /** @var G $childChild */ - $childInThis->addChildX($childChild); - } - } - - /** - * http://stackoverflow.com/a/6260295 - * @used-by self::addChildText() - * @used-by self::importString() - */ - private function cdata(string $s):void { - $e = dom_import_simplexml($this); /** @var \DOMElement $e */ - $e->appendChild($e->ownerDocument->createCDATASection($s)); - } - - /** - * @used-by self::importArray() - * @param mixed $v - * @param string[]|bool $wrapInCData [optional] - */ - private function importString(string $k, $v, $wrapInCData = []):void { - $needWrapInCData = !is_array($wrapInCData) && !!$wrapInCData; /** @var bool $needWrapInCData */ - $wrapInCData = df_eta($wrapInCData); - # '' означает, что метод `importString` не должен создавать дочерний тэг `$k`, - # а должен добавить текст в качестве единственного содержимого текущего тэга. - $kIsEmpty = df_es($k); /** @var bool $kIsEmpty */ - $kAsString = $kIsEmpty ? $this->getName() : $k; /** @var string $kAsString */ - $vIsString = is_string($v); /** @var bool $vIsString */ - $vAsString = ''; /** @var string $vAsString */ - try {$vAsString = $vIsString ? $v : df_string($v);} - catch (Th $th) {df_error("Unable to convert the value of the key «{$kAsString}» to a string.\n%s", df_xts($th));} - if ($vIsString && $vAsString) { - /** - * Поддержка синтаксиса - * [ - * 'Представление' => - * df_cdata($this->getAddress()->format(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_TEXT)) - * ] - * Обратите внимание, что проверка на синтаксис[[]] должна предшествовать - * проверке на принадлежность ключа $kAsString в массиве $wrapInCData, - * потому что при соответствии синтаксису[[]] нам надо удалить из значения символы[[]]. - * Обратите внимание, что нам нужно выполнить проверку на синтаксис df_cdata ([[]]) - * даже при $needWrapInCData = true, потому что маркеры [[ и ]] из данных надо удалять. - */ - if (self::marker()->marked($vAsString)) { - $vAsString = self::marker()->unmark($vAsString); - $needWrapInCData = true; - } - $needWrapInCData = $needWrapInCData || in_array($kAsString, $wrapInCData) || df_needs_cdata($vAsString); - } - $needWrapInCData - ? ($kIsEmpty ? $this->cdata($vAsString) : $this->addChildText($kAsString, $vAsString)) - : ( - $kIsEmpty - ? $this[0] = $vAsString # http://stackoverflow.com/a/3153704 - : $this->addChild( - $kAsString - /** - * Обратите внимание, что мы намеренно не добавляем htmlspecialchars: - * пусть вместо этого источник данных помечает те даннные, которые - * могут содержать неразрешённые в качестве содержимого тегов XML - * значения посредством @see df_cdata() - */ - ,$vAsString - ) - ) - ; - } - - /** - * 2021-12-16 - * https://stackoverflow.com/a/9391673 - * https://stackoverflow.com/a/43566078 - * https://stackoverflow.com/a/6928183 - * @used-by self::addAttribute() - * @used-by self::addChild() - */ - private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns:$s";} - - /** @used-by self::importArray() */ - const ATTR = '_attr'; - - /** @used-by self::importArray() */ - const CONTENT = '_content'; - - /** - * Убрал df_param_s и df_result_s для ускорения работы модуля Яндекс.Маркет - * @used-by df_cdata() - */ - static function markAsCData(string $s):string {return self::marker()->mark($s);} - - /** - * 2021-12-12 - * @used-by self::importString() - * @used-by self::markAsCData() - */ - private static function marker():Marker {static $r; return $r ?: $r = new Marker('[[', ']]');} -} \ No newline at end of file From 93fae86692c996ffd11657af5aa4d8fbd7687d02 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:20:33 +0100 Subject: [PATCH 243/717] refactoring --- Qa/lib/validation/assert/other.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qa/lib/validation/assert/other.php b/Qa/lib/validation/assert/other.php index 30990e078..7158bc5eb 100644 --- a/Qa/lib/validation/assert/other.php +++ b/Qa/lib/validation/assert/other.php @@ -29,7 +29,7 @@ function df_assert_nef($v, $m = null) {return false !== $v ? $v : df_error($m ?: * @used-by \Df\Payment\W\Event::pid() * @used-by \Df\PaypalClone\Charge::p() * @used-by \Df\StripeClone\Payer::newCard() - * @used-by \Df\Xml\G::addAttributes() + * @used-by \Df\Xml\G2::addAttributes() * @used-by \Dfe\Stripe\Controller\CustomerReturn\Index::isSuccess() * @used-by \Dfe\Stripe\Init\Action::redirectUrl() * @throws DFE From a1304b893f7176b574bf3e4b7e81f60e02219396 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:21:26 +0100 Subject: [PATCH 244/717] refactoring --- Core/lib/array/select/.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/lib/array/select/.php b/Core/lib/array/select/.php index 9b0aaab69..d6dcfdcf7 100644 --- a/Core/lib/array/select/.php +++ b/Core/lib/array/select/.php @@ -68,6 +68,7 @@ * @used-by \Df\Sentry\Client::capture() * @used-by \Df\Sentry\Client::get_http_data() * @used-by \Df\Sso\CustomerReturn::mc() + * @used-by \Df\Xml\G2::importArray() * @used-by \Dfe\AlphaCommerceHub\W\Event::providerRespL() * @used-by \Dfe\AmazonLogin\Customer::res() * @used-by \Dfe\CheckoutCom\Source\Prefill::config() From 8949d034ca70c4ade664f2d7bdbe497bf0160f3a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:21:42 +0100 Subject: [PATCH 245/717] refactoring --- Core/lib/array/is.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/is.php b/Core/lib/array/is.php index 4500d3ae0..5d666d2ef 100644 --- a/Core/lib/array/is.php +++ b/Core/lib/array/is.php @@ -54,7 +54,7 @@ function array_is_list(array $a):bool { * @used-by df_filter_f() * @used-by df_ksort() * @used-by \Df\Core\Exception::__construct() - * @used-by \Df\Xml\G::importArray() + * @used-by \Df\Xml\G2::importArray() * @param array(int|string => mixed)|mixed $a */ function df_is_assoc($a):bool {return is_array($a) && (!$a || !array_is_list($a));} From bd3843d5dea1ed0bd18e9f176593193da3763db8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:22:53 +0100 Subject: [PATCH 246/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/validation/error.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index e3fe06972..9b725917b 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -131,8 +131,8 @@ function df_abstract($caller):void { * @used-by \Df\Shipping\Method::s() * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() * @used-by \Df\StripeClone\Facade\Charge::cardData() - * @used-by \Df\Xml\G::addChild() - * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::addChild() + * @used-by \Df\Xml\G2::importString() * @used-by \Dfe\AmazonLogin\Customer::validate() * @used-by \Dfe\BlackbaudNetCommunity\Customer::p() * @used-by \Dfe\SecurePay\Refund::process() From 596e8b9ee70c63eeff99ea49bbb06edf1dd3d65c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:23:09 +0100 Subject: [PATCH 247/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/exception.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Qa/lib/exception.php b/Qa/lib/exception.php index 456c93c0e..4c26c3601 100644 --- a/Qa/lib/exception.php +++ b/Qa/lib/exception.php @@ -92,7 +92,6 @@ function df_xf(T $t):T {while ($t->getPrevious()) {$t = $t->getPrevious();} retu * @used-by \Df\Payment\PlaceOrderInternal::message() * @used-by \Df\Payment\W\Handler::handle() * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Df\Xml\G::addChild() * @used-by \Df\Xml\G2::addChild() * @used-by \Df\Xml\G::importString() * @used-by \Dfe\CheckoutCom\Handler::p() From 45cdced29a65bfbe80ffadb8aea1970eed3fb0ea Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:23:16 +0100 Subject: [PATCH 248/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/exception.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qa/lib/exception.php b/Qa/lib/exception.php index 4c26c3601..7bc68a130 100644 --- a/Qa/lib/exception.php +++ b/Qa/lib/exception.php @@ -93,7 +93,7 @@ function df_xf(T $t):T {while ($t->getPrevious()) {$t = $t->getPrevious();} retu * @used-by \Df\Payment\W\Handler::handle() * @used-by \Df\Qa\Trace\Formatter::p() * @used-by \Df\Xml\G2::addChild() - * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::importString() * @used-by \Dfe\CheckoutCom\Handler::p() * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() * @used-by \Dfe\Klarna\Exception::messageC() From d7401b6cff010e88b777ecf776dd0213e625bd14 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:23:34 +0100 Subject: [PATCH 249/717] https://github.com/mage2pro/core/issues/436 --- Core/lib/empty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/empty.php b/Core/lib/empty.php index 5ae7e945c..aa7e71264 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -52,7 +52,7 @@ function df_est($v):bool {return df_es(df_trim($v));} * @used-by \Df\Config\Backend\Serialized::valueUnserialize() * @used-by \Df\Config\Settings::json() * @used-by \Df\Directory\FE\Country::getValues() - * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::importString() * @used-by \Dfe\AllPay\Total\Quote::iiAdd() * @used-by \Dfe\AllPay\Total\Quote::iiGet() * @used-by \Dfe\CheckoutCom\Method::disableEvent() From 4cff4d2af0b6178e7ac4a859294e587cee8b9612 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:24:02 +0100 Subject: [PATCH 250/717] https://github.com/mage2pro/core/issues/436 --- Core/lib/empty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/empty.php b/Core/lib/empty.php index aa7e71264..a4159b9f4 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -20,7 +20,7 @@ * @used-by \Df\Payment\W\Exception\Ignored::message() * @used-by \Df\Payment\W\Handler::log() * @used-by \Df\Typography\Css::rule() - * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::importString() * @param mixed $v */ function df_es($v):bool {return '' === $v;} From 76896e7ff8fac8c9516fa5e799dda6e0c8ea3c36 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:24:16 +0100 Subject: [PATCH 251/717] https://github.com/mage2pro/core/issues/436 --- Core/lib/lang/type/conversion/string.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 3cd9593d2..84b8760cf 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -17,7 +17,6 @@ * @used-by df_type() * @used-by \Df\Framework\W\Result\Json::prepare() * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Xml\G::importString() * @used-by \Df\Xml\G2::importString() * @param mixed $v */ From c12ddde766c512a3e842ff95299a6a3a37bf6a4f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:24:45 +0100 Subject: [PATCH 252/717] https://github.com/mage2pro/core/issues/436 --- Xml/lib/cdata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 7cec0c87f..9dbd717f2 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -18,7 +18,7 @@ function df_cdata_raw_if_needed(string $s):string {return !df_needs_cdata($s) ? * 2021-12-12 https://3v4l.org/3SDsT * @see df_cdata() * @used-by df_cdata_raw_if_needed() - * @used-by \Df\Xml\G::importString() + * @used-by \Df\Xml\G2::importString() */ function df_needs_cdata(string $s):bool { $s1 = htmlspecialchars_decode($s, ENT_XML1 | ENT_QUOTES); /** @var string $s1 */ From e6c0ca2b6d650a435897d148a54b33a276d1047f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:24:59 +0100 Subject: [PATCH 253/717] https://github.com/mage2pro/core/issues/436 --- Core/lib/text/contains/.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/lib/text/contains/.php b/Core/lib/text/contains/.php index 284c40297..c572f921e 100644 --- a/Core/lib/text/contains/.php +++ b/Core/lib/text/contains/.php @@ -19,7 +19,6 @@ * @used-by \Df\Cron\Model\LoggerHandler::p() * @used-by \Df\Framework\Config\Dom\L::validate() * @used-by \Df\Sentry\Trace::get_frame_context() - * @used-by \Df\Xml\G::k() * @used-by \Df\Xml\G2::k() * @used-by \Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::parse() * @used-by \DxMoto\Core\Observer\CanLog::execute() From b8914e0b5a2462c2ca535f9a4b5b7aab37110d6f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:25:20 +0100 Subject: [PATCH 254/717] https://github.com/mage2pro/core/issues/436 --- Core/Text/Marker.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index c3751d36a..bac2e05ee 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -4,7 +4,6 @@ final class Marker { /** * 2021-12-12 - * @used-by \Df\Xml\G::marker() * @used-by \Df\Xml\G2::marker() */ function __construct(string $begin, string $end) {$this->_begin = $begin; $this->_end = $end;} From bf30fa5f2228a54014ee7d9949d85a0cf9df4363 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:28:56 +0100 Subject: [PATCH 255/717] https://github.com/mage2pro/core/issues/436 --- Core/Text/Marker.php | 2 +- Xml/G2.php | 6 ++++++ Xml/lib/cdata.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index bac2e05ee..d02aca192 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -10,7 +10,7 @@ function __construct(string $begin, string $end) {$this->_begin = $begin; $this- /** * 2021-12-12 - * @used-by \Df\Xml\G::markAsCData() + * @used-by \Df\Xml\G2::markAsCData() */ function mark(string $s):string {return $this->_begin . $s . $this->_end;} diff --git a/Xml/G2.php b/Xml/G2.php index b2105fe04..21f8e6602 100644 --- a/Xml/G2.php +++ b/Xml/G2.php @@ -306,6 +306,12 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns /** @used-by self::importArray() */ const CONTENT = '_content'; + /** + * Убрал df_param_s и df_result_s для ускорения работы модуля Яндекс.Маркет + * @used-by df_cdata() + */ + static function markAsCData(string $s):string {return self::marker()->mark($s);} + /** * 2021-12-12 * @used-by self::importString() diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 9dbd717f2..938bd95ed 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -1,5 +1,5 @@ Date: Mon, 23 Sep 2024 00:29:04 +0100 Subject: [PATCH 256/717] https://github.com/mage2pro/core/issues/436 --- Core/Text/Marker.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index d02aca192..82cb00dcb 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -16,14 +16,12 @@ function mark(string $s):string {return $this->_begin . $s . $this->_end;} /** * 2021-12-12 - * @used-by \Df\Xml\G::importString() * @used-by \Df\Xml\G2::importString() */ function marked(string $s):string {return df_starts_with($s, $this->_begin) && df_ends_with($s, $this->_end);} /** * 2021-12-12 - * @used-by \Df\Xml\G::importString() * @used-by \Df\Xml\G2::importString() */ function unmark(string $s):string {return df_trim_text_left_right($s, $this->_begin, $this->_end);} From 32cdb2dd9f3d4e387bededf5b7d5d6e4686332d4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:30:20 +0100 Subject: [PATCH 257/717] https://github.com/mage2pro/core/issues/436 --- Qa/lib/validation/assert/array.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qa/lib/validation/assert/array.php b/Qa/lib/validation/assert/array.php index 7a4daaf40..e4c8d5f5d 100644 --- a/Qa/lib/validation/assert/array.php +++ b/Qa/lib/validation/assert/array.php @@ -5,7 +5,7 @@ /** * @used-by df_wishlist_item_candidates() * @used-by \Dfe\GoogleFont\Fonts\Sprite::datumPoints() - * @used-by \Df\Xml\G::importArray() + * @used-by \Df\Xml\G2::importArray() * @used-by \Dfe\FacebookLogin\Customer::responseJson() */ function df_assert_array(array $a):array {return $a;} From b19cb2d3fcc80db79e99aed46a4c885738ed8016 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:31:25 +0100 Subject: [PATCH 258/717] https://github.com/mage2pro/core/issues/436 --- Core/Text/Marker.php | 8 ++++---- Core/lib/array/is.php | 2 +- Core/lib/array/select/.php | 2 +- Core/lib/empty.php | 4 ++-- Core/lib/lang/try.php | 2 +- Core/lib/lang/type/conversion/string.php | 2 +- Core/lib/text/contains/.php | 2 +- Qa/lib/dump/type.php | 2 +- Qa/lib/exception.php | 4 ++-- Qa/lib/validation/assert/array.php | 2 +- Qa/lib/validation/assert/main.php | 2 +- Qa/lib/validation/assert/other.php | 2 +- Qa/lib/validation/assert/stringable.php | 2 +- Qa/lib/validation/error.php | 4 ++-- Xml/{G2.php => G.php} | 2 +- Xml/lib/cdata.php | 4 ++-- Xml/lib/parsing/.php | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) rename Xml/{G2.php => G.php} (99%) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index 82cb00dcb..922606dc7 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -4,25 +4,25 @@ final class Marker { /** * 2021-12-12 - * @used-by \Df\Xml\G2::marker() + * @used-by \Df\Xml\G::marker() */ function __construct(string $begin, string $end) {$this->_begin = $begin; $this->_end = $end;} /** * 2021-12-12 - * @used-by \Df\Xml\G2::markAsCData() + * @used-by \Df\Xml\G::markAsCData() */ function mark(string $s):string {return $this->_begin . $s . $this->_end;} /** * 2021-12-12 - * @used-by \Df\Xml\G2::importString() + * @used-by \Df\Xml\G::importString() */ function marked(string $s):string {return df_starts_with($s, $this->_begin) && df_ends_with($s, $this->_end);} /** * 2021-12-12 - * @used-by \Df\Xml\G2::importString() + * @used-by \Df\Xml\G::importString() */ function unmark(string $s):string {return df_trim_text_left_right($s, $this->_begin, $this->_end);} diff --git a/Core/lib/array/is.php b/Core/lib/array/is.php index 5d666d2ef..4500d3ae0 100644 --- a/Core/lib/array/is.php +++ b/Core/lib/array/is.php @@ -54,7 +54,7 @@ function array_is_list(array $a):bool { * @used-by df_filter_f() * @used-by df_ksort() * @used-by \Df\Core\Exception::__construct() - * @used-by \Df\Xml\G2::importArray() + * @used-by \Df\Xml\G::importArray() * @param array(int|string => mixed)|mixed $a */ function df_is_assoc($a):bool {return is_array($a) && (!$a || !array_is_list($a));} diff --git a/Core/lib/array/select/.php b/Core/lib/array/select/.php index d6dcfdcf7..e6dfef806 100644 --- a/Core/lib/array/select/.php +++ b/Core/lib/array/select/.php @@ -68,7 +68,7 @@ * @used-by \Df\Sentry\Client::capture() * @used-by \Df\Sentry\Client::get_http_data() * @used-by \Df\Sso\CustomerReturn::mc() - * @used-by \Df\Xml\G2::importArray() + * @used-by \Df\Xml\G::importArray() * @used-by \Dfe\AlphaCommerceHub\W\Event::providerRespL() * @used-by \Dfe\AmazonLogin\Customer::res() * @used-by \Dfe\CheckoutCom\Source\Prefill::config() diff --git a/Core/lib/empty.php b/Core/lib/empty.php index a4159b9f4..5ae7e945c 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -20,7 +20,7 @@ * @used-by \Df\Payment\W\Exception\Ignored::message() * @used-by \Df\Payment\W\Handler::log() * @used-by \Df\Typography\Css::rule() - * @used-by \Df\Xml\G2::importString() + * @used-by \Df\Xml\G::importString() * @param mixed $v */ function df_es($v):bool {return '' === $v;} @@ -52,7 +52,7 @@ function df_est($v):bool {return df_es(df_trim($v));} * @used-by \Df\Config\Backend\Serialized::valueUnserialize() * @used-by \Df\Config\Settings::json() * @used-by \Df\Directory\FE\Country::getValues() - * @used-by \Df\Xml\G2::importString() + * @used-by \Df\Xml\G::importString() * @used-by \Dfe\AllPay\Total\Quote::iiAdd() * @used-by \Dfe\AllPay\Total\Quote::iiGet() * @used-by \Dfe\CheckoutCom\Method::disableEvent() diff --git a/Core/lib/lang/try.php b/Core/lib/lang/try.php index b8d3abeef..f63ac7b12 100644 --- a/Core/lib/lang/try.php +++ b/Core/lib/lang/try.php @@ -31,7 +31,7 @@ * @used-by \Df\Qa\Trace\Formatter::p() * @used-by \Df\Qa\Trace\Frame::methodR() * @used-by \Df\Theme\Controller\Result\MessagePlugin::getCookiesMessages() - * @used-by \Df\Xml\G2::addChild() + * @used-by \Df\Xml\G::addChild() * @used-by \Dfe\CheckoutCom\Method::leh() * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() * @used-by \Dfe\GoogleFont\Fonts\Png::url() diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 84b8760cf..2b11dd98b 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -17,7 +17,7 @@ * @used-by df_type() * @used-by \Df\Framework\W\Result\Json::prepare() * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Xml\G2::importString() + * @used-by \Df\Xml\G::importString() * @param mixed $v */ function df_string($v):string {return df_dump(strval(df_assert_stringable($v)));} \ No newline at end of file diff --git a/Core/lib/text/contains/.php b/Core/lib/text/contains/.php index c572f921e..b9740d886 100644 --- a/Core/lib/text/contains/.php +++ b/Core/lib/text/contains/.php @@ -19,7 +19,7 @@ * @used-by \Df\Cron\Model\LoggerHandler::p() * @used-by \Df\Framework\Config\Dom\L::validate() * @used-by \Df\Sentry\Trace::get_frame_context() - * @used-by \Df\Xml\G2::k() + * @used-by \Df\Xml\G::k() * @used-by \Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::parse() * @used-by \DxMoto\Core\Observer\CanLog::execute() * @used-by \RWCandy\Captcha\Assert::name() diff --git a/Qa/lib/dump/type.php b/Qa/lib/dump/type.php index 84b60b538..7fdfbff78 100644 --- a/Qa/lib/dump/type.php +++ b/Qa/lib/dump/type.php @@ -10,7 +10,7 @@ * @used-by df_result_s() * @used-by dfaf() * @used-by dfpex_args() - * @used-by \Df\Xml\G2::addAttributes() + * @used-by \Df\Xml\G::addAttributes() * @param mixed $v */ function df_type($v):string {return is_object($v) ? sprintf('an object: `%s`', get_class($v), df_dump($v)) : (is_array($v) diff --git a/Qa/lib/exception.php b/Qa/lib/exception.php index 7bc68a130..d9181dc84 100644 --- a/Qa/lib/exception.php +++ b/Qa/lib/exception.php @@ -92,8 +92,8 @@ function df_xf(T $t):T {while ($t->getPrevious()) {$t = $t->getPrevious();} retu * @used-by \Df\Payment\PlaceOrderInternal::message() * @used-by \Df\Payment\W\Handler::handle() * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Df\Xml\G2::addChild() - * @used-by \Df\Xml\G2::importString() + * @used-by \Df\Xml\G::addChild() + * @used-by \Df\Xml\G::importString() * @used-by \Dfe\CheckoutCom\Handler::p() * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() * @used-by \Dfe\Klarna\Exception::messageC() diff --git a/Qa/lib/validation/assert/array.php b/Qa/lib/validation/assert/array.php index e4c8d5f5d..7a4daaf40 100644 --- a/Qa/lib/validation/assert/array.php +++ b/Qa/lib/validation/assert/array.php @@ -5,7 +5,7 @@ /** * @used-by df_wishlist_item_candidates() * @used-by \Dfe\GoogleFont\Fonts\Sprite::datumPoints() - * @used-by \Df\Xml\G2::importArray() + * @used-by \Df\Xml\G::importArray() * @used-by \Dfe\FacebookLogin\Customer::responseJson() */ function df_assert_array(array $a):array {return $a;} diff --git a/Qa/lib/validation/assert/main.php b/Qa/lib/validation/assert/main.php index 2cb19c485..4c797594c 100644 --- a/Qa/lib/validation/assert/main.php +++ b/Qa/lib/validation/assert/main.php @@ -48,7 +48,7 @@ * @used-by \Df\Qa\Trace\Frame::url() * @used-by \Df\StripeClone\Payer::newCard() * @used-by \Df\Typography\Font::validate() - * @used-by \Df\Xml\G2::addAttributes() + * @used-by \Df\Xml\G::addAttributes() * @used-by \Dfe\AllPay\InstallmentSales\Plan\Entity::validate() * @used-by \Dfe\AllPay\Total\Quote::collect() * @used-by \Dfe\AllPay\Total\Quote::iiAdd() diff --git a/Qa/lib/validation/assert/other.php b/Qa/lib/validation/assert/other.php index 7158bc5eb..30990e078 100644 --- a/Qa/lib/validation/assert/other.php +++ b/Qa/lib/validation/assert/other.php @@ -29,7 +29,7 @@ function df_assert_nef($v, $m = null) {return false !== $v ? $v : df_error($m ?: * @used-by \Df\Payment\W\Event::pid() * @used-by \Df\PaypalClone\Charge::p() * @used-by \Df\StripeClone\Payer::newCard() - * @used-by \Df\Xml\G2::addAttributes() + * @used-by \Df\Xml\G::addAttributes() * @used-by \Dfe\Stripe\Controller\CustomerReturn\Index::isSuccess() * @used-by \Dfe\Stripe\Init\Action::redirectUrl() * @throws DFE diff --git a/Qa/lib/validation/assert/stringable.php b/Qa/lib/validation/assert/stringable.php index 2403beccd..905c96d8f 100644 --- a/Qa/lib/validation/assert/stringable.php +++ b/Qa/lib/validation/assert/stringable.php @@ -3,7 +3,7 @@ /** * 2024-09-22 * @used-by df_string() - * @used-by \Df\Xml\G2::addAttributes() + * @used-by \Df\Xml\G::addAttributes() * @param string|string[]|array(string => mixed)|mixed|T|null ...$a * @return mixed * @throws DFE diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index 9b725917b..e3fe06972 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -131,8 +131,8 @@ function df_abstract($caller):void { * @used-by \Df\Shipping\Method::s() * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() * @used-by \Df\StripeClone\Facade\Charge::cardData() - * @used-by \Df\Xml\G2::addChild() - * @used-by \Df\Xml\G2::importString() + * @used-by \Df\Xml\G::addChild() + * @used-by \Df\Xml\G::importString() * @used-by \Dfe\AmazonLogin\Customer::validate() * @used-by \Dfe\BlackbaudNetCommunity\Customer::p() * @used-by \Dfe\SecurePay\Refund::process() diff --git a/Xml/G2.php b/Xml/G.php similarity index 99% rename from Xml/G2.php rename to Xml/G.php index 21f8e6602..c1ae41241 100644 --- a/Xml/G2.php +++ b/Xml/G.php @@ -7,7 +7,7 @@ # 2024-09-22 # 1) "Refactor `Df\Xml\X`": https://github.com/mage2pro/core/issues/436 # 2) "Refactor the `Df_Xml` module": https://github.com/mage2pro/core/issues/437 -final class G2 { +final class G { /** * 2024-09-22 * @used-by self::addChild() diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 938bd95ed..1377c6adf 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -1,5 +1,5 @@ Date: Mon, 23 Sep 2024 00:31:57 +0100 Subject: [PATCH 259/717] refactoring --- Framework/lib/module/fs/name.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Framework/lib/module/fs/name.php b/Framework/lib/module/fs/name.php index f82d8277b..deb082968 100644 --- a/Framework/lib/module/fs/name.php +++ b/Framework/lib/module/fs/name.php @@ -1,6 +1,6 @@ Date: Mon, 23 Sep 2024 00:33:40 +0100 Subject: [PATCH 260/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 5e6253269..478a20228 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -1,16 +1,11 @@ Date: Mon, 23 Sep 2024 00:39:55 +0100 Subject: [PATCH 261/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 9 +++++---- Xml/lib/g/node.php | 17 +++++++++++++++++ Xml/lib/{g => o}/.php | 19 ++----------------- Xml/lib/parsing/.php | 2 +- 4 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 Xml/lib/g/node.php rename Xml/lib/{g => o}/.php (79%) diff --git a/Xml/G.php b/Xml/G.php index c1ae41241..5b85c7e46 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -10,6 +10,7 @@ final class G { /** * 2024-09-22 + * @used-by df_xml_g_node() * @used-by self::addChild() * @param X|string $x */ @@ -23,7 +24,7 @@ function __construct($x) {$this->_x = df_xml_x($x);} function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} /** - * @used-by df_xml_node() + * @used-by df_xml_g_node() * @used-by self::importArray() * @param array(string => string) $atts */ @@ -36,7 +37,7 @@ function addAttributes(array $aa):void { } /** - * @used-by df_xml_node() + * @used-by df_xml_g_node() * @used-by self::importArray() * @param array(string => mixed) $array * @param string[]|bool $wrapInCData [optional] @@ -48,8 +49,8 @@ function importArray(array $array, $wrapInCData = []):void { * 2016-08-31 * Случай, который отсутствовал в Российской сборке Magento: * 'Payment' => [ - * df_xml_node('TxnList', ['count' => 1], [ - * df_xml_node('Txn', ['ID' => 1], [ + * df_xml_g_node('TxnList', ['count' => 1], [ + * df_xml_g_node('Txn', ['ID' => 1], [ * 'amount' => 200 * ,'purchaseOrderNo' => 'test' * ,'txnID' => '009887' diff --git a/Xml/lib/g/node.php b/Xml/lib/g/node.php new file mode 100644 index 000000000..29ebcfb7d --- /dev/null +++ b/Xml/lib/g/node.php @@ -0,0 +1,17 @@ + string) $attr [optional] + * @param array(string => mixed) $contents [optional] + */ +function df_xml_g_node(string $tag, array $attr = [], array $contents = []):G { + $r = new G(df_xml_x("<{$tag}/>")); /** @var G $r */ + $r->addAttributes($attr); + $r->importArray($contents); + return $r; +} \ No newline at end of file diff --git a/Xml/lib/g/.php b/Xml/lib/o/.php similarity index 79% rename from Xml/lib/g/.php rename to Xml/lib/o/.php index d82a19f4a..b26ccc1a3 100644 --- a/Xml/lib/g/.php +++ b/Xml/lib/o/.php @@ -44,20 +44,5 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 "\x0B", " ", # 2024-09-22 The result of `df_xml_s()` does not include the XML header. - df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_node($tag, $contents, $atts))) -);} - -/** - * @used-by df_xml_g() - * @used-by \Dfe\SecurePay\Refund::process() - * @used-by \Dfe\Vantiv\Charge::pCharge() - * @used-by \Dfe\Vantiv\Test\CaseT\Charge::t04() - * @param array(string => string) $attr [optional] - * @param array(string => mixed) $contents [optional] - */ -function df_xml_node(string $tag, array $attr = [], array $contents = []):G { - $r = df_xml_x("<{$tag}/>"); /** @var G $r */ - $r->addAttributes($attr); - $r->importArray($contents); - return $r; -} \ No newline at end of file + df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_g_node($tag, $contents, $atts))) +);} \ No newline at end of file diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 478a20228..4859999bd 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -7,7 +7,7 @@ /** * 2024-09-22 "Refactor the `Df_Xml` module": https://github.com/mage2pro/core/issues/437 * @used-by df_module_name_by_path() - * @used-by df_xml_node() + * @used-by df_xml_g_node() * @used-by df_xml_parse_a() * @used-by df_xml_prettify() * @used-by df_xml_x() From 4058bc5fc0e0a5a87099c89d83a8e4e33fd1e128 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:42:41 +0100 Subject: [PATCH 262/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 7 +++++++ Xml/lib/o/.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 5b85c7e46..3f346e558 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -178,6 +178,12 @@ function importArray(array $array, $wrapInCData = []):void { } } + /** + * 2024-09-23 + * @used-by df_xml_g() + */ + function x():X {return $this->_x;} + /** * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, * а объект класса родителя. @@ -297,6 +303,7 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns * @used-by self::addChild() * @used-by self::cdata() * @used-by self::importString() + * @used-by self::x() * @var X */ private $_x; diff --git a/Xml/lib/o/.php b/Xml/lib/o/.php index b26ccc1a3..469268b91 100644 --- a/Xml/lib/o/.php +++ b/Xml/lib/o/.php @@ -44,5 +44,5 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 "\x0B", " ", # 2024-09-22 The result of `df_xml_s()` does not include the XML header. - df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_g_node($tag, $contents, $atts))) + df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_g_node($tag, $contents, $atts)->x())) );} \ No newline at end of file From 14c87d817e6fd8045d3e7ed5a2b0049fc2b21d23 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:45:47 +0100 Subject: [PATCH 263/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 10 +++++----- Xml/lib/g/node.php | 2 +- Xml/lib/o/.php | 2 +- Xml/lib/parsing/.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 3f346e558..b4cda1796 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -10,7 +10,7 @@ final class G { /** * 2024-09-22 - * @used-by df_xml_g_node() + * @used-by df_xml_go() * @used-by self::addChild() * @param X|string $x */ @@ -24,7 +24,7 @@ function __construct($x) {$this->_x = df_xml_x($x);} function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} /** - * @used-by df_xml_g_node() + * @used-by df_xml_go() * @used-by self::importArray() * @param array(string => string) $atts */ @@ -37,7 +37,7 @@ function addAttributes(array $aa):void { } /** - * @used-by df_xml_g_node() + * @used-by df_xml_go() * @used-by self::importArray() * @param array(string => mixed) $array * @param string[]|bool $wrapInCData [optional] @@ -49,8 +49,8 @@ function importArray(array $array, $wrapInCData = []):void { * 2016-08-31 * Случай, который отсутствовал в Российской сборке Magento: * 'Payment' => [ - * df_xml_g_node('TxnList', ['count' => 1], [ - * df_xml_g_node('Txn', ['ID' => 1], [ + * df_xml_go('TxnList', ['count' => 1], [ + * df_xml_go('Txn', ['ID' => 1], [ * 'amount' => 200 * ,'purchaseOrderNo' => 'test' * ,'txnID' => '009887' diff --git a/Xml/lib/g/node.php b/Xml/lib/g/node.php index 29ebcfb7d..d0580c64d 100644 --- a/Xml/lib/g/node.php +++ b/Xml/lib/g/node.php @@ -9,7 +9,7 @@ * @param array(string => string) $attr [optional] * @param array(string => mixed) $contents [optional] */ -function df_xml_g_node(string $tag, array $attr = [], array $contents = []):G { +function df_xml_go(string $tag, array $attr = [], array $contents = []):G { $r = new G(df_xml_x("<{$tag}/>")); /** @var G $r */ $r->addAttributes($attr); $r->importArray($contents); diff --git a/Xml/lib/o/.php b/Xml/lib/o/.php index 469268b91..7b9c942fd 100644 --- a/Xml/lib/o/.php +++ b/Xml/lib/o/.php @@ -44,5 +44,5 @@ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $ski # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 "\x0B", " ", # 2024-09-22 The result of `df_xml_s()` does not include the XML header. - df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_g_node($tag, $contents, $atts)->x())) + df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_go($tag, $contents, $atts)->x())) );} \ No newline at end of file diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 4859999bd..0e4ede318 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -7,7 +7,7 @@ /** * 2024-09-22 "Refactor the `Df_Xml` module": https://github.com/mage2pro/core/issues/437 * @used-by df_module_name_by_path() - * @used-by df_xml_g_node() + * @used-by df_xml_go() * @used-by df_xml_parse_a() * @used-by df_xml_prettify() * @used-by df_xml_x() From 93734057b729c39c447d06abb17e89de3ff19512 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:46:40 +0100 Subject: [PATCH 264/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/g/{node.php => go.php} | 0 Xml/lib/o/{.php => g.php} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/g/{node.php => go.php} (100%) rename Xml/lib/o/{.php => g.php} (100%) diff --git a/Xml/lib/g/node.php b/Xml/lib/g/go.php similarity index 100% rename from Xml/lib/g/node.php rename to Xml/lib/g/go.php diff --git a/Xml/lib/o/.php b/Xml/lib/o/g.php similarity index 100% rename from Xml/lib/o/.php rename to Xml/lib/o/g.php From a9871449d41eb723735c8ae072ca443b0cca5513 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:46:53 +0100 Subject: [PATCH 265/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{o => }/g.php | 0 Xml/lib/{g => }/go.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{o => }/g.php (100%) rename Xml/lib/{g => }/go.php (100%) diff --git a/Xml/lib/o/g.php b/Xml/lib/g.php similarity index 100% rename from Xml/lib/o/g.php rename to Xml/lib/g.php diff --git a/Xml/lib/g/go.php b/Xml/lib/go.php similarity index 100% rename from Xml/lib/g/go.php rename to Xml/lib/go.php From 6fe3a55ac415a5747d88624f3198b397cd1f951b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:48:32 +0100 Subject: [PATCH 266/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/g/s/.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Xml/lib/g/s/.php b/Xml/lib/g/s/.php index 03262ce4a..0323bc27f 100644 --- a/Xml/lib/g/s/.php +++ b/Xml/lib/g/s/.php @@ -1,6 +1,6 @@ getName()}"; # 2024-09-22 https://www.php.net/manual/en/simplexmlelement.attributes.php - if ($aa = $x->attributes('xsi', true)) { /** @var ?CX $aa */ + if ($aa = $x->attributes('xsi', true)) { /** @var ?X $aa */ foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ $v = str_replace('"', '\"', (string)$v); $r .= " xsi:$k=\"$v\""; @@ -52,7 +52,7 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ $r .= df_cdata_raw_if_needed($xs); } $r .= $nl; - foreach ($x->children() as $child) {/** @var CX $child */ + foreach ($x->children() as $child) {/** @var X $child */ $r .= df_xml_s($child, ++$level); } $r .= "$padgetName()}>$nl"; @@ -71,7 +71,7 @@ function df_xml_s($x, int $level = 0):string {/** @var string $r */ * Новый алгоритм взят отсюда: http://stackoverflow.com/a/5947858 * 2024-09-22 @deprecated */ -function df_xml_s_simple(CX $x):string { +function df_xml_s_simple(X $x):string { $dom = dom_import_simplexml($x); /** @var \DOMElement $dom */ /** * 2021-12-13 From 2f433f6147c8d0da45b7a4c77c021530632cc9c8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:52:42 +0100 Subject: [PATCH 267/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 12 ++++++++++++ Xml/lib/go.php | 7 +------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index b4cda1796..761678769 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -314,6 +314,18 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns /** @used-by self::importArray() */ const CONTENT = '_content'; + /** + * @used-by df_xml_go() + * @param array(string => string) $attr [optional] + * @param array(string => mixed) $contents [optional] + */ + static function i(string $tag, array $attr = [], array $contents = []):self { + $r = new self(df_xml_x("<{$tag}/>")); /** @var G $r */ + $r->addAttributes($attr); + $r->importArray($contents); + return $r; + } + /** * Убрал df_param_s и df_result_s для ускорения работы модуля Яндекс.Маркет * @used-by df_cdata() diff --git a/Xml/lib/go.php b/Xml/lib/go.php index d0580c64d..083c8009c 100644 --- a/Xml/lib/go.php +++ b/Xml/lib/go.php @@ -9,9 +9,4 @@ * @param array(string => string) $attr [optional] * @param array(string => mixed) $contents [optional] */ -function df_xml_go(string $tag, array $attr = [], array $contents = []):G { - $r = new G(df_xml_x("<{$tag}/>")); /** @var G $r */ - $r->addAttributes($attr); - $r->importArray($contents); - return $r; -} \ No newline at end of file +function df_xml_go(string $tag, array $attr = [], array $contents = []):G {return G::i($tag, $attr, $contents);} \ No newline at end of file From 31b884d077c54535cfa45213e83008f85ef8e63a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:54:22 +0100 Subject: [PATCH 268/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 74 +++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 761678769..74352a514 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -9,26 +9,56 @@ # 2) "Refactor the `Df_Xml` module": https://github.com/mage2pro/core/issues/437 final class G { /** - * 2024-09-22 + * 2024-09-23 + * @used-by df_xml_g() + */ + function x():X {return $this->_x;} + + /** @used-by self::importArray() */ + const ATTR = '_attr'; + + /** @used-by self::importArray() */ + const CONTENT = '_content'; + + /** * @used-by df_xml_go() + * @param array(string => string) $attr [optional] + * @param array(string => mixed) $contents [optional] + */ + static function i(string $tag, array $attr = [], array $contents = []):self { + $r = new self(df_xml_x("<{$tag}/>")); /** @var G $r */ + $r->addAttributes($attr); + $r->importArray($contents); + return $r; + } + + /** + * Убрал df_param_s и df_result_s для ускорения работы модуля Яндекс.Маркет + * @used-by df_cdata() + */ + static function markAsCData(string $s):string {return self::marker()->mark($s);} + + /** + * 2024-09-22 + * @used-by self::i() * @used-by self::addChild() * @param X|string $x */ - function __construct($x) {$this->_x = df_xml_x($x);} + private function __construct($x) {$this->_x = df_xml_x($x);} /** * 2021-12-13 * @used-by self::addAttributes() * @used-by self::addChildX() */ - function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} + private function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} /** - * @used-by df_xml_go() + * @used-by self::i() * @used-by self::importArray() * @param array(string => string) $atts */ - function addAttributes(array $aa):void { + private function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ $this->addAttribute(df_assert_sne($k), df_assert_stringable( $v, sprintf("The attribute «{$k}» has a non-`Strinable` type %s.", df_type($v)), ['attributes' => $aa] @@ -37,12 +67,12 @@ function addAttributes(array $aa):void { } /** - * @used-by df_xml_go() + * @used-by self::i() * @used-by self::importArray() * @param array(string => mixed) $array * @param string[]|bool $wrapInCData [optional] */ - function importArray(array $array, $wrapInCData = []):void { + private function importArray(array $array, $wrapInCData = []):void { foreach ($array as $key => $v) { /** @var string $key */ /** @var mixed $v */ if ($v instanceof self) { /** @@ -178,12 +208,6 @@ function importArray(array $array, $wrapInCData = []):void { } } - /** - * 2024-09-23 - * @used-by df_xml_g() - */ - function x():X {return $this->_x;} - /** * @uses \SimpleXMLElement::addChild() создаёт и возвращает не просто SimpleXMLElement, как говорит документация, * а объект класса родителя. @@ -308,30 +332,6 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns */ private $_x; - /** @used-by self::importArray() */ - const ATTR = '_attr'; - - /** @used-by self::importArray() */ - const CONTENT = '_content'; - - /** - * @used-by df_xml_go() - * @param array(string => string) $attr [optional] - * @param array(string => mixed) $contents [optional] - */ - static function i(string $tag, array $attr = [], array $contents = []):self { - $r = new self(df_xml_x("<{$tag}/>")); /** @var G $r */ - $r->addAttributes($attr); - $r->importArray($contents); - return $r; - } - - /** - * Убрал df_param_s и df_result_s для ускорения работы модуля Яндекс.Маркет - * @used-by df_cdata() - */ - static function markAsCData(string $s):string {return self::marker()->mark($s);} - /** * 2021-12-12 * @used-by self::importString() From 1ebc80a3afe77d5f5021b19c2945e6ae23b83e8d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:57:57 +0100 Subject: [PATCH 269/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 4 +++- Xml/lib/g/s/.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 74352a514..452aad2d8 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -10,9 +10,11 @@ final class G { /** * 2024-09-23 + * @override + * @see Stringable::__toString() * @used-by df_xml_g() */ - function x():X {return $this->_x;} + function __toString():string {return df_xml_s($this->_x);} /** @used-by self::importArray() */ const ATTR = '_attr'; diff --git a/Xml/lib/g/s/.php b/Xml/lib/g/s/.php index 0323bc27f..f16135c67 100644 --- a/Xml/lib/g/s/.php +++ b/Xml/lib/g/s/.php @@ -7,10 +7,10 @@ * @see \Magento\Framework\Simplexml\Element::asNiceXml() * @used-by df_assert_leaf() * @used-by df_xml_children() - * @used-by df_xml_g() * @used-by df_xml_parse_header() * @used-by df_xml_prettify() * @used-by df_xml_s() + * @used-by \Df\Xml\G::__toString() * @param X|MX|string $x */ function df_xml_s($x, int $level = 0):string {/** @var string $r */ From f139e456bc1b7bd20b83dab741b2f28a44f47b51 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 00:59:35 +0100 Subject: [PATCH 270/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 2 +- Xml/lib/g.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Xml/G.php b/Xml/G.php index 452aad2d8..012880123 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -325,11 +325,11 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns /** * 2024-09-22 * @used-by self::__construct() + * @used-by self::__toString() * @used-by self::addAttribute() * @used-by self::addChild() * @used-by self::cdata() * @used-by self::importString() - * @used-by self::x() * @var X */ private $_x; diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 7b9c942fd..1b66d4f4f 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -42,7 +42,6 @@ */ function df_xml_g(string $tag, array $contents = [], array $atts = [], bool $skipHeader = false):string {return str_replace( # Символ 0xB (вертикальная табуляция) допустим в UTF-8, но недопустим в XML: http://stackoverflow.com/a/10095901 - "\x0B", " ", - # 2024-09-22 The result of `df_xml_s()` does not include the XML header. - df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_s(df_xml_go($tag, $contents, $atts)->x())) + # 2024-09-22 The result of `df_xml_s()` does not include the XML header. + "\x0B", " ", df_cc_n($skipHeader ? '' : df_xml_header(), df_xml_go($tag, $contents, $atts)) );} \ No newline at end of file From 620383ba10773117ca537cee9c1d3604685ef946 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:00:18 +0100 Subject: [PATCH 271/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 012880123..250518480 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -53,7 +53,9 @@ private function __construct($x) {$this->_x = df_xml_x($x);} * @used-by self::addAttributes() * @used-by self::addChildX() */ - private function addAttribute(string $k, string $v = '', string $ns = ''):void {$this->_x->addAttribute($this->k($k), $v, $ns);} + private function addAttribute(string $k, string $v = '', string $ns = ''):void { + $this->_x->addAttribute($this->k($k), $v, $ns); + } /** * @used-by self::i() From ef23411b1cc5391e59300145d86539a808869abc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:01:11 +0100 Subject: [PATCH 272/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 250518480..1a6c4b329 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -28,7 +28,7 @@ function __toString():string {return df_xml_s($this->_x);} * @param array(string => mixed) $contents [optional] */ static function i(string $tag, array $attr = [], array $contents = []):self { - $r = new self(df_xml_x("<{$tag}/>")); /** @var G $r */ + $r = new self(df_xml_x("<{$tag}/>")); /** @var self $r */ $r->addAttributes($attr); $r->importArray($contents); return $r; From adfe98dd60570fb5221130ccf8f237a8aee21e57 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:02:29 +0100 Subject: [PATCH 273/717] https://github.com/mage2pro/core/issues/437 --- Framework/lib/module/fs/name.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Framework/lib/module/fs/name.php b/Framework/lib/module/fs/name.php index deb082968..46bc3a1c7 100644 --- a/Framework/lib/module/fs/name.php +++ b/Framework/lib/module/fs/name.php @@ -1,7 +1,7 @@ From d574037a795837e759841f5f941adaa288357604 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:03:07 +0100 Subject: [PATCH 274/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/leaf/get/s.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Xml/lib/leaf/get/s.php b/Xml/lib/leaf/get/s.php index fa8612659..663d9c66c 100644 --- a/Xml/lib/leaf/get/s.php +++ b/Xml/lib/leaf/get/s.php @@ -1,19 +1,18 @@ Date: Mon, 23 Sep 2024 01:03:24 +0100 Subject: [PATCH 275/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/leaf/get/s.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xml/lib/leaf/get/s.php b/Xml/lib/leaf/get/s.php index 663d9c66c..720e26f1d 100644 --- a/Xml/lib/leaf/get/s.php +++ b/Xml/lib/leaf/get/s.php @@ -6,14 +6,14 @@ * @used-by \Dfe\Robokassa\Api\Options::p() * @param string|callable $d [optional] */ -function df_leaf_s(?X $e = null, $d = ''):string {return (string)df_leaf($e, $d);} +function df_leaf_s(?X $x = null, $d = ''):string {return (string)df_leaf($x, $d);} /** * @used-by \Dfe\SecurePay\Refund::process() * @param string|callable $d [optional] */ -function df_leaf_sne(?X $e = null, $d = ''):string {/** @var string $r */ - if (df_es($r = df_leaf_s($e, $d))) { +function df_leaf_sne(?X $x = null, $d = ''):string {/** @var string $r */ + if (df_es($r = df_leaf_s($x, $d))) { df_error('Лист дерева XML должен быть непуст, однако он пуст.'); } return $r; From b3826595ca762eeb7a8c21392e61887b3e4b5663 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:04:01 +0100 Subject: [PATCH 276/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/a.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Xml/lib/parsing/a.php b/Xml/lib/parsing/a.php index 193d56e66..3c7b33cf9 100644 --- a/Xml/lib/parsing/a.php +++ b/Xml/lib/parsing/a.php @@ -1,8 +1,6 @@ * } * @used-by \Dfe\Vantiv\API\Client::_construct() - * @param string|X $x + * @param X|string $x * @return array(string => mixed) * @throws E */ From c06163b2f67338dbb8917ab19c4a853ea8d3b3e2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:09:47 +0100 Subject: [PATCH 277/717] https://github.com/mage2pro/core/issues/439 --- Xml/lib/parsing/.php | 2 +- Xml/lib/parsing/a.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/parsing/.php b/Xml/lib/parsing/.php index 0e4ede318..6d8488996 100644 --- a/Xml/lib/parsing/.php +++ b/Xml/lib/parsing/.php @@ -8,7 +8,7 @@ * 2024-09-22 "Refactor the `Df_Xml` module": https://github.com/mage2pro/core/issues/437 * @used-by df_module_name_by_path() * @used-by df_xml_go() - * @used-by df_xml_parse_a() + * @used-by df_xml2a() * @used-by df_xml_prettify() * @used-by df_xml_x() * @used-by \Df\Xml\G::__construct() diff --git a/Xml/lib/parsing/a.php b/Xml/lib/parsing/a.php index 3c7b33cf9..cb909a5c0 100644 --- a/Xml/lib/parsing/a.php +++ b/Xml/lib/parsing/a.php @@ -28,4 +28,4 @@ * @return array(string => mixed) * @throws E */ -function df_xml_parse_a($x):array {return df_xml_x($x)->asArray();} \ No newline at end of file +function df_xml2a($x):array {return df_xml_x($x)->asArray();} \ No newline at end of file From 7c5b000053a6fd57e72da8790f00f9da2b318ebf Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:10:56 +0100 Subject: [PATCH 278/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{parsing => }/a.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{parsing => }/a.php (100%) diff --git a/Xml/lib/parsing/a.php b/Xml/lib/a.php similarity index 100% rename from Xml/lib/parsing/a.php rename to Xml/lib/a.php From 80bdf50cc2a916414fdeadbc2b0593040d0f4bac Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:13:09 +0100 Subject: [PATCH 279/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index cb909a5c0..47c812164 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -28,4 +28,29 @@ * @return array(string => mixed) * @throws E */ -function df_xml2a($x):array {return df_xml_x($x)->asArray();} \ No newline at end of file +function df_xml2a($x):array { + $x = df_xml_x($x); + $result = []; + // add attributes + foreach ($x->attributes() as $attributeName => $attribute) { + if ($attribute) { + $result['@'][$attributeName] = (string)$attribute; + } + } + // add children values + if ($x->hasChildren()) { + foreach ($x->children() as $childName => $child) { + $result[$childName] = df_xml2a($child); + } + } + else { + if (empty($result)) { + // return as string, if nothing was found + $result = (string)$x; + } else { + // value has zero key element + $result[0] = (string)$x; + } + } + return $result; +} \ No newline at end of file From 18d7ce4ebaccd7393a6d0db04fd6d1b259269e92 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:13:30 +0100 Subject: [PATCH 280/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index 47c812164..03c48bf6e 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -30,27 +30,27 @@ */ function df_xml2a($x):array { $x = df_xml_x($x); - $result = []; + $r = []; // add attributes foreach ($x->attributes() as $attributeName => $attribute) { if ($attribute) { - $result['@'][$attributeName] = (string)$attribute; + $r['@'][$attributeName] = (string)$attribute; } } // add children values if ($x->hasChildren()) { foreach ($x->children() as $childName => $child) { - $result[$childName] = df_xml2a($child); + $r[$childName] = df_xml2a($child); } } else { - if (empty($result)) { + if (empty($r)) { // return as string, if nothing was found - $result = (string)$x; + $r = (string)$x; } else { // value has zero key element - $result[0] = (string)$x; + $r[0] = (string)$x; } } - return $result; + return $r; } \ No newline at end of file From 0d7a394db09e73a678902073286992140ef60cea Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:14:13 +0100 Subject: [PATCH 281/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index 03c48bf6e..a325d4b1c 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -31,10 +31,9 @@ function df_xml2a($x):array { $x = df_xml_x($x); $r = []; - // add attributes - foreach ($x->attributes() as $attributeName => $attribute) { - if ($attribute) { - $r['@'][$attributeName] = (string)$attribute; + foreach ($x->attributes() as $k => $v) {/** @var string $k */ /** @var mixed $v */ + if ($v) { + $r['@'][$k] = (string)$v; } } // add children values From 075b6b208065e876d5210ea35c97f9a30908905a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:15:14 +0100 Subject: [PATCH 282/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index a325d4b1c..a67a0a9dd 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -38,18 +38,15 @@ function df_xml2a($x):array { } // add children values if ($x->hasChildren()) { - foreach ($x->children() as $childName => $child) { - $r[$childName] = df_xml2a($child); + foreach ($x->children() as $k => $c) {/** @var X $c */ + $r[$k] = df_xml2a($c); } } + elseif (empty($r)) { + $r = (string)$x; + } else { - if (empty($r)) { - // return as string, if nothing was found - $r = (string)$x; - } else { - // value has zero key element - $r[0] = (string)$x; - } + $r[0] = (string)$x; } return $r; } \ No newline at end of file From c42de93e88b5251bd68fc182b6ed2ff42149e5a0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:15:19 +0100 Subject: [PATCH 283/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index a67a0a9dd..fc3d0415a 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -36,7 +36,6 @@ function df_xml2a($x):array { $r['@'][$k] = (string)$v; } } - // add children values if ($x->hasChildren()) { foreach ($x->children() as $k => $c) {/** @var X $c */ $r[$k] = df_xml2a($c); From 4328e55fefad23c3dbc9296c4023ebe2b79351c6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:20:56 +0100 Subject: [PATCH 284/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index fc3d0415a..1ad66d8e5 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -4,7 +4,7 @@ /** * 2018-12-19 - * @uses \Magento\Framework\Simplexml\Element::asArray() returns XML tag's attributes + * @see \Magento\Framework\Simplexml\Element::asArray() returns XML tag's attributes * inside an `@` key, e.g: * * 82924701437133501 @@ -31,9 +31,13 @@ function df_xml2a($x):array { $x = df_xml_x($x); $r = []; - foreach ($x->attributes() as $k => $v) {/** @var string $k */ /** @var mixed $v */ - if ($v) { - $r['@'][$k] = (string)$v; + # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php + /** @var ?X $aa */ + if ($aa = $x->attributes()) { + foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ + if ($v) { + $r['@'][$k] = (string)$v; + } } } if ($x->hasChildren()) { From 509694b3a560c470f09e80cefc288dccc82f4549 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:25:00 +0100 Subject: [PATCH 285/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index 1ad66d8e5..737012b6b 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -45,7 +45,7 @@ function df_xml2a($x):array { $r[$k] = df_xml2a($c); } } - elseif (empty($r)) { + elseif (!$r) { $r = (string)$x; } else { From 1b32ded336edae45a070265966481ffe3be0c4bc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:26:49 +0100 Subject: [PATCH 286/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/a.php | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Xml/lib/a.php b/Xml/lib/a.php index 737012b6b..bf9739b59 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -28,7 +28,36 @@ * @return array(string => mixed) * @throws E */ -function df_xml2a($x):array { +function df_xml2a($x):array {return df_xml2as($x);} + +/** + * 2018-12-19 + * @see \Magento\Framework\Simplexml\Element::asArray() returns XML tag's attributes + * inside an `@` key, e.g: + * + * 82924701437133501 + * f838868475 + * 000 + * <...> + * + * will be converted to: + * { + * "@": { + * "customerId": "admin@mage2.pro", + * "reportGroup": "1272532" + * }, + * "litleTxnId": "82924701437133501", + * "orderId": "f838868475", + * "response": "000", + * <...> + * } + * @used-by df_xml2a() + * @used-by df_xml2as() + * @param X|string $x + * @return array(string => mixed)|string + * @throws E + */ +function df_xml2as($x) { $x = df_xml_x($x); $r = []; # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php @@ -42,7 +71,7 @@ function df_xml2a($x):array { } if ($x->hasChildren()) { foreach ($x->children() as $k => $c) {/** @var X $c */ - $r[$k] = df_xml2a($c); + $r[$k] = df_xml2as($c); } } elseif (!$r) { From a79775ed3206c5a903e0008e263fd5b3c3f27206 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:34:31 +0100 Subject: [PATCH 287/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 36 ++++++++++++++++++++++++++++++++ Xml/lib/a.php | 58 ++------------------------------------------------- 2 files changed, 38 insertions(+), 56 deletions(-) create mode 100644 Xml/A.php diff --git a/Xml/A.php b/Xml/A.php new file mode 100644 index 000000000..f2b1dcea6 --- /dev/null +++ b/Xml/A.php @@ -0,0 +1,36 @@ + mixed) + */ + static function p($x):array { + $x = df_xml_x($x); + $r = []; + # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php + /** @var ?X $aa */ + if ($aa = $x->attributes()) { + foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ + if ($v) { + $r['@'][$k] = (string)$v; + } + } + } + if ($x->hasChildren()) { + foreach ($x->children() as $k => $c) {/** @var X $c */ + $r[$k] = self::p($c); + } + } + elseif (!$r) { + $r = (string)$x; + } + else { + $r[0] = (string)$x; + } + return $r; + } +} \ No newline at end of file diff --git a/Xml/lib/a.php b/Xml/lib/a.php index bf9739b59..f6e8405ac 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -1,5 +1,5 @@ mixed) - * @throws E */ -function df_xml2a($x):array {return df_xml2as($x);} - -/** - * 2018-12-19 - * @see \Magento\Framework\Simplexml\Element::asArray() returns XML tag's attributes - * inside an `@` key, e.g: - * - * 82924701437133501 - * f838868475 - * 000 - * <...> - * - * will be converted to: - * { - * "@": { - * "customerId": "admin@mage2.pro", - * "reportGroup": "1272532" - * }, - * "litleTxnId": "82924701437133501", - * "orderId": "f838868475", - * "response": "000", - * <...> - * } - * @used-by df_xml2a() - * @used-by df_xml2as() - * @param X|string $x - * @return array(string => mixed)|string - * @throws E - */ -function df_xml2as($x) { - $x = df_xml_x($x); - $r = []; - # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php - /** @var ?X $aa */ - if ($aa = $x->attributes()) { - foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ - if ($v) { - $r['@'][$k] = (string)$v; - } - } - } - if ($x->hasChildren()) { - foreach ($x->children() as $k => $c) {/** @var X $c */ - $r[$k] = df_xml2as($c); - } - } - elseif (!$r) { - $r = (string)$x; - } - else { - $r[0] = (string)$x; - } - return $r; -} \ No newline at end of file +function df_xml2a($x):array {return A::p($x);} \ No newline at end of file From b76effcbc17932c0af7c7c31c745ee017619b771 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:42:30 +0100 Subject: [PATCH 288/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Xml/A.php b/Xml/A.php index f2b1dcea6..a31db328d 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -33,4 +33,28 @@ static function p($x):array { } return $r; } + + /** + * 2024-09-23 + * @used-by self::p() + */ + private static function atts(X $x):array { + $r = []; /** @var array(string => string) $r */ + # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php + /** @var ?X $aa */ + if ($aa = $x->attributes()) { + foreach ($aa as $k => $v) {/** @var string $k */ + /** + * 2024-09-23 + * @var ?X $v + * @see \SimpleXMLElement::current() + * https://www.php.net/manual/en/simplexmlelement.current.php + */ + if ($v) { + $r['@'][$k] = (string)$v; + } + } + } + return $r; + } } \ No newline at end of file From 8b2602b2569af7d6530222b6118b8ced2b277498 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:42:46 +0100 Subject: [PATCH 289/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/A.php b/Xml/A.php index a31db328d..1ab9f2c03 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -51,7 +51,7 @@ private static function atts(X $x):array { * https://www.php.net/manual/en/simplexmlelement.current.php */ if ($v) { - $r['@'][$k] = (string)$v; + $r[$k] = (string)$v; } } } From 9225c2dd026361f21924d55e198bdc65c4ee1838 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:44:00 +0100 Subject: [PATCH 290/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Xml/A.php b/Xml/A.php index 1ab9f2c03..64282ba18 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -13,12 +13,8 @@ static function p($x):array { $r = []; # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php /** @var ?X $aa */ - if ($aa = $x->attributes()) { - foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ - if ($v) { - $r['@'][$k] = (string)$v; - } - } + if ($aa = self::atts($x)) { + $r['@'] = $aa; } if ($x->hasChildren()) { foreach ($x->children() as $k => $c) {/** @var X $c */ @@ -37,6 +33,7 @@ static function p($x):array { /** * 2024-09-23 * @used-by self::p() + * @return array(string => string) */ private static function atts(X $x):array { $r = []; /** @var array(string => string) $r */ From 9d48199bf3c95bb7e52b31fe5ed5071469c8d2db Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:52:23 +0100 Subject: [PATCH 291/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/Xml/A.php b/Xml/A.php index 64282ba18..31671536a 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -11,9 +11,7 @@ final class A { static function p($x):array { $x = df_xml_x($x); $r = []; - # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php - /** @var ?X $aa */ - if ($aa = self::atts($x)) { + if ($aa = self::atts($x)) { /** @var array(string => string) $aa */ $r['@'] = $aa; } if ($x->hasChildren()) { @@ -31,27 +29,11 @@ static function p($x):array { } /** - * 2024-09-23 + * 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php * @used-by self::p() * @return array(string => string) */ - private static function atts(X $x):array { - $r = []; /** @var array(string => string) $r */ - # 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php - /** @var ?X $aa */ - if ($aa = $x->attributes()) { - foreach ($aa as $k => $v) {/** @var string $k */ - /** - * 2024-09-23 - * @var ?X $v - * @see \SimpleXMLElement::current() - * https://www.php.net/manual/en/simplexmlelement.current.php - */ - if ($v) { - $r[$k] = (string)$v; - } - } - } - return $r; - } + private static function atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_null( + df_map($aa, function(?X $v):?string {return !$v ? null : (string)$v;}) + );} } \ No newline at end of file From c82ed2f1d431f986be15e627da8db3a6317002d3 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:59:26 +0100 Subject: [PATCH 292/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/array/clean/main.php | 1 + Xml/A.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/lib/array/clean/main.php b/Core/lib/array/clean/main.php index b75d4e297..c576e9a85 100644 --- a/Core/lib/array/clean/main.php +++ b/Core/lib/array/clean/main.php @@ -132,6 +132,7 @@ function df_clean_null(array $r):array {return array_filter($r, function($v) {re * @used-by df_clean() * @used-by df_clean_r() * @used-by \Df\Core\Html\Tag::__construct() + * @used-by \Df\Xml\A::atts() * @used-by \Dfe\Sift\API\Client::_construct() */ function df_clean_r(array $r, array $k = [], bool $req = true):array {/** @var mixed[] $r */ diff --git a/Xml/A.php b/Xml/A.php index 31671536a..18e4f83b4 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -33,7 +33,7 @@ static function p($x):array { * @used-by self::p() * @return array(string => string) */ - private static function atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_null( + private static function atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_r( df_map($aa, function(?X $v):?string {return !$v ? null : (string)$v;}) );} } \ No newline at end of file From 12b9e6b14a58d9294c2ba10e8a3057a6116e97c8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 01:59:47 +0100 Subject: [PATCH 293/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/array/map/.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/lib/array/map/.php b/Core/lib/array/map/.php index 80d501d9c..0db278f89 100644 --- a/Core/lib/array/map/.php +++ b/Core/lib/array/map/.php @@ -36,6 +36,7 @@ * @used-by \CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) * @used-by \CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order::afterCanInvoice() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/256) * @used-by \Df\Payment\ConfigProvider\GlobalT::icons() + * @used-by \Df\Xml\A::atts() * @used-by \Dfe\Color\Image::probabilities() * @used-by \Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() * @used-by \Dfe\Sift\Payload\OQI::p() From a21087e9bf77569b05e9a061f60d10dcbf9f6699 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 02:11:50 +0100 Subject: [PATCH 294/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/array/clean/main.php | 2 +- Xml/A.php | 11 +---------- Xml/lib/atts.php | 11 +++++++++++ 3 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 Xml/lib/atts.php diff --git a/Core/lib/array/clean/main.php b/Core/lib/array/clean/main.php index c576e9a85..dd6270cac 100644 --- a/Core/lib/array/clean/main.php +++ b/Core/lib/array/clean/main.php @@ -131,8 +131,8 @@ function df_clean_null(array $r):array {return array_filter($r, function($v) {re * 2) I does not remove `false`. * @used-by df_clean() * @used-by df_clean_r() + * @used-by df_xml_atts * @used-by \Df\Core\Html\Tag::__construct() - * @used-by \Df\Xml\A::atts() * @used-by \Dfe\Sift\API\Client::_construct() */ function df_clean_r(array $r, array $k = [], bool $req = true):array {/** @var mixed[] $r */ diff --git a/Xml/A.php b/Xml/A.php index 18e4f83b4..4990a09d3 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -11,7 +11,7 @@ final class A { static function p($x):array { $x = df_xml_x($x); $r = []; - if ($aa = self::atts($x)) { /** @var array(string => string) $aa */ + if ($aa = df_xml_atts($x)) { /** @var array(string => string) $aa */ $r['@'] = $aa; } if ($x->hasChildren()) { @@ -27,13 +27,4 @@ static function p($x):array { } return $r; } - - /** - * 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php - * @used-by self::p() - * @return array(string => string) - */ - private static function atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_r( - df_map($aa, function(?X $v):?string {return !$v ? null : (string)$v;}) - );} } \ No newline at end of file diff --git a/Xml/lib/atts.php b/Xml/lib/atts.php new file mode 100644 index 000000000..7e78844ce --- /dev/null +++ b/Xml/lib/atts.php @@ -0,0 +1,11 @@ + string) + */ +function df_xml_atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_r( + df_map($aa, function(?X $v):?string {return !$v ? null : (string)$v;}) +);} \ No newline at end of file From 10e2fc1bc9eddd213b0cd195dd79f8a81e499d9c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 02:12:08 +0100 Subject: [PATCH 295/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/array/map/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/map/.php b/Core/lib/array/map/.php index 0db278f89..f9a31e512 100644 --- a/Core/lib/array/map/.php +++ b/Core/lib/array/map/.php @@ -32,11 +32,11 @@ * @used-by df_qty() * @used-by df_tab() * @used-by df_trim_text_left() + * @used-by df_xml_atts * @used-by ikf_api_oi() * @used-by \CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) * @used-by \CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order::afterCanInvoice() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/256) * @used-by \Df\Payment\ConfigProvider\GlobalT::icons() - * @used-by \Df\Xml\A::atts() * @used-by \Dfe\Color\Image::probabilities() * @used-by \Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() * @used-by \Dfe\Sift\Payload\OQI::p() From 691ca877f3d76c4682f1109253942497f81eda20 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 02:13:18 +0100 Subject: [PATCH 296/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{parsing/.php => x.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{parsing/.php => x.php} (100%) diff --git a/Xml/lib/parsing/.php b/Xml/lib/x.php similarity index 100% rename from Xml/lib/parsing/.php rename to Xml/lib/x.php From 73f673f4004947ee8430abc7660eeee1cfd0f214 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 02:13:35 +0100 Subject: [PATCH 297/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/{other.php => header.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/parsing/{other.php => header.php} (100%) diff --git a/Xml/lib/parsing/other.php b/Xml/lib/parsing/header.php similarity index 100% rename from Xml/lib/parsing/other.php rename to Xml/lib/parsing/header.php From 7669798329adcf736933285390bdf66d03bb1cc5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 02:15:41 +0100 Subject: [PATCH 298/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/leaf/check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/leaf/check.php b/Xml/lib/leaf/check.php index 0967d8ab3..8eec48e5c 100644 --- a/Xml/lib/leaf/check.php +++ b/Xml/lib/leaf/check.php @@ -1,5 +1,5 @@ children()->count();} \ No newline at end of file +function df_check_leaf(X $x):bool {return !df_xml_exists($x) || !$x->children()->count();} \ No newline at end of file From d8100e09ee7060c762329301455550c98c631621 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 02:16:51 +0100 Subject: [PATCH 299/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/exists.php | 4 ++-- Xml/lib/leaf/assert.php | 2 +- Xml/lib/leaf/{check.php => is.php} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename Xml/lib/leaf/{check.php => is.php} (95%) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index 22f170dcd..8aacbe696 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -26,10 +26,10 @@ * Если здесь сделать xpath Остаток/Склад/Количество, * то для узла «147» @see df_xml_exists($e) вернёт false. * - * Обратите внимание, что эту особенность использует алгоритм @see df_check_leaf(): + * Обратите внимание, что эту особенность использует алгоритм @see df_xml_is_leaf(): * return !df_xml_exists($e) || !count($e->children()); * - * @used-by df_check_leaf() + * @used-by df_xml_is_leaf() */ function df_xml_exists(?X $e = null):bool {return !empty($e);} diff --git a/Xml/lib/leaf/assert.php b/Xml/lib/leaf/assert.php index 4fa201e2b..a528f7820 100644 --- a/Xml/lib/leaf/assert.php +++ b/Xml/lib/leaf/assert.php @@ -6,6 +6,6 @@ * @used-by df_leaf() * @throws E */ -function df_assert_leaf(CX $x):CX {return df_check_leaf($x) ? $x : df_error( +function df_assert_leaf(CX $x):CX {return df_xml_is_leaf($x) ? $x : df_error( "Требуется лист XML, однако получена ветка XML:\n%s.", df_xml_s($x) );} \ No newline at end of file diff --git a/Xml/lib/leaf/check.php b/Xml/lib/leaf/is.php similarity index 95% rename from Xml/lib/leaf/check.php rename to Xml/lib/leaf/is.php index 8eec48e5c..0136b15a8 100644 --- a/Xml/lib/leaf/check.php +++ b/Xml/lib/leaf/is.php @@ -28,4 +28,4 @@ * @see \SimpleXMLElement — самый загадочный класс PHP. * @used-by df_assert_leaf() */ -function df_check_leaf(X $x):bool {return !df_xml_exists($x) || !$x->children()->count();} \ No newline at end of file +function df_xml_is_leaf(X $x):bool {return !df_xml_exists($x) || !$x->children()->count();} \ No newline at end of file From 696e4de5eda9da618f909f1f36d9637c5f263323 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 02:17:51 +0100 Subject: [PATCH 300/717] https://github.com/mage2pro/core/issues/437 --- Qa/lib/validation/error.php | 2 +- Xml/lib/g/s/.php | 2 +- Xml/lib/leaf/assert.php | 4 ++-- Xml/lib/leaf/get/.php | 2 +- Xml/lib/leaf/is.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index e3fe06972..847817372 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -42,7 +42,7 @@ function df_abstract($caller):void { * @used-by df_assert_https() * @used-by df_assert_in() * @used-by df_assert_le() - * @used-by df_assert_leaf() + * @used-by df_xml_assert_leaf() * @used-by df_assert_lt() * @used-by df_assert_ne() * @used-by df_assert_nef() diff --git a/Xml/lib/g/s/.php b/Xml/lib/g/s/.php index f16135c67..2838718e5 100644 --- a/Xml/lib/g/s/.php +++ b/Xml/lib/g/s/.php @@ -5,7 +5,7 @@ /** * 2016-09-01 The result does not include the XML header. @see df_xml_header() * @see \Magento\Framework\Simplexml\Element::asNiceXml() - * @used-by df_assert_leaf() + * @used-by df_xml_assert_leaf() * @used-by df_xml_children() * @used-by df_xml_parse_header() * @used-by df_xml_prettify() diff --git a/Xml/lib/leaf/assert.php b/Xml/lib/leaf/assert.php index a528f7820..177d556e0 100644 --- a/Xml/lib/leaf/assert.php +++ b/Xml/lib/leaf/assert.php @@ -1,11 +1,11 @@ children()->count();} \ No newline at end of file From e6a9aec75a0b8e0005dee8847fcebdf2039339ac Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 04:13:39 +0100 Subject: [PATCH 301/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 17 +++++++++++++++-- Xml/lib/atts.php | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Xml/A.php b/Xml/A.php index 4990a09d3..b181f3b25 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -15,8 +15,16 @@ static function p($x):array { $r['@'] = $aa; } if ($x->hasChildren()) { - foreach ($x->children() as $k => $c) {/** @var X $c */ - $r[$k] = self::p($c); + foreach ($x->children() as $k => $c) {/** @var X $c */ /** @var string|array $v */ + if ($c->hasChildren($c)) { + $v = self::p($c); + } + else { + $cs = (string)$c; /** @var string $cs */ + $aa = df_xml_atts($c); /** @var array(string => string) $aa */ + $v = !$aa ? $cs : [0 => $cs] + $aa; + } + $r[$k] = $v; } } elseif (!$r) { @@ -27,4 +35,9 @@ static function p($x):array { } return $r; } + + /** + * 2024-09-23 + */ + private static function isText(X $x):bool {return !df_xml_atts($x) && (!$x->hasChildren() || !count($x->children()));} } \ No newline at end of file diff --git a/Xml/lib/atts.php b/Xml/lib/atts.php index 7e78844ce..6461e205b 100644 --- a/Xml/lib/atts.php +++ b/Xml/lib/atts.php @@ -3,6 +3,7 @@ /** * 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php + * @used-by \Df\Xml\A::isText() * @used-by \Df\Xml\A::p() * @return array(string => string) */ From 915a56a46f1b7c02bd9014730fa1a0f4ea617b5c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 04:13:49 +0100 Subject: [PATCH 302/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/A.php b/Xml/A.php index b181f3b25..a9e231e94 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -16,7 +16,7 @@ static function p($x):array { } if ($x->hasChildren()) { foreach ($x->children() as $k => $c) {/** @var X $c */ /** @var string|array $v */ - if ($c->hasChildren($c)) { + if ($c->hasChildren()) { $v = self::p($c); } else { From 504d59a6404ddd6a6f3be51440ecad7691bc71c6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 04:16:45 +0100 Subject: [PATCH 303/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Xml/A.php b/Xml/A.php index a9e231e94..43d01b99d 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -21,8 +21,7 @@ static function p($x):array { } else { $cs = (string)$c; /** @var string $cs */ - $aa = df_xml_atts($c); /** @var array(string => string) $aa */ - $v = !$aa ? $cs : [0 => $cs] + $aa; + $v = !($aa = df_xml_atts($c)) ? $cs : ([0 => $cs] + $aa); /** @var array(string => string) $aa */ } $r[$k] = $v; } From a056a36e98285b7cc6e4af300c1b2cde6889a786 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 04:22:59 +0100 Subject: [PATCH 304/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 21 +++++---------------- Xml/lib/a.php | 2 +- Xml/lib/x.php | 1 + 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Xml/A.php b/Xml/A.php index 43d01b99d..6c4a97af8 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -5,25 +5,19 @@ final class A { /** * 2024-09-23 + * @used-by df_xml2a() * @param X|string $x - * @return array(string => mixed) + * @return string|array(string => mixed) */ - static function p($x):array { + static function p($x) { $x = df_xml_x($x); $r = []; if ($aa = df_xml_atts($x)) { /** @var array(string => string) $aa */ $r['@'] = $aa; } if ($x->hasChildren()) { - foreach ($x->children() as $k => $c) {/** @var X $c */ /** @var string|array $v */ - if ($c->hasChildren()) { - $v = self::p($c); - } - else { - $cs = (string)$c; /** @var string $cs */ - $v = !($aa = df_xml_atts($c)) ? $cs : ([0 => $cs] + $aa); /** @var array(string => string) $aa */ - } - $r[$k] = $v; + foreach ($x->children() as $k => $c) {/** @var X $c */ + $r[$k] = self::p($c); } } elseif (!$r) { @@ -34,9 +28,4 @@ static function p($x):array { } return $r; } - - /** - * 2024-09-23 - */ - private static function isText(X $x):bool {return !df_xml_atts($x) && (!$x->hasChildren() || !count($x->children()));} } \ No newline at end of file diff --git a/Xml/lib/a.php b/Xml/lib/a.php index f6e8405ac..941574355 100644 --- a/Xml/lib/a.php +++ b/Xml/lib/a.php @@ -27,4 +27,4 @@ * @param X|string $x * @return array(string => mixed) */ -function df_xml2a($x):array {return A::p($x);} \ No newline at end of file +function df_xml2a($x):array {return is_array($r = A::p($x)) ? $r : [];} \ No newline at end of file diff --git a/Xml/lib/x.php b/Xml/lib/x.php index 6d8488996..df7bafda2 100644 --- a/Xml/lib/x.php +++ b/Xml/lib/x.php @@ -11,6 +11,7 @@ * @used-by df_xml2a() * @used-by df_xml_prettify() * @used-by df_xml_x() + * @used-by \Df\Xml\A::p() * @used-by \Df\Xml\G::__construct() * @used-by \Dfe\Robokassa\Api\Options::p() * @used-by \Dfe\SecurePay\Refund::process() From d7759f648c543583d7e9fa5b2115c5dcbda0a9ec Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 04:24:50 +0100 Subject: [PATCH 305/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/parsing/header.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Xml/lib/parsing/header.php b/Xml/lib/parsing/header.php index 03008561b..6d00ee083 100644 --- a/Xml/lib/parsing/header.php +++ b/Xml/lib/parsing/header.php @@ -1,14 +1,11 @@ #', df_xml_s($x));} \ No newline at end of file From 481c62f308a6fb593312399cc4ddb59951826d4a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 04:26:17 +0100 Subject: [PATCH 306/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/cdata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 1377c6adf..7cec0c87f 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -1,5 +1,5 @@ Date: Mon, 23 Sep 2024 04:26:47 +0100 Subject: [PATCH 307/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/g.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Xml/lib/g.php b/Xml/lib/g.php index 1b66d4f4f..dc03381fd 100644 --- a/Xml/lib/g.php +++ b/Xml/lib/g.php @@ -1,6 +1,4 @@ Date: Mon, 23 Sep 2024 23:08:54 +0100 Subject: [PATCH 308/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{transform => }/prettify.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{transform => }/prettify.php (100%) diff --git a/Xml/lib/transform/prettify.php b/Xml/lib/prettify.php similarity index 100% rename from Xml/lib/transform/prettify.php rename to Xml/lib/prettify.php From d9dfffb003299d72608b897d60bf5950e620236e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:11:03 +0100 Subject: [PATCH 309/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/atts.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Xml/lib/atts.php b/Xml/lib/atts.php index 6461e205b..7e78844ce 100644 --- a/Xml/lib/atts.php +++ b/Xml/lib/atts.php @@ -3,7 +3,6 @@ /** * 2024-09-23 https://www.php.net/manual/en/simplexmlelement.attributes.php - * @used-by \Df\Xml\A::isText() * @used-by \Df\Xml\A::p() * @return array(string => string) */ From f0d2ea012860ca9ab589b141c0f60c6a32809b2e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:12:14 +0100 Subject: [PATCH 310/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/atts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/atts.php b/Xml/lib/atts.php index 7e78844ce..58d559acb 100644 --- a/Xml/lib/atts.php +++ b/Xml/lib/atts.php @@ -7,5 +7,5 @@ * @return array(string => string) */ function df_xml_atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_r( - df_map($aa, function(?X $v):?string {return !$v ? null : (string)$v;}) + df_map($aa, function(?X $v):string {return !$v ? '' : (string)$v;}) );} \ No newline at end of file From 1252ff5d322da873368d63f940ef40b1d27822e9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:14:35 +0100 Subject: [PATCH 311/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/atts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/atts.php b/Xml/lib/atts.php index 58d559acb..7ff824ef4 100644 --- a/Xml/lib/atts.php +++ b/Xml/lib/atts.php @@ -7,5 +7,5 @@ * @return array(string => string) */ function df_xml_atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_r( - df_map($aa, function(?X $v):string {return !$v ? '' : (string)$v;}) + df_map($aa, function(?X $v):string {return (string)$v;}) );} \ No newline at end of file From 23ec5e68353bdde558422ac7a3216f403e2183c9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:14:48 +0100 Subject: [PATCH 312/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/atts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/atts.php b/Xml/lib/atts.php index 7ff824ef4..96b0f58ac 100644 --- a/Xml/lib/atts.php +++ b/Xml/lib/atts.php @@ -7,5 +7,5 @@ * @return array(string => string) */ function df_xml_atts(X $x):array {/** @var ?X $aa */ return !($aa = $x->attributes()) ? [] : df_clean_r( - df_map($aa, function(?X $v):string {return (string)$v;}) + df_map($aa, function(?X $v):string {return strval($v);}) );} \ No newline at end of file From efd530e3da9011590db40d5f5a7bc86c209bdc0b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:20:31 +0100 Subject: [PATCH 313/717] https://github.com/mage2pro/core/issues/437 --- Core/Text/Marker.php | 2 +- Core/lib/cache/dfcf.php | 1 + Xml/G.php | 18 ++---------------- Xml/lib/cdata.php | 7 +++++++ 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Core/Text/Marker.php b/Core/Text/Marker.php index 922606dc7..758668221 100644 --- a/Core/Text/Marker.php +++ b/Core/Text/Marker.php @@ -4,7 +4,7 @@ final class Marker { /** * 2021-12-12 - * @used-by \Df\Xml\G::marker() + * @used-by df_cdata_m() */ function __construct(string $begin, string $end) {$this->_begin = $begin; $this->_end = $end;} diff --git a/Core/lib/cache/dfcf.php b/Core/lib/cache/dfcf.php index 5b5b86a70..b0a9f93d8 100644 --- a/Core/lib/cache/dfcf.php +++ b/Core/lib/cache/dfcf.php @@ -29,6 +29,7 @@ * @used-by df_are_customers_global() * @used-by df_cache_get_simple() * @used-by df_category_children_map() + * @used-by df_cdata_m() * @used-by df_cli_user() * @used-by df_con_s() * @used-by df_core_version() diff --git a/Xml/G.php b/Xml/G.php index 1a6c4b329..29da51587 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -1,7 +1,6 @@ mark($s);} - /** * 2024-09-22 * @used-by self::i() @@ -289,8 +282,8 @@ private function importString(string $k, $v, $wrapInCData = []):void { * Обратите внимание, что нам нужно выполнить проверку на синтаксис df_cdata ([[]]) * даже при $needWrapInCData = true, потому что маркеры [[ и ]] из данных надо удалять. */ - if (self::marker()->marked($vAsString)) { - $vAsString = self::marker()->unmark($vAsString); + if (df_cdata_m()->marked($vAsString)) { + $vAsString = df_cdata_m()->unmark($vAsString); $needWrapInCData = true; } $needWrapInCData = $needWrapInCData || in_array($kAsString, $wrapInCData) || df_needs_cdata($vAsString); @@ -335,11 +328,4 @@ private function k(string $s):string {return !df_contains($s, ':') ? $s : "xmlns * @var X */ private $_x; - - /** - * 2021-12-12 - * @used-by self::importString() - * @used-by self::markAsCData() - */ - private static function marker():Marker {static $r; return $r ?: $r = new Marker('[[', ']]');} } \ No newline at end of file diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 7cec0c87f..5e934be3b 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -1,4 +1,5 @@ Date: Mon, 23 Sep 2024 23:22:27 +0100 Subject: [PATCH 314/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/cdata.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index 5e934be3b..cbc4b3f12 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -7,10 +7,11 @@ * @used-by df_clean_xml() * @used-by \Dfe\SecurePay\Refund::process() */ -function df_cdata(string $s):string {return G::markAsCData($s);} +function df_cdata(string $s):string {return df_cdata_m()->mark($s);} /** * 2024-09-24 + * @used-by df_cdata() * @used-by \Df\Xml\G::importString() */ function df_cdata_m():M {return dfcf(function():M {return new M('[[', ']]');});} From 1260e44f98a285e429f214ec3fa5a7578b2cd7ce Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:23:30 +0100 Subject: [PATCH 315/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/cdata.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Xml/lib/cdata.php b/Xml/lib/cdata.php index cbc4b3f12..8ee3ee436 100644 --- a/Xml/lib/cdata.php +++ b/Xml/lib/cdata.php @@ -1,6 +1,5 @@ Date: Mon, 23 Sep 2024 23:24:27 +0100 Subject: [PATCH 316/717] https://github.com/mage2pro/core/issues/437 --- Backend/Block/Widget/Grid/Column/Renderer/Text.php | 2 +- Core/lib/text/starts-ends.php | 2 +- Xml/lib/check.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Backend/Block/Widget/Grid/Column/Renderer/Text.php b/Backend/Block/Widget/Grid/Column/Renderer/Text.php index 46655f2a4..f04091e8c 100644 --- a/Backend/Block/Widget/Grid/Column/Renderer/Text.php +++ b/Backend/Block/Widget/Grid/Column/Renderer/Text.php @@ -58,6 +58,6 @@ function render(_DO $row):string { # 2017-01-13 # Результат должен быть строкой, потому что он используется в шаблоне *.phtml с оператором echo: # https://github.com/magento/magento2/blob/2.1.3/app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml#L194 - return df_result_s(df_check_json_complex($v) || df_check_xml($v) ? df_tag('pre', [], $v) : $v); + return df_result_s(df_check_json_complex($v) || df_is_xml($v) ? df_tag('pre', [], $v) : $v); } } \ No newline at end of file diff --git a/Core/lib/text/starts-ends.php b/Core/lib/text/starts-ends.php index 9b087ca06..755647389 100644 --- a/Core/lib/text/starts-ends.php +++ b/Core/lib/text/starts-ends.php @@ -47,7 +47,7 @@ function df_ends_with(string $haystack, $n):bool {return is_array($n) * @used-by df_cc_path() * @used-by df_check_https() * @used-by df_check_json_complex() - * @used-by df_check_xml() + * @used-by df_is_xml() * @used-by df_handle_prefix() * @used-by df_is_url_absolute() * @used-by df_log_l() diff --git a/Xml/lib/check.php b/Xml/lib/check.php index 9efb54c3e..a553ba0bf 100644 --- a/Xml/lib/check.php +++ b/Xml/lib/check.php @@ -8,4 +8,4 @@ * @used-by \Df\Backend\Block\Widget\Grid\Column\Renderer\Text::render() * @param mixed $v */ -function df_check_xml($v):bool {return is_string($v) && df_starts_with($v, ' Date: Mon, 23 Sep 2024 23:25:40 +0100 Subject: [PATCH 317/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/child.php | 4 ++-- Xml/lib/{check.php => is.php} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename Xml/lib/{check.php => is.php} (100%) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 88fdee18e..59a87a270 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -6,8 +6,8 @@ * @deprecated It is unused. * @throws E */ -function df_xml_child(X $e, string $name, bool $req = false):?X { /** @var ?X $r */ - $childNodes = df_xml_children($e, $name, $req); /** @var X[] $childNodes */ +function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ + $childNodes = df_xml_children($x, $name, $req); /** @var X[] $childNodes */ if (is_null($childNodes)) { $r = null; } diff --git a/Xml/lib/check.php b/Xml/lib/is.php similarity index 100% rename from Xml/lib/check.php rename to Xml/lib/is.php From e1357598b82595a966c0da227ec85da4b97a0517 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:28:05 +0100 Subject: [PATCH 318/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/child.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 59a87a270..deb6eb55f 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -33,6 +33,7 @@ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r } /** + * 2024-09-24 @deprecated It is unused. * @used-by df_xml_child() * @throws E */ From 3294f03059c946c2ba0f5d2b9b46efa79d9c6035 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:29:36 +0100 Subject: [PATCH 319/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/child.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index deb6eb55f..7e6d7bebf 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -7,8 +7,8 @@ * @throws E */ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ - $childNodes = df_xml_children($x, $name, $req); /** @var X[] $childNodes */ - if (is_null($childNodes)) { + $cc = df_xml_children($x, $name, $req); /** @var ?X $cc */ + if (is_null($cc)) { $r = null; } else { From d03f6e695a9d71082d199f349f65cde14dcfa833 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:29:50 +0100 Subject: [PATCH 320/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/child.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 7e6d7bebf..82e8a2521 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -26,8 +26,8 @@ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r * http://stackoverflow.com/a/16100099 * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. */ - df_assert_eq(1, count($childNodes)); - $r = df_ar($childNodes[0], X::class); + df_assert_eq(1, count($cc)); + $r = df_ar($cc[0], X::class); } return $r; } From 031b965834165760dae0f9fe21554f7a585d12ed Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:31:33 +0100 Subject: [PATCH 321/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/child.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Xml/lib/child.php b/Xml/lib/child.php index 82e8a2521..766f15d4f 100644 --- a/Xml/lib/child.php +++ b/Xml/lib/child.php @@ -7,11 +7,7 @@ * @throws E */ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ - $cc = df_xml_children($x, $name, $req); /** @var ?X $cc */ - if (is_null($cc)) { - $r = null; - } - else { + if ($r = df_xml_children($x, $name, $req)) { /** * Обратите внимание, что если мы имеем структуру: * @@ -26,8 +22,8 @@ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r * http://stackoverflow.com/a/16100099 * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. */ - df_assert_eq(1, count($cc)); - $r = df_ar($cc[0], X::class); + df_assert_eq(1, count($r)); + $r = df_ar($r[0], X::class); } return $r; } From 83ebaaa1012de3574f09f4ef900abebc6832b377 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:32:41 +0100 Subject: [PATCH 322/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{ => deprecated}/child.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{ => deprecated}/child.php (100%) diff --git a/Xml/lib/child.php b/Xml/lib/deprecated/child.php similarity index 100% rename from Xml/lib/child.php rename to Xml/lib/deprecated/child.php From 035b724cf2dcd01edf202ed37aad451e904e8094 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:33:02 +0100 Subject: [PATCH 323/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/exists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index 8aacbe696..29a8d811d 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -31,7 +31,7 @@ * * @used-by df_xml_is_leaf() */ -function df_xml_exists(?X $e = null):bool {return !empty($e);} +function df_xml_exists(?X $x = null):bool {return !empty($x);} /** * http://stackoverflow.com/questions/1560827#comment20135428_1562158 From 3372fe75da1c8f7e7f29cd4df048a41fb8a5881e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:39:39 +0100 Subject: [PATCH 324/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/exists.php | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index 29a8d811d..f52ad3302 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -3,32 +3,25 @@ /** * 2015-02-27 - * Алгоритм взят отсюда: http://stackoverflow.com/a/5344560 - * Проверил, что он работает: http://3v4l.org/tnEIJ - * Обратите внимание, что isset() вместо empty() не сработает: http://3v4l.org/2P5o0 - * isset, однако, работает для проверки наличия дочерних листов: @see df_xml_exists_child() - * - * Обратите внимание, что оператор $e->{'тест'} всегда возвращает объект @see \SimpleXMLElement, - * вне зависимости от наличия узла «тест», просто для отсутствующего узла данный объект будет пуст, - * и empty() для него вернёт true. - * + * 1) Алгоритм взят отсюда: http://stackoverflow.com/a/5344560 + * 2) Проверил, что он работает: http://3v4l.org/tnEIJ + * 3) isset() вместо empty() не сработает: http://3v4l.org/2P5o0 + * 4) isset, однако, работает для проверки наличия дочерних листов: @see df_xml_exists_child() + * 5) Оператор $e->{'тест'} всегда возвращает объект @see \SimpleXMLElement, вне зависимости от наличия узла «тест», + * просто для отсутствующего узла данный объект будет пуст, и empty() для него вернёт true. * 2015-08-04 - * Заметил, что empty($e) для текстовых узлов всегда возвращает true, - * даже если узел как строка приводится к true (например: «147»). - * Например: - * Например: - * <Остаток> - * <Склад> - * <Ид>6f87e83f-722c-11df-b336-0011955cba6b - * <Количество>147 - * - * - * Если здесь сделать xpath Остаток/Склад/Количество, - * то для узла «147» @see df_xml_exists($e) вернёт false. - * - * Обратите внимание, что эту особенность использует алгоритм @see df_xml_is_leaf(): - * return !df_xml_exists($e) || !count($e->children()); - * + * Заметил, что empty($e) для текстовых узлов всегда возвращает `true`, + * даже если узел как строка приводится к `true` (например: «147»). Например: + * <Остаток> + * <Склад> + * <Ид>6f87e83f-722c-11df-b336-0011955cba6b + * <Количество>147 + * + * + * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_exists($e) вернёт `false`. + * 6) Эту особенность использует алгоритм @see df_xml_is_leaf(): + * return !df_xml_exists($e) || !count($e->children()); + * * @used-by df_xml_is_leaf() */ function df_xml_exists(?X $x = null):bool {return !empty($x);} From 4047bb913e0d9f333788bcda57e42da11de630ae Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:41:18 +0100 Subject: [PATCH 325/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/exists.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index f52ad3302..b15a1522b 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -21,7 +21,11 @@ * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_exists($e) вернёт `false`. * 6) Эту особенность использует алгоритм @see df_xml_is_leaf(): * return !df_xml_exists($e) || !count($e->children()); - * + * 2024-09-24 + * 1) «When converting to `bool`, the following values are considered `false`: + * *) Internal objects that overload their casting behaviour to `bool`. + * For example: `SimpleXML` objects created from empty elements without attributes.» + * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting * @used-by df_xml_is_leaf() */ function df_xml_exists(?X $x = null):bool {return !empty($x);} From 9803ae26453aac2777e4c6a15ef7cd30f5f46812 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:42:13 +0100 Subject: [PATCH 326/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/exists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index b15a1522b..d2b367edf 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -28,7 +28,7 @@ * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting * @used-by df_xml_is_leaf() */ -function df_xml_exists(?X $x = null):bool {return !empty($x);} +function df_xml_exists(?X $x):bool {return !empty($x);} /** * http://stackoverflow.com/questions/1560827#comment20135428_1562158 From 521beba2539d317c9ba4163f0715405fde7774a9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:44:41 +0100 Subject: [PATCH 327/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{exists.php => empty.php} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename Xml/lib/{exists.php => empty.php} (90%) diff --git a/Xml/lib/exists.php b/Xml/lib/empty.php similarity index 90% rename from Xml/lib/exists.php rename to Xml/lib/empty.php index d2b367edf..732e39c39 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/empty.php @@ -22,7 +22,9 @@ * 6) Эту особенность использует алгоритм @see df_xml_is_leaf(): * return !df_xml_exists($e) || !count($e->children()); * 2024-09-24 - * 1) «When converting to `bool`, the following values are considered `false`: + * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» + * https://www.php.net/manual/en/function.empty.php + * 2) «When converting to `bool`, the following values are considered `false`: * *) Internal objects that overload their casting behaviour to `bool`. * For example: `SimpleXML` objects created from empty elements without attributes.» * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting From 88ece9fc8535b117bb9c5fcf80b58c0c50d360a5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:45:28 +0100 Subject: [PATCH 328/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/deprecated/child.php | 2 +- Xml/lib/empty.php | 10 +++++----- Xml/lib/leaf/get/.php | 6 +++--- Xml/lib/leaf/is.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Xml/lib/deprecated/child.php b/Xml/lib/deprecated/child.php index 766f15d4f..8aee0ddf7 100644 --- a/Xml/lib/deprecated/child.php +++ b/Xml/lib/deprecated/child.php @@ -35,7 +35,7 @@ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ function df_xml_children(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ df_param_sne($name, 0); - if (df_xml_exists_child($x, $name)) { + if (df_xml_empty_child($x, $name)) { /** * Обратите внимание, что если мы имеем структуру: * diff --git a/Xml/lib/empty.php b/Xml/lib/empty.php index 732e39c39..91876b3e7 100644 --- a/Xml/lib/empty.php +++ b/Xml/lib/empty.php @@ -6,7 +6,7 @@ * 1) Алгоритм взят отсюда: http://stackoverflow.com/a/5344560 * 2) Проверил, что он работает: http://3v4l.org/tnEIJ * 3) isset() вместо empty() не сработает: http://3v4l.org/2P5o0 - * 4) isset, однако, работает для проверки наличия дочерних листов: @see df_xml_exists_child() + * 4) isset, однако, работает для проверки наличия дочерних листов: @see df_xml_empty_child() * 5) Оператор $e->{'тест'} всегда возвращает объект @see \SimpleXMLElement, вне зависимости от наличия узла «тест», * просто для отсутствующего узла данный объект будет пуст, и empty() для него вернёт true. * 2015-08-04 @@ -18,9 +18,9 @@ * <Количество>147 * * - * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_exists($e) вернёт `false`. + * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_empty($e) вернёт `false`. * 6) Эту особенность использует алгоритм @see df_xml_is_leaf(): - * return !df_xml_exists($e) || !count($e->children()); + * return !df_xml_empty($e) || !count($e->children()); * 2024-09-24 * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» * https://www.php.net/manual/en/function.empty.php @@ -30,10 +30,10 @@ * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting * @used-by df_xml_is_leaf() */ -function df_xml_exists(?X $x):bool {return !empty($x);} +function df_xml_empty(?X $x):bool {return !empty($x);} /** * http://stackoverflow.com/questions/1560827#comment20135428_1562158 * @used-by df_xml_children() */ -function df_xml_exists_child(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file +function df_xml_empty_child(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 0987cb962..21b328e37 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -58,12 +58,12 @@ function df_leaf(?CX $e = null, $d = null):?string {/** @var ?string $r */ * потому что для концевых текстовых узлов с ненулевым целым значением (например: «147») * такое выражение довольно-таки неожиданно возвращает true. * @see \SimpleXMLElement вообще необычный класс с нестандартным поведением. - * Чтобы понять, почему в данном случае !$e равно true, посморите функцию @see df_xml_exists() + * Чтобы понять, почему в данном случае !$e равно true, посморите функцию @see df_xml_empty() * - * Так вот, @see df_xml_exists() для текстового узла всегда возвращает false, + * Так вот, @see df_xml_empty() для текстового узла всегда возвращает false, * даже если текстовое значение не приводится к false (то же «147»). * - * Почему так происходит — видно из реализации @see df_xml_exists(): !empty($e) + * Почему так происходит — видно из реализации @see df_xml_empty(): !empty($e) * То есть, empty($e) для текстовых узлов возвращает true. * * Например: diff --git a/Xml/lib/leaf/is.php b/Xml/lib/leaf/is.php index dac254b19..e9e2e0620 100644 --- a/Xml/lib/leaf/is.php +++ b/Xml/lib/leaf/is.php @@ -28,4 +28,4 @@ * @see \SimpleXMLElement — самый загадочный класс PHP. * @used-by df_xml_assert_leaf() */ -function df_xml_is_leaf(X $x):bool {return !df_xml_exists($x) || !$x->children()->count();} \ No newline at end of file +function df_xml_is_leaf(X $x):bool {return !df_xml_empty($x) || !$x->children()->count();} \ No newline at end of file From 9fa14d7a8e0b0b2624eaff67e75447d524387567 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:46:21 +0100 Subject: [PATCH 329/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/deprecated/child.php | 2 +- Xml/lib/empty.php | 10 +++++----- Xml/lib/leaf/get/.php | 6 +++--- Xml/lib/leaf/is.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Xml/lib/deprecated/child.php b/Xml/lib/deprecated/child.php index 8aee0ddf7..766f15d4f 100644 --- a/Xml/lib/deprecated/child.php +++ b/Xml/lib/deprecated/child.php @@ -35,7 +35,7 @@ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ function df_xml_children(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ df_param_sne($name, 0); - if (df_xml_empty_child($x, $name)) { + if (df_xml_exists_child($x, $name)) { /** * Обратите внимание, что если мы имеем структуру: * diff --git a/Xml/lib/empty.php b/Xml/lib/empty.php index 91876b3e7..732e39c39 100644 --- a/Xml/lib/empty.php +++ b/Xml/lib/empty.php @@ -6,7 +6,7 @@ * 1) Алгоритм взят отсюда: http://stackoverflow.com/a/5344560 * 2) Проверил, что он работает: http://3v4l.org/tnEIJ * 3) isset() вместо empty() не сработает: http://3v4l.org/2P5o0 - * 4) isset, однако, работает для проверки наличия дочерних листов: @see df_xml_empty_child() + * 4) isset, однако, работает для проверки наличия дочерних листов: @see df_xml_exists_child() * 5) Оператор $e->{'тест'} всегда возвращает объект @see \SimpleXMLElement, вне зависимости от наличия узла «тест», * просто для отсутствующего узла данный объект будет пуст, и empty() для него вернёт true. * 2015-08-04 @@ -18,9 +18,9 @@ * <Количество>147 * * - * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_empty($e) вернёт `false`. + * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_exists($e) вернёт `false`. * 6) Эту особенность использует алгоритм @see df_xml_is_leaf(): - * return !df_xml_empty($e) || !count($e->children()); + * return !df_xml_exists($e) || !count($e->children()); * 2024-09-24 * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» * https://www.php.net/manual/en/function.empty.php @@ -30,10 +30,10 @@ * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting * @used-by df_xml_is_leaf() */ -function df_xml_empty(?X $x):bool {return !empty($x);} +function df_xml_exists(?X $x):bool {return !empty($x);} /** * http://stackoverflow.com/questions/1560827#comment20135428_1562158 * @used-by df_xml_children() */ -function df_xml_empty_child(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file +function df_xml_exists_child(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 21b328e37..0987cb962 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -58,12 +58,12 @@ function df_leaf(?CX $e = null, $d = null):?string {/** @var ?string $r */ * потому что для концевых текстовых узлов с ненулевым целым значением (например: «147») * такое выражение довольно-таки неожиданно возвращает true. * @see \SimpleXMLElement вообще необычный класс с нестандартным поведением. - * Чтобы понять, почему в данном случае !$e равно true, посморите функцию @see df_xml_empty() + * Чтобы понять, почему в данном случае !$e равно true, посморите функцию @see df_xml_exists() * - * Так вот, @see df_xml_empty() для текстового узла всегда возвращает false, + * Так вот, @see df_xml_exists() для текстового узла всегда возвращает false, * даже если текстовое значение не приводится к false (то же «147»). * - * Почему так происходит — видно из реализации @see df_xml_empty(): !empty($e) + * Почему так происходит — видно из реализации @see df_xml_exists(): !empty($e) * То есть, empty($e) для текстовых узлов возвращает true. * * Например: diff --git a/Xml/lib/leaf/is.php b/Xml/lib/leaf/is.php index e9e2e0620..dac254b19 100644 --- a/Xml/lib/leaf/is.php +++ b/Xml/lib/leaf/is.php @@ -28,4 +28,4 @@ * @see \SimpleXMLElement — самый загадочный класс PHP. * @used-by df_xml_assert_leaf() */ -function df_xml_is_leaf(X $x):bool {return !df_xml_empty($x) || !$x->children()->count();} \ No newline at end of file +function df_xml_is_leaf(X $x):bool {return !df_xml_exists($x) || !$x->children()->count();} \ No newline at end of file From ab42bf461c6822046ffee410033112035b540c4d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:48:13 +0100 Subject: [PATCH 330/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/empty.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Xml/lib/empty.php b/Xml/lib/empty.php index 732e39c39..e65080135 100644 --- a/Xml/lib/empty.php +++ b/Xml/lib/empty.php @@ -24,10 +24,12 @@ * 2024-09-24 * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» * https://www.php.net/manual/en/function.empty.php + * https://archive.is/8HRC5#selection-995.60-1001.5 * 2) «When converting to `bool`, the following values are considered `false`: * *) Internal objects that overload their casting behaviour to `bool`. * For example: `SimpleXML` objects created from empty elements without attributes.» * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting + * https://archive.is/FcCfj#selection-1353.0-1355.60 * @used-by df_xml_is_leaf() */ function df_xml_exists(?X $x):bool {return !empty($x);} From e060747add2b937e55801df3d4a7ff47c28177a4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:52:35 +0100 Subject: [PATCH 331/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/empty.php | 6 +++--- Xml/lib/leaf/get/.php | 12 ++++++------ Xml/lib/leaf/is.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Xml/lib/empty.php b/Xml/lib/empty.php index e65080135..39e81ebf6 100644 --- a/Xml/lib/empty.php +++ b/Xml/lib/empty.php @@ -18,9 +18,9 @@ * <Количество>147 * * - * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_exists($e) вернёт `false`. + * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_empty($e) вернёт `true`. * 6) Эту особенность использует алгоритм @see df_xml_is_leaf(): - * return !df_xml_exists($e) || !count($e->children()); + * return df_xml_empty($e) || !count($e->children()); * 2024-09-24 * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» * https://www.php.net/manual/en/function.empty.php @@ -32,7 +32,7 @@ * https://archive.is/FcCfj#selection-1353.0-1355.60 * @used-by df_xml_is_leaf() */ -function df_xml_exists(?X $x):bool {return !empty($x);} +function df_xml_empty(?X $x):bool {return empty($x);} /** * http://stackoverflow.com/questions/1560827#comment20135428_1562158 diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 0987cb962..c1a5523ab 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -56,15 +56,15 @@ function df_leaf(?CX $e = null, $d = null):?string {/** @var ?string $r */ * 2015-08-04 * Нельзя здесь использовать !$e, * потому что для концевых текстовых узлов с ненулевым целым значением (например: «147») - * такое выражение довольно-таки неожиданно возвращает true. + * такое выражение довольно-таки неожиданно возвращает `true`. * @see \SimpleXMLElement вообще необычный класс с нестандартным поведением. - * Чтобы понять, почему в данном случае !$e равно true, посморите функцию @see df_xml_exists() + * Чтобы понять, почему в данном случае !$e равно `true`, посморите функцию @see df_xml_empty() * - * Так вот, @see df_xml_exists() для текстового узла всегда возвращает false, - * даже если текстовое значение не приводится к false (то же «147»). + * Так вот, @see df_xml_empty() для текстового узла всегда возвращает `true`, + * даже если текстовое значение не приводится к `false` (то же «147»). * - * Почему так происходит — видно из реализации @see df_xml_exists(): !empty($e) - * То есть, empty($e) для текстовых узлов возвращает true. + * Почему так происходит — видно из реализации @see df_xml_empty(): empty($e) + * То есть, empty($e) для текстовых узлов возвращает `true`. * * Например: * <Остаток> diff --git a/Xml/lib/leaf/is.php b/Xml/lib/leaf/is.php index dac254b19..feabbf4e4 100644 --- a/Xml/lib/leaf/is.php +++ b/Xml/lib/leaf/is.php @@ -28,4 +28,4 @@ * @see \SimpleXMLElement — самый загадочный класс PHP. * @used-by df_xml_assert_leaf() */ -function df_xml_is_leaf(X $x):bool {return !df_xml_exists($x) || !$x->children()->count();} \ No newline at end of file +function df_xml_is_leaf(X $x):bool {return df_xml_empty($x) || !$x->children()->count();} \ No newline at end of file From c747fc8966d00837614b0b39d9864cf73745cd43 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 23 Sep 2024 23:56:35 +0100 Subject: [PATCH 332/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Xml/A.php b/Xml/A.php index 6c4a97af8..3e2e5e74d 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -21,6 +21,11 @@ static function p($x) { } } elseif (!$r) { + /** + * 2024-09-24 + * $x is a node without attributes and children. + * @see df_xml_empty() + */ $r = (string)$x; } else { From e1d838e8844238c259e10e97cf77a2da9e5a6ae0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:01:18 +0100 Subject: [PATCH 333/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 31 ++++++++++++++----------------- Xml/lib/empty.php | 1 + 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Xml/A.php b/Xml/A.php index 3e2e5e74d..00ad9e3d7 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -10,26 +10,23 @@ final class A { * @return string|array(string => mixed) */ static function p($x) { - $x = df_xml_x($x); - $r = []; - if ($aa = df_xml_atts($x)) { /** @var array(string => string) $aa */ - $r['@'] = $aa; - } - if ($x->hasChildren()) { - foreach ($x->children() as $k => $c) {/** @var X $c */ - $r[$k] = self::p($c); - } - } - elseif (!$r) { - /** - * 2024-09-24 - * $x is a node without attributes and children. - * @see df_xml_empty() - */ + if (df_xml_empty($x = df_xml_x($x))) { + # 2024-09-24 $x is a node without attributes and children. E.g: a text node. $r = (string)$x; } else { - $r[0] = (string)$x; + $r = []; + if ($aa = df_xml_atts($x)) { /** @var array(string => string) $aa */ + $r['@'] = $aa; + } + if (!$x->hasChildren()) { + $r[0] = (string)$x; + } + else { + foreach ($x->children() as $k => $c) {/** @var X $c */ + $r[$k] = self::p($c); + } + } } return $r; } diff --git a/Xml/lib/empty.php b/Xml/lib/empty.php index 39e81ebf6..391f7a200 100644 --- a/Xml/lib/empty.php +++ b/Xml/lib/empty.php @@ -31,6 +31,7 @@ * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting * https://archive.is/FcCfj#selection-1353.0-1355.60 * @used-by df_xml_is_leaf() + * @used-by \Df\Xml\A::p() */ function df_xml_empty(?X $x):bool {return empty($x);} From 581ac19f29c411cdcc8ecef2818807fa702e00a8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:11:16 +0100 Subject: [PATCH 334/717] refactoring --- Core/lib/array/other/af.php | 1 + Xml/A.php | 18 +++++------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Core/lib/array/other/af.php b/Core/lib/array/other/af.php index d02976119..6b8ce8964 100644 --- a/Core/lib/array/other/af.php +++ b/Core/lib/array/other/af.php @@ -19,6 +19,7 @@ function dfaf($a, $b):array { # 2.1) `is_callable([__CLASS__, 'f'])` for a private `f` is allowed: https://3v4l.org/ctZJG # 2.2) `array_map([__CLASS__, 'f'], [1, 2, 3])` for a private `f` is allowed too: https://3v4l.org/29Zim # 2024-06-11 "Improve `dfaf()`": https://github.com/mage2pro/core/issues/421 + # 2024-09-24 `is_callable(__METHOD__)` returns `true`: https://3v4l.org/KVX07 $assert = function(bool $cond, string $m) use($a, $b):void {df_assert($cond, "dfaf(): $m.", ['a' => $a, 'b' => $b]);}; /** @var bool $ca */ /** @var bool $cb *//** @var bool $ia */ /** @var bool $ib */ [$ca, $cb, $ia, $ib] = [is_callable($a), is_callable($b), is_iterable($a), is_iterable($b)]; diff --git a/Xml/A.php b/Xml/A.php index 00ad9e3d7..6134a0df4 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -9,24 +9,16 @@ final class A { * @param X|string $x * @return string|array(string => mixed) */ - static function p($x) { + static function p($x) {/** @var string|array(string => mixed) $r */ if (df_xml_empty($x = df_xml_x($x))) { # 2024-09-24 $x is a node without attributes and children. E.g: a text node. $r = (string)$x; } else { - $r = []; - if ($aa = df_xml_atts($x)) { /** @var array(string => string) $aa */ - $r['@'] = $aa; - } - if (!$x->hasChildren()) { - $r[0] = (string)$x; - } - else { - foreach ($x->children() as $k => $c) {/** @var X $c */ - $r[$k] = self::p($c); - } - } + $r = + (!($aa = df_xml_atts($x)) ? [] : ['@' => $aa]) + + (!$x->hasChildren() ? [0 => (string)$x] : df_map(__METHOD__, $x->children())) + ; } return $r; } From c78421da0775cacd0dd5f91c7a47d64b6d37cec8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:18:08 +0100 Subject: [PATCH 335/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/array/map/.php | 1 + Xml/A.php | 18 +++++------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Core/lib/array/map/.php b/Core/lib/array/map/.php index f9a31e512..98d03e249 100644 --- a/Core/lib/array/map/.php +++ b/Core/lib/array/map/.php @@ -37,6 +37,7 @@ * @used-by \CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) * @used-by \CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order::afterCanInvoice() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/256) * @used-by \Df\Payment\ConfigProvider\GlobalT::icons() + * @used-by \Df\Xml\A::p() * @used-by \Dfe\Color\Image::probabilities() * @used-by \Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() * @used-by \Dfe\Sift\Payload\OQI::p() diff --git a/Xml/A.php b/Xml/A.php index 6134a0df4..92a8ba017 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -6,20 +6,12 @@ final class A { /** * 2024-09-23 * @used-by df_xml2a() + * @used-by self::p() * @param X|string $x * @return string|array(string => mixed) */ - static function p($x) {/** @var string|array(string => mixed) $r */ - if (df_xml_empty($x = df_xml_x($x))) { - # 2024-09-24 $x is a node without attributes and children. E.g: a text node. - $r = (string)$x; - } - else { - $r = - (!($aa = df_xml_atts($x)) ? [] : ['@' => $aa]) - + (!$x->hasChildren() ? [0 => (string)$x] : df_map(__METHOD__, $x->children())) - ; - } - return $r; - } + static function p($x) {return df_xml_empty($x = df_xml_x($x)) ? (string)$x : + (!($aa = df_xml_atts($x)) ? [] : ['@' => $aa]) + + (!$x->hasChildren() ? [0 => (string)$x] : df_map(__METHOD__, $x->children())) + ;} } \ No newline at end of file From 600c1a69266e074350dd0c228ad5eed868f4cd30 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:51:33 +0100 Subject: [PATCH 336/717] https://github.com/mage2pro/core/issues/437 --- Xml/A.php | 25 +++++++++++++++++++++---- Xml/lib/empty.php | 6 +++++- Xml/lib/leaf/is.php | 16 +++++++++++++++- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/Xml/A.php b/Xml/A.php index 92a8ba017..52870d00e 100644 --- a/Xml/A.php +++ b/Xml/A.php @@ -10,8 +10,25 @@ final class A { * @param X|string $x * @return string|array(string => mixed) */ - static function p($x) {return df_xml_empty($x = df_xml_x($x)) ? (string)$x : - (!($aa = df_xml_atts($x)) ? [] : ['@' => $aa]) - + (!$x->hasChildren() ? [0 => (string)$x] : df_map(__METHOD__, $x->children())) - ;} + static function p($x) { + $aa = df_xml_atts($x = df_xml_x($x)); /** @var array(string => string) $aa */ + $cc = !$x->hasChildren() ? [] : df_map(__METHOD__, $x->children()); /** @var array(string => mixed) $cc */ + # 2024-09-24 + # 1.1) We can not use `empty($x)` instead of `!$aa && !$cc`. + # 1.2) «A variable is considered empty if it does not exist or if its value equals `false`.» + # https://www.php.net/manual/en/function.empty.php + # https://archive.is/8HRC5#selection-995.60-1001.5 + # 1.2) The official PHP documentation contains a wrong statement: + # «When converting to `bool`, the following values are considered `false`: + # *) Internal objects that overload their casting behaviour to `bool`. + # For example: `SimpleXML` objects created from empty elements without attributes.» + # https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting + # https://archive.is/FcCfj#selection-1353.0-1355.60 + # 1.3) Even if a node has attributes, but does not have a content, `empty($x)` returns `true` for it: + # 1.3.1) https://3v4l.org/h7hRH + # 1.3.2) https://3v4l.org/YM3I8 + # 1.3.3) https://3v4l.org/2vaHf + # 1.3.4) https://stackoverflow.com/questions/1560827#comment74422321_5344560 + return !$aa && !$cc ? (string)$x : ((!$aa ? [] : ['@' => $aa]) + ($cc ?: [0 => (string)$x])); + } } \ No newline at end of file diff --git a/Xml/lib/empty.php b/Xml/lib/empty.php index 391f7a200..a93a34557 100644 --- a/Xml/lib/empty.php +++ b/Xml/lib/empty.php @@ -30,7 +30,11 @@ * For example: `SimpleXML` objects created from empty elements without attributes.» * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting * https://archive.is/FcCfj#selection-1353.0-1355.60 - * @used-by df_xml_is_leaf() + * 3) Even if a node has attributes, but does not have a content, `empty($x)` returns `true` for it: + * 3.1) https://3v4l.org/h7hRH + * 3.2) https://3v4l.org/YM3I8 + * 3.3) https://3v4l.org/2vaHf + * 3.4) https://stackoverflow.com/questions/1560827#comment74422321_5344560 * @used-by \Df\Xml\A::p() */ function df_xml_empty(?X $x):bool {return empty($x);} diff --git a/Xml/lib/leaf/is.php b/Xml/lib/leaf/is.php index feabbf4e4..cf3b0812e 100644 --- a/Xml/lib/leaf/is.php +++ b/Xml/lib/leaf/is.php @@ -26,6 +26,20 @@ * https://php.net/manual/simplexmlelement.count.php * Однако @uses count() почему-то работает для него. * @see \SimpleXMLElement — самый загадочный класс PHP. + * 2024-09-24 + * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» + * https://www.php.net/manual/en/function.empty.php + * https://archive.is/8HRC5#selection-995.60-1001.5 + * 2) «When converting to `bool`, the following values are considered `false`: + * *) Internal objects that overload their casting behaviour to `bool`. + * For example: `SimpleXML` objects created from empty elements without attributes.» + * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting + * https://archive.is/FcCfj#selection-1353.0-1355.60 + * 3) Even if a node has attributes, but does not have a content, `empty($x)` returns `true` for it: + * 3.1) https://3v4l.org/h7hRH + * 3.2) https://3v4l.org/YM3I8 + * 3.3) https://3v4l.org/2vaHf + * 3.4) https://stackoverflow.com/questions/1560827#comment74422321_5344560 * @used-by df_xml_assert_leaf() */ -function df_xml_is_leaf(X $x):bool {return df_xml_empty($x) || !$x->children()->count();} \ No newline at end of file +function df_xml_is_leaf(X $x):bool {return empty($x) || !$x->children()->count();} \ No newline at end of file From d0a742734eb69e617648320d585ae8b65472e7dd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:52:41 +0100 Subject: [PATCH 337/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/empty.php | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/Xml/lib/empty.php b/Xml/lib/empty.php index a93a34557..239361fb0 100644 --- a/Xml/lib/empty.php +++ b/Xml/lib/empty.php @@ -1,44 +1,6 @@ {'тест'} всегда возвращает объект @see \SimpleXMLElement, вне зависимости от наличия узла «тест», - * просто для отсутствующего узла данный объект будет пуст, и empty() для него вернёт true. - * 2015-08-04 - * Заметил, что empty($e) для текстовых узлов всегда возвращает `true`, - * даже если узел как строка приводится к `true` (например: «147»). Например: - * <Остаток> - * <Склад> - * <Ид>6f87e83f-722c-11df-b336-0011955cba6b - * <Количество>147 - * - * - * Если здесь сделать xpath `Остаток/Склад/Количество`, то для узла «147» @see df_xml_empty($e) вернёт `true`. - * 6) Эту особенность использует алгоритм @see df_xml_is_leaf(): - * return df_xml_empty($e) || !count($e->children()); - * 2024-09-24 - * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» - * https://www.php.net/manual/en/function.empty.php - * https://archive.is/8HRC5#selection-995.60-1001.5 - * 2) «When converting to `bool`, the following values are considered `false`: - * *) Internal objects that overload their casting behaviour to `bool`. - * For example: `SimpleXML` objects created from empty elements without attributes.» - * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting - * https://archive.is/FcCfj#selection-1353.0-1355.60 - * 3) Even if a node has attributes, but does not have a content, `empty($x)` returns `true` for it: - * 3.1) https://3v4l.org/h7hRH - * 3.2) https://3v4l.org/YM3I8 - * 3.3) https://3v4l.org/2vaHf - * 3.4) https://stackoverflow.com/questions/1560827#comment74422321_5344560 - * @used-by \Df\Xml\A::p() - */ -function df_xml_empty(?X $x):bool {return empty($x);} - /** * http://stackoverflow.com/questions/1560827#comment20135428_1562158 * @used-by df_xml_children() From 12bf1670b06e6afd23a2a91c23bfdc4bde733eb9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:53:27 +0100 Subject: [PATCH 338/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{empty.php => exists.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{empty.php => exists.php} (100%) diff --git a/Xml/lib/empty.php b/Xml/lib/exists.php similarity index 100% rename from Xml/lib/empty.php rename to Xml/lib/exists.php From 9be5a15c33c19eeedb004eada5d70f7ff1991d18 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:54:34 +0100 Subject: [PATCH 339/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/deprecated/child.php | 2 +- Xml/lib/exists.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/deprecated/child.php b/Xml/lib/deprecated/child.php index 766f15d4f..0b71e2fe3 100644 --- a/Xml/lib/deprecated/child.php +++ b/Xml/lib/deprecated/child.php @@ -35,7 +35,7 @@ function df_xml_child(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ function df_xml_children(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ df_param_sne($name, 0); - if (df_xml_exists_child($x, $name)) { + if (df_xml_exists($x, $name)) { /** * Обратите внимание, что если мы имеем структуру: * diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index 239361fb0..64802d127 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -5,4 +5,4 @@ * http://stackoverflow.com/questions/1560827#comment20135428_1562158 * @used-by df_xml_children() */ -function df_xml_exists_child(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file +function df_xml_exists(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file From fe8cd7740524818a684e739f81fd61b484c97634 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:56:16 +0100 Subject: [PATCH 340/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/exists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php index 64802d127..297cce343 100644 --- a/Xml/lib/exists.php +++ b/Xml/lib/exists.php @@ -5,4 +5,4 @@ * http://stackoverflow.com/questions/1560827#comment20135428_1562158 * @used-by df_xml_children() */ -function df_xml_exists(X $e, string $child):bool {return isset($e->{$child});} \ No newline at end of file +function df_xml_exists(X $x, string $child):bool {return isset($x->{$child});} \ No newline at end of file From 08d24ca0f5ebd0956534817000d20e53fa9b9473 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 00:58:49 +0100 Subject: [PATCH 341/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/x.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xml/lib/x.php b/Xml/lib/x.php index df7bafda2..58cd497e7 100644 --- a/Xml/lib/x.php +++ b/Xml/lib/x.php @@ -20,8 +20,8 @@ * @throws E */ function df_xml_x($x, $onE = true):X {return $x instanceof X ? $x : df_try( - function() use($x) {return new X(df_assert_sne($x, 0));} - , true !== $onE ? $onE : function(T $t) use($x):E {return df_error_create( + function() use($x):X {return new X(df_assert_sne($x, 0));} + ,true !== $onE ? $onE : function(T $t) use($x):E {return df_error_create( "Failed to parse XML: «%s».\nXML:\n%s", df_xts($t), df_trim($x) );} );} \ No newline at end of file From 197b0ff7b6e9c2b534c521d39c94860f0d39f74c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 01:00:43 +0100 Subject: [PATCH 342/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/g/s/header.php | 8 -------- Xml/lib/{parsing => }/header.php | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 Xml/lib/g/s/header.php rename Xml/lib/{parsing => }/header.php (56%) diff --git a/Xml/lib/g/s/header.php b/Xml/lib/g/s/header.php deleted file mode 100644 index 01e7b2e16..000000000 --- a/Xml/lib/g/s/header.php +++ /dev/null @@ -1,8 +0,0 @@ -";} \ No newline at end of file diff --git a/Xml/lib/parsing/header.php b/Xml/lib/header.php similarity index 56% rename from Xml/lib/parsing/header.php rename to Xml/lib/header.php index 6d00ee083..cc0e6eee9 100644 --- a/Xml/lib/parsing/header.php +++ b/Xml/lib/header.php @@ -1,6 +1,14 @@ ";} + /** * 2016-09-01 * Если XML не отформатирован, то после его заголовка перенос строки идти не обязан: http://stackoverflow.com/a/8384602 From 0baa9f1196576b428c07d66b0c00dbd3983780ba Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 01:01:26 +0100 Subject: [PATCH 343/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/{deprecated => }/child.php | 0 Xml/lib/{g/s/.php => s.php} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Xml/lib/{deprecated => }/child.php (100%) rename Xml/lib/{g/s/.php => s.php} (100%) diff --git a/Xml/lib/deprecated/child.php b/Xml/lib/child.php similarity index 100% rename from Xml/lib/deprecated/child.php rename to Xml/lib/child.php diff --git a/Xml/lib/g/s/.php b/Xml/lib/s.php similarity index 100% rename from Xml/lib/g/s/.php rename to Xml/lib/s.php From 9ec516eb508f96521f4cc18a383493c7a9a45cf3 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 01:04:28 +0100 Subject: [PATCH 344/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/leaf/get/.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index c1a5523ab..c287653a2 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -1,5 +1,5 @@
` or ``) - $r = df_if1(empty($e), $d, ''); + $r = df_if1(empty($x), $d, ''); } return $r; } \ No newline at end of file From e59673f716ff64e5c1b6dc69dd2a4c65f0bcfadc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 01:06:18 +0100 Subject: [PATCH 345/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/leaf/get/.php | 2 +- Xml/lib/leaf/get/b.php | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 Xml/lib/leaf/get/b.php diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index c287653a2..eeed96ef1 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -83,7 +83,7 @@ function df_leaf(?X $x, $d = null):?string {/** @var ?string $r */ } elseif (df_es($r = (string)df_xml_assert_leaf($x))) { # 2015-09-25 - # `empty($e)` returns: + # `empty($x)` returns: # `true` for an absent node # `false` for an empty node (`` or ``) $r = df_if1(empty($x), $d, ''); diff --git a/Xml/lib/leaf/get/b.php b/Xml/lib/leaf/get/b.php deleted file mode 100644 index 23d8866b2..000000000 --- a/Xml/lib/leaf/get/b.php +++ /dev/null @@ -1,8 +0,0 @@ - Date: Tue, 24 Sep 2024 01:07:01 +0100 Subject: [PATCH 346/717] https://github.com/mage2pro/core/issues/437 --- Qa/lib/validation/assert/float.php | 1 - Xml/lib/leaf/get/.php | 2 -- Xml/lib/leaf/get/f.php | 7 ------- 3 files changed, 10 deletions(-) delete mode 100644 Xml/lib/leaf/get/f.php diff --git a/Qa/lib/validation/assert/float.php b/Qa/lib/validation/assert/float.php index b1be13ed3..f4f83553e 100644 --- a/Qa/lib/validation/assert/float.php +++ b/Qa/lib/validation/assert/float.php @@ -4,7 +4,6 @@ /** * @used-by df_float_positive() - * @used-by df_leaf_f() * @used-by dff_chop0() * @used-by dfp_last2() * @used-by \Dfe\CurrencyConvert\Ecb::_convert() diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index eeed96ef1..048c50fe7 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -44,9 +44,7 @@ * без дополнительных проверок, имеется ли в наличии запрашиваемый лист дерева XML * (если лист отсутствует, то @see df_config_node() вернёт null) * - * @used-by df_leaf_b() * @used-by df_leaf_child() - * @used-by df_leaf_f() * @used-by df_leaf_i() * @used-by df_leaf_s() * @param string|null|callable $d [optional] diff --git a/Xml/lib/leaf/get/f.php b/Xml/lib/leaf/get/f.php deleted file mode 100644 index 81948e94e..000000000 --- a/Xml/lib/leaf/get/f.php +++ /dev/null @@ -1,7 +0,0 @@ - Date: Tue, 24 Sep 2024 01:10:48 +0100 Subject: [PATCH 347/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/empty.php | 1 - Qa/lib/validation/error.php | 1 - Xml/lib/leaf/get/.php | 1 - Xml/lib/leaf/get/i.php | 8 -------- Xml/lib/leaf/get/s.php | 12 ------------ 5 files changed, 23 deletions(-) delete mode 100644 Xml/lib/leaf/get/i.php diff --git a/Core/lib/empty.php b/Core/lib/empty.php index 5ae7e945c..6543cf42e 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -5,7 +5,6 @@ * @used-by df_block_output() * @used-by df_desc() * @used-by df_leaf() - * @used-by df_leaf_sne() * @used-by df_n_prepend() * @used-by df_param_sne() * @used-by df_path_is_internal() diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index 847817372..5bae56ca0 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -65,7 +65,6 @@ function df_abstract($caller):void { * @used-by df_int() * @used-by df_invoice_by_trans() * @used-by df_json_decode() - * @used-by df_leaf_sne() * @used-by df_load() * @used-by df_mail_shipment() * @used-by df_module_file() diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 048c50fe7..6e5c7a52a 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -45,7 +45,6 @@ * (если лист отсутствует, то @see df_config_node() вернёт null) * * @used-by df_leaf_child() - * @used-by df_leaf_i() * @used-by df_leaf_s() * @param string|null|callable $d [optional] */ diff --git a/Xml/lib/leaf/get/i.php b/Xml/lib/leaf/get/i.php deleted file mode 100644 index 1d417a9fa..000000000 --- a/Xml/lib/leaf/get/i.php +++ /dev/null @@ -1,8 +0,0 @@ - Date: Tue, 24 Sep 2024 01:12:11 +0100 Subject: [PATCH 348/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/leaf/get/.php | 1 - Xml/lib/leaf/get/s.php | 8 -------- 2 files changed, 9 deletions(-) delete mode 100644 Xml/lib/leaf/get/s.php diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 6e5c7a52a..0d3116222 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -45,7 +45,6 @@ * (если лист отсутствует, то @see df_config_node() вернёт null) * * @used-by df_leaf_child() - * @used-by df_leaf_s() * @param string|null|callable $d [optional] */ function df_leaf(?X $x, $d = null):?string {/** @var ?string $r */ diff --git a/Xml/lib/leaf/get/s.php b/Xml/lib/leaf/get/s.php deleted file mode 100644 index 76c68e8ca..000000000 --- a/Xml/lib/leaf/get/s.php +++ /dev/null @@ -1,8 +0,0 @@ - Date: Tue, 24 Sep 2024 01:13:02 +0100 Subject: [PATCH 349/717] https://github.com/mage2pro/core/issues/437 --- Xml/lib/leaf/get/.php | 1 - Xml/lib/leaf/get/child.php | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 Xml/lib/leaf/get/child.php diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php index 0d3116222..a2f5cfa8c 100644 --- a/Xml/lib/leaf/get/.php +++ b/Xml/lib/leaf/get/.php @@ -44,7 +44,6 @@ * без дополнительных проверок, имеется ли в наличии запрашиваемый лист дерева XML * (если лист отсутствует, то @see df_config_node() вернёт null) * - * @used-by df_leaf_child() * @param string|null|callable $d [optional] */ function df_leaf(?X $x, $d = null):?string {/** @var ?string $r */ diff --git a/Xml/lib/leaf/get/child.php b/Xml/lib/leaf/get/child.php deleted file mode 100644 index acc3e7512..000000000 --- a/Xml/lib/leaf/get/child.php +++ /dev/null @@ -1,9 +0,0 @@ -{$child}, $d);} \ No newline at end of file From 23324b4257a2307adfe436b92bca6e778b982506 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 01:13:49 +0100 Subject: [PATCH 350/717] https://github.com/mage2pro/core/issues/437 --- Core/lib/empty.php | 1 - Core/lib/lang/call/if.php | 1 - Core/lib/lang/if.php | 1 - Xml/lib/leaf/assert.php | 1 - Xml/lib/leaf/get/.php | 87 --------------------------------------- 5 files changed, 91 deletions(-) delete mode 100644 Xml/lib/leaf/get/.php diff --git a/Core/lib/empty.php b/Core/lib/empty.php index 6543cf42e..b9cc3b20b 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -4,7 +4,6 @@ * @used-by df_assert_sne() * @used-by df_block_output() * @used-by df_desc() - * @used-by df_leaf() * @used-by df_n_prepend() * @used-by df_param_sne() * @used-by df_path_is_internal() diff --git a/Core/lib/lang/call/if.php b/Core/lib/lang/call/if.php index b9c1050e9..ed940c3f6 100644 --- a/Core/lib/lang/call/if.php +++ b/Core/lib/lang/call/if.php @@ -9,7 +9,6 @@ * @used-by df_if() * @used-by df_if1() * @used-by df_if2() - * @used-by df_leaf() * @used-by dfa() * @param mixed|callable $v * @param mixed ...$a [optional] diff --git a/Core/lib/lang/if.php b/Core/lib/lang/if.php index 46b3dfa44..a56183b17 100644 --- a/Core/lib/lang/if.php +++ b/Core/lib/lang/if.php @@ -10,7 +10,6 @@ function df_if(bool $cond, $onTrue, $onFalse = null) {return $cond ? df_call_if( /** * 2016-02-09 Осуществляет ленивое ветвление только для первой ветки. - * @used-by df_leaf() * @used-by df_request() * @param mixed|callable $onTrue * @param mixed|null $onFalse [optional] diff --git a/Xml/lib/leaf/assert.php b/Xml/lib/leaf/assert.php index 177d556e0..137c73fea 100644 --- a/Xml/lib/leaf/assert.php +++ b/Xml/lib/leaf/assert.php @@ -3,7 +3,6 @@ use SimpleXMLElement as X; /** - * @used-by df_leaf() * @throws E */ function df_xml_assert_leaf(X $x):X {return df_xml_is_leaf($x) ? $x : df_error( diff --git a/Xml/lib/leaf/get/.php b/Xml/lib/leaf/get/.php deleted file mode 100644 index a2f5cfa8c..000000000 --- a/Xml/lib/leaf/get/.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * - * - * aaa - * 1 - * - * - * bbb - * 2 - * - * - * - * Здесь для $e1 = $xml->{'product'}->{'cms'}->{'class'} - * мы можем использовать $e1->__toString() и (string)$e1. - * http://3v4l.org/rAq3F - * Однако для $e2 = $xml->{'product'}->{'cms'} - * мы не можем использовать $e2->__toString() и (string)$e2, - * потому что узел «cms» не является концевым узлом (листом дерева XML). - * http://3v4l.org/Pkj37 - * Более того, метод @see \SimpleXMLElement::__toString() - * отсутствует в PHP версий 5.2.17 и ниже: - * http://3v4l.org/Wiia2#v500 - * - * 2015-03-02 - * Обратите внимание, - * то мы специально допускаем возможность для первого параметра $e принимать значение null: - * это даёт нам возможность писать код типа: - * @used-by Df_Page_Helper_Head::needSkipAsStandardCss() - * df_leaf_b(df_config_node( - * 'df/page/skip_standard_css/', df_state()->getController()->getFullActionName() - * )) - * без дополнительных проверок, имеется ли в наличии запрашиваемый лист дерева XML - * (если лист отсутствует, то @see df_config_node() вернёт null) - * - * @param string|null|callable $d [optional] - */ -function df_leaf(?X $x, $d = null):?string {/** @var ?string $r */ - /** - * 2015-08-04 - * Нельзя здесь использовать !$e, - * потому что для концевых текстовых узлов с ненулевым целым значением (например: «147») - * такое выражение довольно-таки неожиданно возвращает `true`. - * @see \SimpleXMLElement вообще необычный класс с нестандартным поведением. - * Чтобы понять, почему в данном случае !$e равно `true`, посморите функцию @see df_xml_empty() - * - * Так вот, @see df_xml_empty() для текстового узла всегда возвращает `true`, - * даже если текстовое значение не приводится к `false` (то же «147»). - * - * Почему так происходит — видно из реализации @see df_xml_empty(): empty($e) - * То есть, empty($e) для текстовых узлов возвращает `true`. - * - * Например: - * <Остаток> - * <Склад> - * <Ид>6f87e83f-722c-11df-b336-0011955cba6b - * <Количество>147 - * - * - * Если здесь сделать xpath Остаток/Склад/Количество, - * то для узла «147» !$e почему-то вернёт true, - * хотя в данном случае $e является полноценным объектом @see \SimpleXMLElement - * и (string)$e возвращает «147». - */ - if (is_null($x)) { - $r = df_call_if($d); - } - elseif (df_es($r = (string)df_xml_assert_leaf($x))) { - # 2015-09-25 - # `empty($x)` returns: - # `true` for an absent node - # `false` for an empty node (`` or ``) - $r = df_if1(empty($x), $d, ''); - } - return $r; -} \ No newline at end of file From 60b48d7cddb87800cf09ae22381aedc232be0b31 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 01:16:57 +0100 Subject: [PATCH 351/717] https://github.com/mage2pro/core/issues/437 --- Qa/lib/validation/assert/class.php | 1 - Qa/lib/validation/error.php | 2 - Qa/lib/validation/param.php | 1 - Xml/lib/child.php | 62 ------------------------------ Xml/lib/exists.php | 8 ---- Xml/lib/leaf/assert.php | 10 ----- Xml/lib/leaf/is.php | 45 ---------------------- 7 files changed, 129 deletions(-) delete mode 100644 Xml/lib/child.php delete mode 100644 Xml/lib/exists.php delete mode 100644 Xml/lib/leaf/assert.php delete mode 100644 Xml/lib/leaf/is.php diff --git a/Qa/lib/validation/assert/class.php b/Qa/lib/validation/assert/class.php index 92e6ef529..d5ca17134 100644 --- a/Qa/lib/validation/assert/class.php +++ b/Qa/lib/validation/assert/class.php @@ -10,7 +10,6 @@ * @used-by df_load() * @used-by df_newa() * @used-by df_trans() - * @used-by df_xml_child() * @used-by dfpex_args() * @used-by \Df\Payment\Choice::f() * @used-by \Df\Payment\Operation\Source\Creditmemo::cm() diff --git a/Qa/lib/validation/error.php b/Qa/lib/validation/error.php index 5bae56ca0..d8bab97c5 100644 --- a/Qa/lib/validation/error.php +++ b/Qa/lib/validation/error.php @@ -42,7 +42,6 @@ function df_abstract($caller):void { * @used-by df_assert_https() * @used-by df_assert_in() * @used-by df_assert_le() - * @used-by df_xml_assert_leaf() * @used-by df_assert_lt() * @used-by df_assert_ne() * @used-by df_assert_nef() @@ -87,7 +86,6 @@ function df_abstract($caller):void { * @used-by df_sprintf_strict() * @used-by df_subscriber() * @used-by df_try() - * @used-by df_xml_children() * @used-by df_xml_x() * @used-by dfa_assert_keys() * @used-by dfaf() diff --git a/Qa/lib/validation/param.php b/Qa/lib/validation/param.php index 73a384ef4..a93982378 100644 --- a/Qa/lib/validation/param.php +++ b/Qa/lib/validation/param.php @@ -14,7 +14,6 @@ function df_param_iso2(string $v, int $ord, int $sl = 0):string {return Q::asser * @used-by df_date_from_db() * @used-by df_eav_update() * @used-by df_fs_delete() - * @used-by df_xml_children() * @used-by dfa_deep() * @used-by dfa_deep_unset() * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() diff --git a/Xml/lib/child.php b/Xml/lib/child.php deleted file mode 100644 index 0b71e2fe3..000000000 --- a/Xml/lib/child.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * - * - * - * то $this->e()->{'rule'} вернёт не массив, а объект (!), - * но при этом @see count() для этого объекта работает как для массива (!), - * то есть реально возвращает количество детей типа rule. - * Далее, оператор [] также работает, как для массива (!) - * http://stackoverflow.com/a/16100099 - * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. - */ - df_assert_eq(1, count($r)); - $r = df_ar($r[0], X::class); - } - return $r; -} - -/** - * 2024-09-24 @deprecated It is unused. - * @used-by df_xml_child() - * @throws E - */ -function df_xml_children(X $x, string $name, bool $req = false):?X { /** @var ?X $r */ - df_param_sne($name, 0); - if (df_xml_exists($x, $name)) { - /** - * Обратите внимание, что если мы имеем структуру: - * - * - * - * - * - * то $e->{'rule'} вернёт не массив, а объект (!), - * но при этом @see count() для этого объекта работает как для массива (!), - * то есть реально возвращает количество детей типа rule. - * Далее, оператор [] также работает, как для массива (!) - * http://stackoverflow.com/a/16100099 - * Класс @see \SimpleXMLElement — вообще один из самых необычных классов PHP. - */ - $r = $x->{$name}; - } - elseif (!$req) { - $r = null; - } - else { - df_error("The required node «{$name}» is absent in the XML document:\n{xml}", ['{xml}' => df_xml_s($x)]); - } - return $r; -} \ No newline at end of file diff --git a/Xml/lib/exists.php b/Xml/lib/exists.php deleted file mode 100644 index 297cce343..000000000 --- a/Xml/lib/exists.php +++ /dev/null @@ -1,8 +0,0 @@ -{$child});} \ No newline at end of file diff --git a/Xml/lib/leaf/assert.php b/Xml/lib/leaf/assert.php deleted file mode 100644 index 137c73fea..000000000 --- a/Xml/lib/leaf/assert.php +++ /dev/null @@ -1,10 +0,0 @@ -children())` некорректно возвращает 1 для листов в PHP 5.1: http://3v4l.org/PT6Pt - * Однако нам не нужно поддерживать PHP 5.1. - * 3) Для несуществующего узла попытка вызова @uses count() приведёт к сбою: «Warning: count(): Node no longer exists» - * http://3v4l.org/PsIPe#v512 - * 4) Текущий алгоритм проверен на работоспособность здесь: http://3v4l.org/VldTN - * 2015-08-15 - * Нельзя здесь использовать `count($e->children())`, - * потому что класс @see SimpleXmlElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * 2015-08-16 - * 1) Как ни странно, написанное выше действительно верно: http://3v4l.org/covo1 - * 2) Класс @see \SimpleXMLElement не реализует интерфейс @see Iterator, - * а реализует только интерфейс @see Traversable. - * https://php.net/manual/class.iterator.php - * https://php.net/manual/class.traversable.php - * https://php.net/manual/simplexmlelement.count.php - * Однако @uses count() почему-то работает для него. - * @see \SimpleXMLElement — самый загадочный класс PHP. - * 2024-09-24 - * 1) «A variable is considered empty if it does not exist or if its value equals `false`.» - * https://www.php.net/manual/en/function.empty.php - * https://archive.is/8HRC5#selection-995.60-1001.5 - * 2) «When converting to `bool`, the following values are considered `false`: - * *) Internal objects that overload their casting behaviour to `bool`. - * For example: `SimpleXML` objects created from empty elements without attributes.» - * https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting - * https://archive.is/FcCfj#selection-1353.0-1355.60 - * 3) Even if a node has attributes, but does not have a content, `empty($x)` returns `true` for it: - * 3.1) https://3v4l.org/h7hRH - * 3.2) https://3v4l.org/YM3I8 - * 3.3) https://3v4l.org/2vaHf - * 3.4) https://stackoverflow.com/questions/1560827#comment74422321_5344560 - * @used-by df_xml_assert_leaf() - */ -function df_xml_is_leaf(X $x):bool {return empty($x) || !$x->children()->count();} \ No newline at end of file From 58ddc5df9cba22012758f1be5c7484835b61f6b2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 01:20:21 +0100 Subject: [PATCH 352/717] https://github.com/mage2pro/core/issues/437 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7006827c2..ed0246a8b 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/core" - ,"version": "11.4.1" + ,"version": "11.4.2" ,"description": "Mage2.PRO core package." ,"type": "magento2-module" ,"homepage": "https://mage2.pro" From 58187410077f95087fc9cd55c922c35ba7b12d57 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 09:08:46 +0100 Subject: [PATCH 353/717] https://github.com/mage2pro/core/issues/437 --- Xml/G.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Xml/G.php b/Xml/G.php index 29da51587..2966aa4ca 100644 --- a/Xml/G.php +++ b/Xml/G.php @@ -58,7 +58,7 @@ private function addAttribute(string $k, string $v = '', string $ns = ''):void { private function addAttributes(array $aa):void { foreach ($aa as $k => $v) {/** @var string $k */ /** @var mixed $v */ $this->addAttribute(df_assert_sne($k), df_assert_stringable( - $v, sprintf("The attribute «{$k}» has a non-`Strinable` type %s.", df_type($v)), ['attributes' => $aa] + $v, sprintf("The attribute «{$k}» has a non-`Stringable` type %s.", df_type($v)), ['attributes' => $aa] )); } } From 31303583544423bd58d9df2f50a27569728b82c1 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 09:30:22 +0100 Subject: [PATCH 354/717] refactoring --- Qa/lib/log/main.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Qa/lib/log/main.php b/Qa/lib/log/main.php index 9da4fb677..fe7d6b0dd 100644 --- a/Qa/lib/log/main.php +++ b/Qa/lib/log/main.php @@ -26,7 +26,6 @@ * @used-by \Dfe\GoogleFont\Fonts\Sprite::datumPoints() * @used-by \Dfe\GoogleFont\Fonts\Sprite::draw() * @used-by \Dfe\Sift\Controller\Index\Index::execute() - * * @used-by \Dfe\Sift\Observer::f() * @param _DO|mixed[]|mixed|T $v * @param string|object|null $m [optional] From 3ee0e9c8acc1f0479b158631eda1887926c7b7fa Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 09:35:37 +0100 Subject: [PATCH 355/717] refactoring --- Qa/lib/validation/assert/float.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Qa/lib/validation/assert/float.php b/Qa/lib/validation/assert/float.php index f4f83553e..3c2638057 100644 --- a/Qa/lib/validation/assert/float.php +++ b/Qa/lib/validation/assert/float.php @@ -88,4 +88,4 @@ function df_float_positive($v, bool $allow0 = false, bool $throw = true) {/** @v * @param mixed $v * @throws DFE */ -function df_float_positive0($v):float {return df_float_positive($v, $allow0 = true);} \ No newline at end of file +function df_float_positive0($v):float {return df_float_positive($v, true);} \ No newline at end of file From 62651a882d6baa1b2a51a4dc4983d63784507381 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 09:38:22 +0100 Subject: [PATCH 356/717] refactoring --- Qa/lib/validation/assert/{main.php => .php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Qa/lib/validation/assert/{main.php => .php} (100%) diff --git a/Qa/lib/validation/assert/main.php b/Qa/lib/validation/assert/.php similarity index 100% rename from Qa/lib/validation/assert/main.php rename to Qa/lib/validation/assert/.php From 2ff2581c7482bd7d25f600065ebd074bbaaf1d33 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:07:16 +0100 Subject: [PATCH 357/717] https://github.com/mage2pro/core/issues/440 --- API/lib/google.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/API/lib/google.php b/API/lib/google.php index 14ea38104..2a68cb0c8 100644 --- a/API/lib/google.php +++ b/API/lib/google.php @@ -11,10 +11,10 @@ * A service account uses an OAuth 2.0 flow that does not require human authorization. * Instead, it uses a key file that only your application can access.» * https://developers.google.com/shopping-content/guides/how-tos/service-accounts - * @used-by \Dfe\Color\Image::__construct() - * @used-by \TFC\Image\Command\C1::p() - * @used-by \TFC\Image\Command\C2::p() - * @used-by \TFC\Image\Command\C3::p() + * @used-by Dfe\Color\Image::__construct() + * @used-by TFC\Image\Command\C1::p() + * @used-by TFC\Image\Command\C2::p() + * @used-by TFC\Image\Command\C3::p() */ function df_google_init_service_account():void {dfcf(function() {putenv( # 2019-08-21 From 17aa857d2bee8ecf329920231612eb3514b96575 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:07:48 +0100 Subject: [PATCH 358/717] https://github.com/mage2pro/core/issues/440 --- API/lib/main.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/API/lib/main.php b/API/lib/main.php index 68bb4191d..fe301bdaf 100644 --- a/API/lib/main.php +++ b/API/lib/main.php @@ -2,9 +2,9 @@ /** * 2017-07-10 * @used-by df_api_rr_failed() - * @used-by \Df\API\Client::p() - * @used-by \Df\OAuth\App::validateResponse() - * @used-by \Df\OAuth\FE\Button::getCommentText() + * @used-by Df\API\Client::p() + * @used-by Df\OAuth\App::validateResponse() + * @used-by Df\OAuth\FE\Button::getCommentText() * @param string|object $m */ function df_api_name($m):string {return is_string($m) && !df_contains($m, '\\', '_', '::') ? $m : @@ -13,11 +13,11 @@ function df_api_name($m):string {return is_string($m) && !df_contains($m, '\\', /** * 2017-07-10 - * @used-by \Dfe\CheckoutCom\Exception::message() - * @used-by \Dfe\Klarna\Exception::message() - * @used-by \Dfe\Omise\Exception\Charge::message() - * @used-by \Dfe\Stripe\Exception::message() - * @used-by \Dfe\TwoCheckout\Exception::message() + * @used-by Dfe\CheckoutCom\Exception::message() + * @used-by Dfe\Klarna\Exception::message() + * @used-by Dfe\Omise\Exception\Charge::message() + * @used-by Dfe\Stripe\Exception::message() + * @used-by Dfe\TwoCheckout\Exception::message() * @param string|object $m * @param mixed $res * @param mixed $req [optional] From eb22cdbb2ebfce8878bbaf66a3801ff7ca1af911 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:08:10 +0100 Subject: [PATCH 359/717] https://github.com/mage2pro/core/issues/440 --- Backend/lib/main.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Backend/lib/main.php b/Backend/lib/main.php index a1ed2317d..a205a01fa 100644 --- a/Backend/lib/main.php +++ b/Backend/lib/main.php @@ -7,7 +7,7 @@ /** * 2016-01-07 - * @used-by \Dfe\GoogleBackendLogin\Plugin\Backend\App\AbstractAction::beforeDispatch() + * @used-by Dfe\GoogleBackendLogin\Plugin\Backend\App\AbstractAction::beforeDispatch() */ function df_backend_auth():Auth {return df_o(Auth::class);} @@ -25,7 +25,7 @@ function df_backend_session():SessionB {return df_o(SessionB::class);} * Если мы не в административной части, то df_backend_session()->getUser() просто вернёт null. * @used-by df_is_backend() * @used-by df_sentry_m() - * @used-by \MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) + * @used-by MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) * @return User|null */ function df_backend_user() {return @@ -39,7 +39,7 @@ function df_backend_user() {return /** * 2020-02-11 - * @used-by \Dfe\Sift\Session::get() + * @used-by Dfe\Sift\Session::get() * @return SessionC|DfSessionC|SessionB */ function df_session() {return df_is_backend() ? df_backend_session() : df_customer_session();} \ No newline at end of file From e5cb23dcd182adb4e3fafc308616001e8e6cea7d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:08:29 +0100 Subject: [PATCH 360/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/category/collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/category/collection.php b/Catalog/lib/category/collection.php index 3534484cb..6b6dfaa8a 100644 --- a/Catalog/lib/category/collection.php +++ b/Catalog/lib/category/collection.php @@ -35,7 +35,7 @@ function df_category_children($c, $a = '*'):CC {return /** * 2021-11-30 - * @used-by \TFC\GoogleShopping\Att\Brand::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/8) + * @used-by TFC\GoogleShopping\Att\Brand::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/8) * @param C|int $c * @return array(int => string) */ From 27b2a520bdf2fa059a93f21f5c946e9d224e3775 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:08:43 +0100 Subject: [PATCH 361/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/category/data-provider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/category/data-provider.php b/Catalog/lib/category/data-provider.php index 887acc5b0..d8d47eba6 100644 --- a/Catalog/lib/category/data-provider.php +++ b/Catalog/lib/category/data-provider.php @@ -8,7 +8,7 @@ * 3.1) https://github.com/magento/magento2/blob/2.4.7/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml#L38-L43 * 3.2) @see \Magento\Catalog\Model\Category\DataProvider::__construct() * 3.3) https://github.com/mage2pro/core/issues/390 - * @used-by \CabinetsBay\Catalog\Plugin\Category\DataProvider::afterPrepareMeta() (https://github.com/cabinetsbay/site/issues/98) + * @used-by CabinetsBay\Catalog\Plugin\Category\DataProvider::afterPrepareMeta() (https://github.com/cabinetsbay/site/issues/98) * @param array(string => mixed) $r * @param string[] $atts */ From 97c80e881c16b171cb31239adea446f01f30dda7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:08:59 +0100 Subject: [PATCH 362/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/category/get.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Catalog/lib/category/get.php b/Catalog/lib/category/get.php index 5fbad1bf6..ccdfbd7b1 100644 --- a/Catalog/lib/category/get.php +++ b/Catalog/lib/category/get.php @@ -8,10 +8,10 @@ * @used-by df_category_ancestor_at_level() * @used-by df_category_children() * @used-by df_category_children_map() - * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() - * @used-by \Wolf\Filter\Block\Navigation::selectedPath() - * @used-by \Wolf\Filter\Controller\Index\Change::execute() - * @used-by \CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/site/issues/98) + * @used-by CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/site/issues/98) + * @used-by Wolf\Filter\Block\Navigation::hDropdowns() + * @used-by Wolf\Filter\Block\Navigation::selectedPath() + * @used-by Wolf\Filter\Controller\Index\Change::execute() * @param int|string|C $c * @param int|string|null|bool|IStore $s [optional] */ From c782e356b54522e9e99bbd40487a959288934966 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:09:10 +0100 Subject: [PATCH 363/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/category/hierarchy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Catalog/lib/category/hierarchy.php b/Catalog/lib/category/hierarchy.php index 7abac3c3c..9fc5bcf7f 100644 --- a/Catalog/lib/category/hierarchy.php +++ b/Catalog/lib/category/hierarchy.php @@ -5,7 +5,7 @@ * 2024-03-10 * "The result of `Magento\Catalog\Model\Category::getParentCategories()` always includes the caller": * https://mage2.pro/t/6429 - * @used-by \CabinetsBay\Catalog\B\Category::l3() (https://github.com/cabinetsbay/site/issues/98) + * @used-by CabinetsBay\Catalog\B\Category::l3() (https://github.com/cabinetsbay/site/issues/98) * @return C|null */ function df_category_ancestor_at_level(C $c, int $l) {return $l > ($l2 = df_category_level($c)) ? null : ( @@ -19,8 +19,8 @@ function df_category_ancestor_at_level(C $c, int $l) {return $l > ($l2 = df_cate * 2.2) Level 1: «Default Category» (undeletable, can be renamed). * @used-by cb_category_is_l2() (https://github.com/cabinetsbay/site/issues/98) * @used-by df_category_ancestor_at_level() - * @used-by \CabinetsBay\Catalog\Observer\LayoutLoadBefore::execute() (https://github.com/cabinetsbay/catalog/issues/3) - * @used-by \CabinetsBay\Catalog\B\Category::level() (https://github.com/cabinetsbay/site/issues/98) + * @used-by CabinetsBay\Catalog\Observer\LayoutLoadBefore::execute() (https://github.com/cabinetsbay/catalog/issues/3) + * @used-by CabinetsBay\Catalog\B\Category::level() (https://github.com/cabinetsbay/site/issues/98) * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/products.phtml (https://github.com/cabinetsbay/site/issues/98) */ function df_category_level(?C $c = null):int {return (int)($c ?: df_category_current())->getLevel();} \ No newline at end of file From 6d96cc88128bb6be85598f84ca1321fd5fd429b8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:09:32 +0100 Subject: [PATCH 364/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/category/names.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/category/names.php b/Catalog/lib/category/names.php index b9fb26975..b7f5f360b 100644 --- a/Catalog/lib/category/names.php +++ b/Catalog/lib/category/names.php @@ -7,7 +7,7 @@ /** * 2020-02-05 * @see df_store_names() - * @used-by \Dfe\Sift\Payload\OQI::p() + * @used-by Dfe\Sift\Payload\OQI::p() * @param int|string|P|OI|QI $p * @param int|string|null|bool|IStore $s [optional] * @return string[] From d79cb905c6cbc671acdb10172ef91e686ad05bba Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:11:03 +0100 Subject: [PATCH 365/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/attribute/changed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/product/attribute/changed.php b/Catalog/lib/product/attribute/changed.php index 5eb450eb4..150e334f1 100644 --- a/Catalog/lib/product/attribute/changed.php +++ b/Catalog/lib/product/attribute/changed.php @@ -3,6 +3,6 @@ /** * 2021-04-24 - * @used-by \MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) + * @used-by MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) */ function df_product_att_changed(P $p, string $k):bool {return $p->getStoreId() ? !is_null($p[$k]) : $p->dataHasChangedFor($k);} \ No newline at end of file From a7e1021a491e1e223aaac26bbacb6ebee4844ca4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:11:17 +0100 Subject: [PATCH 366/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/attribute/options.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Catalog/lib/product/attribute/options.php b/Catalog/lib/product/attribute/options.php index 54593ed2f..f79095f65 100644 --- a/Catalog/lib/product/attribute/options.php +++ b/Catalog/lib/product/attribute/options.php @@ -2,7 +2,7 @@ /** * 2019-10-22 * @used-by df_product_att_options_m() - * @used-by \Dfe\Color\Image::opts() + * @used-by Dfe\Color\Image::opts() * @return array(array(string => int|string)) */ function df_product_att_options(string $c):array {return dfcf(function($c) {return @@ -11,8 +11,8 @@ function df_product_att_options(string $c):array {return dfcf(function($c) {retu /** * 2019-10-22 - * @used-by \Dfe\Color\Image::opts() - * @used-by \PPCs\Core\Plugin\Iksanika\Stockmanage\Block\Adminhtml\Product\Grid::aroundAddColumn() + * @used-by Dfe\Color\Image::opts() + * @used-by PPCs\Core\Plugin\Iksanika\Stockmanage\Block\Adminhtml\Product\Grid::aroundAddColumn() * @return array(array(string => int|string)) */ function df_product_att_options_m(string $c):array {return df_options_to_map(df_product_att_options($c));} \ No newline at end of file From 5696ce27dca1329e0557195175833d5546b28bb4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:11:25 +0100 Subject: [PATCH 367/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/attribute/sku2id.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/product/attribute/sku2id.php b/Catalog/lib/product/attribute/sku2id.php index 1888ee28e..58e2f42b5 100644 --- a/Catalog/lib/product/attribute/sku2id.php +++ b/Catalog/lib/product/attribute/sku2id.php @@ -2,6 +2,6 @@ /** * 2019-09-22 * @see df_att_code2id() - * @used-by \Dfe\Color\Observer\ProductImportBunchSaveAfter::execute() + * @used-by Dfe\Color\Observer\ProductImportBunchSaveAfter::execute() */ function df_product_sku2id(string $sku):int {return (int)df_product_res()->getIdBySku($sku);} \ No newline at end of file From 4bdd97ab33aa153a845e92c92b8530c03467db04 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:11:32 +0100 Subject: [PATCH 368/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/attribute/val.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Catalog/lib/product/attribute/val.php b/Catalog/lib/product/attribute/val.php index 0b798db82..ffbd158b9 100644 --- a/Catalog/lib/product/attribute/val.php +++ b/Catalog/lib/product/attribute/val.php @@ -7,8 +7,8 @@ * @see df_product_att_html() * @see \Magento\Catalog\Model\Product::getAttributeText() * @uses \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource::getOptionText() - * @used-by \Df\Catalog\Test\product\attribute::df_product_att_val() - * @used-by \Dfe\Sift\Payload\OQI::p() + * @used-by Df\Catalog\Test\product\attribute::df_product_att_val() + * @used-by Dfe\Sift\Payload\OQI::p() * @throws NSE */ function df_product_att_val(P $p, string $c, string $d = ''):string {return df_att_val($p, df_product_att($c), $d);} \ No newline at end of file From 4ce77f5c8ea4ce80006948383c230b273f253a3f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:12:10 +0100 Subject: [PATCH 369/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/image/o.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Catalog/lib/product/image/o.php b/Catalog/lib/product/image/o.php index 347eebc51..4072dddb7 100644 --- a/Catalog/lib/product/image/o.php +++ b/Catalog/lib/product/image/o.php @@ -10,12 +10,12 @@ * @used-by app/design/frontend/MageBig/martfury/layout01/MageBig_QuickView/templates/product/view/gallery.phtml (innomuebles.com, https://github.com/innomuebles/m2/issues/7) * @used-by app/design/frontend/MageBig/martfury/layout01/MageBig_WidgetPlus/templates/widget/layout/view/gallery.phtml (innomuebles.com, https://github.com/innomuebles/m2/issues/7) * @used-by app/design/frontend/MageBig/martfury/layout01/Magento_Catalog/templates/product/view/gallery.phtml:25 (innomuebles.com, https://github.com/innomuebles/m2/issues/7) - * @used-by \SayItWithAGift\Options\Frontend::_toHtml() + * @used-by SayItWithAGift\Options\Frontend::_toHtml() */ function df_catalog_image_h():ImageH {return df_o(ImageH::class);} /** * 2018-07-16 - * @used-by \SayItWithAGift\Options\Frontend::_toHtml() + * @used-by SayItWithAGift\Options\Frontend::_toHtml() */ function df_product_mc():MC {return df_o(MC::class);} \ No newline at end of file From 65c0abfcd01beecbf731a12b1a0099cc48fb16be Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:12:25 +0100 Subject: [PATCH 370/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/image/path.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Catalog/lib/product/image/path.php b/Catalog/lib/product/image/path.php index b2b2ecd1b..f7916fefe 100644 --- a/Catalog/lib/product/image/path.php +++ b/Catalog/lib/product/image/path.php @@ -5,7 +5,7 @@ /** * 2019-09-20 * @see df_product_image_url() - * @used-by \Dfe\Color\Observer\ProductImportBunchSaveAfter::execute() + * @used-by Dfe\Color\Observer\ProductImportBunchSaveAfter::execute() * @param array(string => string) $attrs [optional] */ function df_product_image_path(P $p, string $type = '', array $attrs = []):string {return df_media_url2path(df_product_image_url( @@ -14,17 +14,17 @@ function df_product_image_path(P $p, string $type = '', array $attrs = []):strin /** * 2019-08-21 - * @used-by \Dfe\Color\Observer\ProductSaveBefore::execute() - * @used-by \MageWorx\OptionFeatures\Helper\Data::getThumbImageUrl(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/46) - * @used-by \TFC\Core\Plugin\Catalog\Block\Product\View\GalleryOptions::afterGetOptionsJson() + * @used-by Dfe\Color\Observer\ProductSaveBefore::execute() + * @used-by MageWorx\OptionFeatures\Helper\Data::getThumbImageUrl(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/46) + * @used-by TFC\Core\Plugin\Catalog\Block\Product\View\GalleryOptions::afterGetOptionsJson() * @see df_media_path_abs() */ function df_product_image_path2abs(string $rel):string {return df_cc_path(df_product_images_path(), df_trim_ds_left($rel));} /** * 2020-10-26 - * @used-by \TFC\Image\Command\C1::image() - * @used-by \TFC\Image\Command\C1::p() + * @used-by TFC\Image\Command\C1::image() + * @used-by TFC\Image\Command\C1::p() */ function df_product_image_path2rel(string $abs):string {return df_trim_text_left($abs, df_product_images_path() . '/');} @@ -34,21 +34,21 @@ function df_product_image_path2rel(string $abs):string {return df_trim_text_left * @used-by df_product_image_path2abs() * @used-by df_product_image_path2rel() * @used-by df_product_images_path_rel() - * @used-by \TFC\Image\Command\C1::image() - * @used-by \TFC\Image\Command\C1::images() - * @used-by \TFC\Image\Command\C3::p() + * @used-by TFC\Image\Command\C1::image() + * @used-by TFC\Image\Command\C1::images() + * @used-by TFC\Image\Command\C3::p() */ function df_product_images_path():string {return df_sys_path_abs(DL::MEDIA, 'catalog/product');} /** * 2020-11-22 «pub/media/catalog/product» - * @used-by \TFC\Image\Command\C3::p() + * @used-by TFC\Image\Command\C3::p() */ function df_product_images_path_rel():string {return dfcf(function() {return df_path_rel(df_product_images_path());});} /** * 2019-08-23 - * @used-by \Dfe\Color\Observer\ProductSaveBefore::execute() + * @used-by Dfe\Color\Observer\ProductSaveBefore::execute() * @see df_media_path_abs() */ function df_product_image_tmp_path2abs(string $rel):string {return df_sys_path_abs( From f07a3e7cf52453562d796793b4e766150530975b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:12:38 +0100 Subject: [PATCH 371/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/image/url.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Catalog/lib/product/image/url.php b/Catalog/lib/product/image/url.php index 01b83eb5a..3ee135a80 100644 --- a/Catalog/lib/product/image/url.php +++ b/Catalog/lib/product/image/url.php @@ -5,7 +5,7 @@ /** * 2021-11-30 * @see df_product_image_url() - * @used-by \TFC\GoogleShopping\Att\AdditionalImageLink::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) + * @used-by TFC\GoogleShopping\Att\AdditionalImageLink::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) * @return string[] */ function df_product_images_additional(P $p, int $limit = 0):array { @@ -25,7 +25,7 @@ function df_product_images_additional(P $p, int $limit = 0):array { * @see df_product_images_additional() * @used-by df_oqi_image() * @used-by df_product_image_url() Recursion - * @used-by \TFC\GoogleShopping\Att\ImageLink::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) + * @used-by TFC\GoogleShopping\Att\ImageLink::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) * @param array(string => string) $attrs [optional] */ function df_product_image_url(P $p, string $type = '', array $attrs = []):string {/** @var string|null $r */ From 10ac89e7c318c076fd7fe59a73ea6e960720e451 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:12:45 +0100 Subject: [PATCH 372/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/product/block.php b/Catalog/lib/product/block.php index 7a08d50ba..195e704fd 100644 --- a/Catalog/lib/product/block.php +++ b/Catalog/lib/product/block.php @@ -10,6 +10,6 @@ function df_product_b():B {return df_o(B::class);} /** * 2020-10-28 - * @used-by \TFC\Core\Plugin\Catalog\Block\Product\View\GalleryOptions::afterGetOptionsJson() + * @used-by TFC\Core\Plugin\Catalog\Block\Product\View\GalleryOptions::afterGetOptionsJson() */ function df_product_gallery_b():G {return df_o(G::class);} \ No newline at end of file From 67e63f89e6ab410ed35d9c7793d39edfc2ee5d88 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:12:53 +0100 Subject: [PATCH 373/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/collection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Catalog/lib/product/collection.php b/Catalog/lib/product/collection.php index b2bca8ce1..b1b406429 100644 --- a/Catalog/lib/product/collection.php +++ b/Catalog/lib/product/collection.php @@ -9,8 +9,8 @@ * @see df_category_c() * @used-by df_product_c() * @used-by https://github.com/tradefurniturecompany/report/blob/1.0.3/view/frontend/templates/index.phtml#L17 - * @used-by \TFC\Image\Command\C3::pc() - * @used-by \TFC\Image\Command\C3::pcL() + * @used-by TFC\Image\Command\C3::pc() + * @used-by TFC\Image\Command\C3::pcL() */ function df_pc():C {return df_new_om(C::class);} @@ -92,6 +92,6 @@ function df_pc_preserve_absent_f(F $f) { * 2019-09-18 * 2020-11-23 @deprecated * @see df_category_c() - * @used-by \BlushMe\Checkout\Block\Extra::items() + * @used-by BlushMe\Checkout\Block\Extra::items() */ function df_product_c():C {return df_pc();} \ No newline at end of file From c3e0b42d3d53d6ec214fdce2898ad48ca0189218 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:13:04 +0100 Subject: [PATCH 374/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/current.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/product/current.php b/Catalog/lib/product/current.php index 5ec09c5bf..b5d1b8156 100644 --- a/Catalog/lib/product/current.php +++ b/Catalog/lib/product/current.php @@ -18,7 +18,7 @@ function df_product_current($onError = null) {return df_try(function() {return /** * 2019-11-15 - * @used-by \Dfe\Markdown\Modifier::modifyData() + * @used-by Dfe\Markdown\Modifier::modifyData() * @return int|null */ function df_product_current_id() {return !($p = df_product_current() /** @var P $p */) ? null : $p->getId();} \ No newline at end of file From 697fd5809ad94b942f4455e7282ad5be20b5f13c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:13:10 +0100 Subject: [PATCH 375/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/get.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Catalog/lib/product/get.php b/Catalog/lib/product/get.php index 5f8b5aa8e..06170c8e9 100644 --- a/Catalog/lib/product/get.php +++ b/Catalog/lib/product/get.php @@ -23,12 +23,12 @@ * @see df_product_load() * @used-by df_category_names() * @used-by ikf_product_printer() - * @used-by \Dfe\Sift\Payload\OQI::p() - * @used-by \Inkifi\Mediaclip\API\Entity\Order\Item::product() - * @used-by \Inkifi\Mediaclip\Event::product() - * @used-by \Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::pOI() - * @used-by \Inkifi\Mediaclip\T\CaseT\Product::t02() - * @used-by \Mangoit\MediaclipHub\Controller\Index\GetPriceEndpoint::execute() + * @used-by Dfe\Sift\Payload\OQI::p() + * @used-by Inkifi\Mediaclip\API\Entity\Order\Item::product() + * @used-by Inkifi\Mediaclip\Event::product() + * @used-by Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::pOI() + * @used-by Inkifi\Mediaclip\T\CaseT\Product::t02() + * @used-by Mangoit\MediaclipHub\Controller\Index\GetPriceEndpoint::execute() * @param int|string|P|OI|QI $p * @param int|string|null|bool|IStore $s [optional] * @throws NSE @@ -50,6 +50,6 @@ function df_product($p, $s = false):P {return df_is_p($p) ? $p : df_product_r()- /** * 2018-06-04 * @see df_product() - * @used-by \Frugue\Configurable\Plugin\ConfigurableProduct\Helper\Data::aroundGetOptions() + * @used-by Frugue\Configurable\Plugin\ConfigurableProduct\Helper\Data::aroundGetOptions() */ function df_product_load(int $id):P {return df_product_r()->getById($id, false, null, true);} \ No newline at end of file From 96de2e2fce5643711535c342f43734a7a55aae61 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:13:24 +0100 Subject: [PATCH 376/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/o.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Catalog/lib/product/o.php b/Catalog/lib/product/o.php index 4c7d6f7e3..ec6449c2e 100644 --- a/Catalog/lib/product/o.php +++ b/Catalog/lib/product/o.php @@ -7,13 +7,13 @@ /** * 2019-09-22 «Best way to update product's attribute value»: https://magento.stackexchange.com/a/157446 - * @used-by \Dfe\Color\Observer\ProductImportBunchSaveAfter::execute() + * @used-by Dfe\Color\Observer\ProductImportBunchSaveAfter::execute() */ function df_product_action():Action {return df_o(Action::class);} /** * 2018-06-04 - * @used-by \Frugue\Configurable\Plugin\Swatches\Block\Product\Renderer\Configurable::aroundGetAllowProducts() + * @used-by Frugue\Configurable\Plugin\Swatches\Block\Product\Renderer\Configurable::aroundGetAllowProducts() */ function df_product_h():ProductH {return df_o(ProductH::class);} @@ -22,8 +22,8 @@ function df_product_h():ProductH {return df_o(ProductH::class);} * @see df_category_r() * @used-by df_product() * @used-by df_product_load() - * @used-by \CanadaSatellite\Theme\Plugin\Model\LinkManagement::aroundSaveChild(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/44) - * @used-by \PPCs\Core\Plugin\Iksanika\Stockmanage\Controller\Adminhtml\Product\MassUpdateProducts::beforeExecute() + * @used-by CanadaSatellite\Theme\Plugin\Model\LinkManagement::aroundSaveChild(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/44) + * @used-by PPCs\Core\Plugin\Iksanika\Stockmanage\Controller\Adminhtml\Product\MassUpdateProducts::beforeExecute() * @return IProductRepository|ProductRepository */ function df_product_r() {return df_o(IProductRepository::class);} From 8adcd9ea6eae918d640ee4ffb38f0db3e3d9a8bb Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:13:31 +0100 Subject: [PATCH 377/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/price.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Catalog/lib/product/price.php b/Catalog/lib/product/price.php index e5dc372c3..e223268c3 100644 --- a/Catalog/lib/product/price.php +++ b/Catalog/lib/product/price.php @@ -14,7 +14,7 @@ function df_price_regular(P $p):float {return df_prices($p)['regular_price'];} * the current time could be not between @see \Magento\Catalog\Model\Product::getSpecialFromDate() * and @see \Magento\Catalog\Model\Product::getSpecialToDate() * `df_prices($p)['special_price']` returns `false` in this case. - * @used-by \TFC\GoogleShopping\Att\SalePrice::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/4) + * @used-by TFC\GoogleShopping\Att\SalePrice::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/4) * @return float|false */ function df_price_special(P $p) {return df_prices($p)['special_price'];} From d626424377232548e9074d51d028e05a11edfbc7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:13:38 +0100 Subject: [PATCH 378/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/tangible.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Catalog/lib/product/tangible.php b/Catalog/lib/product/tangible.php index 89e06fac5..44e4d3d3d 100644 --- a/Catalog/lib/product/tangible.php +++ b/Catalog/lib/product/tangible.php @@ -17,9 +17,9 @@ * df_oqi_roots(df_assert_oq($v)), function($i) {return df_tangible($i->getProduct());} * ) * https://github.com/mage2pro/core/blob/7.5.2/Catalog/lib/product/tangible.php#L10-L17 - * @used-by \Amasty\Checkout\Model\QuoteManagement::saveInsertedInfo() - * @used-by \Dfe\Frontend\ConfigSource\Visibility\Product\VD::needHideFor() - * @used-by \Dfe\TwoCheckout\LineItem\Product::tangible() + * @used-by Amasty\Checkout\Model\QuoteManagement::saveInsertedInfo() + * @used-by Dfe\Frontend\ConfigSource\Visibility\Product\VD::needHideFor() + * @used-by Dfe\TwoCheckout\LineItem\Product::tangible() * @used-by app/code/Interactivated/Quotecheckout/view/frontend/templates/dashboard/onepage/billing.phtml (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/128) * @uses \Magento\Catalog\Model\Product::isVirtual() * @uses \Magento\Quote\Model\Quote::isVirtual() From 749e22ca11b1a822f44f270a3e94d052ae683e92 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:13:45 +0100 Subject: [PATCH 379/717] https://github.com/mage2pro/core/issues/440 --- Catalog/lib/product/type.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Catalog/lib/product/type.php b/Catalog/lib/product/type.php index 8e57ecfa7..e229bff0c 100644 --- a/Catalog/lib/product/type.php +++ b/Catalog/lib/product/type.php @@ -7,7 +7,7 @@ /** * 2021-04-24 * @see df_configurable() - * @used-by \MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) + * @used-by MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) */ function df_product_is_bundle(P $p):bool {return B::TYPE_CODE === $p->getTypeId();} @@ -15,6 +15,6 @@ function df_product_is_bundle(P $p):bool {return B::TYPE_CODE === $p->getTypeId( * 2017-04-20 * @see df_configurable() * @see df_not_configurable() - * @used-by \Dfe\Color\Observer\ProductSaveBefore::execute() + * @used-by Dfe\Color\Observer\ProductSaveBefore::execute() */ function df_product_type_composite(string $t):bool {return in_array($t, [B::TYPE_CODE, C::TYPE_CODE, G::TYPE_CODE]);} \ No newline at end of file From a2911a224636ebcc0201e3cbf4fed425b1ae9bb8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:13:57 +0100 Subject: [PATCH 380/717] https://github.com/mage2pro/core/issues/440 --- CatalogInventory/lib/main.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CatalogInventory/lib/main.php b/CatalogInventory/lib/main.php index 30e083f88..6e62e8238 100644 --- a/CatalogInventory/lib/main.php +++ b/CatalogInventory/lib/main.php @@ -9,7 +9,7 @@ /** * 2019-11-18 * It returns a float value, not an integer one. - * @used-by \Frugue\Configurable\Plugin\ConfigurableProduct\Helper\Data::aroundGetOptions() + * @used-by Frugue\Configurable\Plugin\ConfigurableProduct\Helper\Data::aroundGetOptions() * @param P|int $p */ function df_qty($p):float { @@ -30,14 +30,14 @@ function df_qty($p):float { /** * 2020-06-05 - * @used-by \BlushMe\Checkout\Block\Extra::items() + * @used-by BlushMe\Checkout\Block\Extra::items() */ function df_stock_h():StockH {return df_o(StockH::class);} /** * 2018-06-04 * @used-by df_qty() - * @used-by \Frugue\Configurable\Plugin\ConfigurableProduct\Helper\Data::aroundGetOptions() + * @used-by Frugue\Configurable\Plugin\ConfigurableProduct\Helper\Data::aroundGetOptions() * @return IStockRegistry|StockRegistry */ function df_stock_r() {return df_o(IStockRegistry::class);} \ No newline at end of file From 25a9d1968de7634c89b67347fa100ca4420fe9ea Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:14:09 +0100 Subject: [PATCH 381/717] refactoring --- CatalogInventory/lib/main.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CatalogInventory/lib/main.php b/CatalogInventory/lib/main.php index 6e62e8238..ce1f4879c 100644 --- a/CatalogInventory/lib/main.php +++ b/CatalogInventory/lib/main.php @@ -7,8 +7,7 @@ use Magento\InventorySalesApi\Api\GetProductSalableQtyInterface as IQty; /** - * 2019-11-18 - * It returns a float value, not an integer one. + * 2019-11-18 It returns a float value, not an integer one. * @used-by Frugue\Configurable\Plugin\ConfigurableProduct\Helper\Data::aroundGetOptions() * @param P|int $p */ From 3b42f648d0c10601ad28a15fc0583dcca91b4bfa Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:14:22 +0100 Subject: [PATCH 382/717] https://github.com/mage2pro/core/issues/440 --- Checkout/lib/main.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Checkout/lib/main.php b/Checkout/lib/main.php index 0dde66a32..b3693f8d4 100644 --- a/Checkout/lib/main.php +++ b/Checkout/lib/main.php @@ -10,7 +10,7 @@ use Magento\Sales\Model\Order as O; /** * 2019-04-17 - * @used-by \Mangoit\MediaclipHub\Controller\Index\AddToCart::execute() + * @used-by Mangoit\MediaclipHub\Controller\Index\AddToCart::execute() */ function df_cart():Cart {return df_o(Cart::class);} @@ -24,14 +24,14 @@ function df_cart_h():CartH {return df_o(CartH::class);} * 2016-07-14 * 2022-11-17 PHP allows to declare a type before `...`: https://github.com/mage2pro/core/issues/174#user-content-... * @used-by dfp_error() - * @used-by \Df\Payment\CustomerReturn::execute() - * @used-by \Dfe\CheckoutCom\Handler\CustomerReturn::p() + * @used-by Df\Payment\CustomerReturn::execute() + * @used-by Dfe\CheckoutCom\Handler\CustomerReturn::p() */ function df_checkout_error(string ...$a):void {df_checkout_message(df_format($a), false);} /** * 2021-05-26 - * @used-by \Interactivated\Quotecheckout\Controller\Index\Updateordermethod::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) + * @used-by Interactivated\Quotecheckout\Controller\Index\Updateordermethod::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) */ function df_checkout_h():DataH {return df_o(DataH::class);} @@ -49,16 +49,16 @@ function df_checkout_message(string $s, bool $success):void { * 2016-05-06 * @used-by df_order_last() * @used-by df_quote() - * @used-by \Df\Customer\Observer\CopyFieldset\OrderAddressToCustomer::execute() - * @used-by \Df\Payment\Block\Info::ii() - * @used-by \Df\Payment\CustomerReturn::execute() - * @used-by \Df\Payment\W\Strategy\ConfirmPending::_handle() - * @used-by \Dfe\AlphaCommerceHub\W\Reader::reqFilter() - * @used-by \Dfe\CheckoutCom\Handler\CustomerReturn::p() - * @used-by \PPCs\Core\Plugin\Checkout\Controller\Onepage\Success::beforeDispatch() - * @used-by \TFC\Realex\Redirector::is() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/realex/issues/1) - * @used-by \TFC\Realex\Redirector::restoreQuote() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/realex/issues/1) - * @used-by \TFC\Realex\Redirector::set() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/realex/issues/1) + * @used-by Df\Customer\Observer\CopyFieldset\OrderAddressToCustomer::execute() + * @used-by Df\Payment\Block\Info::ii() + * @used-by Df\Payment\CustomerReturn::execute() + * @used-by Df\Payment\W\Strategy\ConfirmPending::_handle() + * @used-by Dfe\AlphaCommerceHub\W\Reader::reqFilter() + * @used-by Dfe\CheckoutCom\Handler\CustomerReturn::p() + * @used-by PPCs\Core\Plugin\Checkout\Controller\Onepage\Success::beforeDispatch() + * @used-by TFC\Realex\Redirector::is() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/realex/issues/1) + * @used-by TFC\Realex\Redirector::restoreQuote() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/realex/issues/1) + * @used-by TFC\Realex\Redirector::set() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/realex/issues/1) * @return Session|DfSession */ function df_checkout_session() {return df_o(Session::class);} @@ -67,11 +67,11 @@ function df_checkout_session() {return df_o(Session::class);} * 2018-10-06 * @used-by df_redirect_to_payment() * @used-by df_redirect_to_success() - * @used-by \Df\Payment\Block\Info::ii() - * @used-by \Df\Payment\W\Action::execute() - * @used-by \Dfe\AlphaCommerceHub\W\Reader::reqFilter() - * @used-by \Dfe\CheckoutCom\Handler\CustomerReturn::p() - * @used-by \TFC\Core\B\Checkout\Success::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/42) + * @used-by Df\Payment\Block\Info::ii() + * @used-by Df\Payment\W\Action::execute() + * @used-by Dfe\AlphaCommerceHub\W\Reader::reqFilter() + * @used-by Dfe\CheckoutCom\Handler\CustomerReturn::p() + * @used-by TFC\Core\B\Checkout\Success::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/42) * @return O|null * @throws DFE */ From febb4688161d928469f236eb11ba65a1af1c485a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:14:34 +0100 Subject: [PATCH 383/717] https://github.com/mage2pro/core/issues/440 --- Cms/lib/block/o.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cms/lib/block/o.php b/Cms/lib/block/o.php index 8bb08a8c3..b32a880af 100644 --- a/Cms/lib/block/o.php +++ b/Cms/lib/block/o.php @@ -10,6 +10,6 @@ function df_cms_block_r():BR {return df_o(BR::class);} /** * 2018-05-21 - * @used-by \Df\Config\Source\Block::map() + * @used-by Df\Config\Source\Block::map() */ function df_cms_blocks():C {return df_new_om(C::class);} \ No newline at end of file From 2119294a7d8d689ed68a7eb8b9845b68416440ec Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:14:40 +0100 Subject: [PATCH 384/717] https://github.com/mage2pro/core/issues/440 --- Cms/lib/block/output.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cms/lib/block/output.php b/Cms/lib/block/output.php index 20eed88de..da9fbc676 100644 --- a/Cms/lib/block/output.php +++ b/Cms/lib/block/output.php @@ -10,7 +10,7 @@ * @see \Magento\Cms\Model\ResourceModel\Block::load() * @see \Magento\Cms\Model\ResourceModel\Block::getBlockId() * 2024-05-06 "Improve `df_cms_block*` functions": https://github.com/mage2pro/core/issues/365 - * @used-by \AlbumEnvy\Popup\Settings::content() + * @used-by AlbumEnvy\Popup\Settings::content() * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l2/bottom.phtml (https://github.com/cabinetsbay/catalog/issues/18) * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l2/top.phtml (https://github.com/cabinetsbay/catalog/issues/18) * @used-by vendor/cabinetsbay/core/view/frontend/templates/home.phtml (https://github.com/cabinetsbay/core/issues/8) From 81aabc4d7976e751591a988497be2dea12a8cb8c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:14:46 +0100 Subject: [PATCH 385/717] https://github.com/mage2pro/core/issues/440 --- Cms/lib/filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cms/lib/filter.php b/Cms/lib/filter.php index ae95ae770..12511d712 100644 --- a/Cms/lib/filter.php +++ b/Cms/lib/filter.php @@ -18,6 +18,6 @@ function df_cms_filter_block(string $s):string {return df_cms_filter_provider()- /** * 2024-03-25 * @see df_cms_filter_block() - * @used-by \CabinetsBay\Catalog\B\Category::l3a() (https://github.com/cabinetsbay/site/issues/98) + * @used-by CabinetsBay\Catalog\B\Category::l3a() (https://github.com/cabinetsbay/site/issues/98) */ function df_cms_filter_page(string $s):string {return df_cms_filter_provider()->getPageFilter()->filter($s);} \ No newline at end of file From eb1bf99727b8d7826c2a8092d61c8e9b7c54cb7e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:14:54 +0100 Subject: [PATCH 386/717] https://github.com/mage2pro/core/issues/440 --- Config/lib/main.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Config/lib/main.php b/Config/lib/main.php index dbdf78c34..395ce938a 100644 --- a/Config/lib/main.php +++ b/Config/lib/main.php @@ -35,16 +35,16 @@ * https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Store/Model/ScopeInterface.php#L17 * @used-by df_mail() * @used-by ikf_ite() - * @used-by \BlushMe\Checkout\Block\Extra::items() - * @used-by \CanadaSatellite\Core\Plugin\Cart2Quote\DeskEmail\Observer\Frontend\SaveMessageAfterObserver::beforeExecute(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/54) - * @used-by \CanadaSatellite\Core\Plugin\Magento\Rss\Controller\Feed::beforeExecute(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) - * @used-by \CanadaSatellite\Core\Plugin\Mageplaza\Blog\Helper\Data::afterGetBlogUrl() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) - * @used-by \Df\AdobeStockImageAdminUi\Plugin\Model\Listing\DataProvider::aroundGetData() - * @used-by \Df\Config\Comment::sibling() - * @used-by \Df\Config\Source::sibling() - * @used-by \Df\Security\BlackList::load() - * @used-by \Df\Shipping\Settings::enable() - * @used-by \Dfe\Portal\Block\Content::getTemplate() + * @used-by BlushMe\Checkout\Block\Extra::items() + * @used-by CanadaSatellite\Core\Plugin\Cart2Quote\DeskEmail\Observer\Frontend\SaveMessageAfterObserver::beforeExecute(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/54) + * @used-by CanadaSatellite\Core\Plugin\Magento\Rss\Controller\Feed::beforeExecute(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) + * @used-by CanadaSatellite\Core\Plugin\Mageplaza\Blog\Helper\Data::afterGetBlogUrl() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) + * @used-by Df\AdobeStockImageAdminUi\Plugin\Model\Listing\DataProvider::aroundGetData() + * @used-by Df\Config\Comment::sibling() + * @used-by Df\Config\Source::sibling() + * @used-by Df\Security\BlackList::load() + * @used-by Df\Shipping\Settings::enable() + * @used-by Dfe\Portal\Block\Content::getTemplate() * @used-by app/code/Interactivated/Quotecheckout/view/frontend/templates/dashboard/onepage/billing.phtml (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) * @used-by app/code/Interactivated/Quotecheckout/view/frontend/templates/dashboard/onepage/billing/sortbilling.phtml (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) * @used-by app/code/Interactivated/Quotecheckout/view/frontend/templates/dashboard/onepage/shipping/sortshipping.phtml (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) @@ -55,7 +55,7 @@ * @return array|string|null|mixed */ function df_cfg($k, $s = null, $d = null) { - /** 2018-04-21 @used-by \Df\Shipping\Settings::enable() */ + /** 2018-04-21 @used-by Df\Shipping\Settings::enable() */ if (is_array($k)) { $k = df_cc_path($k); } @@ -121,7 +121,7 @@ function df_cfg_r():RConfig {return df_o(RConfig::class);} * @see \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES * @see df_cfg_delete() * @used-by df_cfg_save_cc() - * @used-by \Dfe\Dynamics365\Settings\General\OAuth::refreshTokenSave() + * @used-by Dfe\Dynamics365\Settings\General\OAuth::refreshTokenSave() */ function df_cfg_save(string $path, string $v, string $scope = 'default', int $scopeId = 0):void {df_cfg_r()->saveConfig( $path, $v, dftr($scope, [SS::SCOPE_WEBSITE => SS::SCOPE_WEBSITES, SS::SCOPE_STORE => SS::SCOPE_STORES]), $scopeId @@ -133,7 +133,7 @@ function df_cfg_save(string $path, string $v, string $scope = 'default', int $sc * A $path: «web/unsecure/base_url». * A $scope: «default», «websites», «website», «stores», «store». * A $scopeId: «0». - * @used-by \Df\Security\BlackList::save() + * @used-by Df\Security\BlackList::save() * @param string $path */ function df_cfg_save_cc(string $path, string $v, string $scope = 'default', int $scopeId = 0):void { @@ -143,11 +143,11 @@ function df_cfg_save_cc(string $path, string $v, string $scope = 'default', int /** * 2018-01-28 - * @used-by \Df\Core\TestCase::s() - * @used-by \Df\Sso\CustomerReturn::execute() - * @used-by \Dfe\Zoho\API\Client::ss() - * @used-by \Dfe\Zoho\App::ss() - * @used-by \Df\Framework\Mail\TransportObserver::execute() + * @used-by Df\Core\TestCase::s() + * @used-by Df\Sso\CustomerReturn::execute() + * @used-by Dfe\Zoho\API\Client::ss() + * @used-by Dfe\Zoho\App::ss() + * @used-by Df\Framework\Mail\TransportObserver::execute() * @param object|string $m */ function dfs($m):Settings {return Settings::convention(df_module_name_c($m));} \ No newline at end of file From b85a91cda9bb307a23841bbc55796e1464a14dcd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:15:09 +0100 Subject: [PATCH 387/717] https://github.com/mage2pro/core/issues/440 --- Config/lib/scope.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Config/lib/scope.php b/Config/lib/scope.php index 50f85fdd8..1e738b0d8 100644 --- a/Config/lib/scope.php +++ b/Config/lib/scope.php @@ -24,11 +24,11 @@ * https://github.com/magento/magento2/blob/2.1.9/app/code/Magento/Store/Model/ScopeInterface.php#L8-L21 * https://github.com/magento/magento2/blob/2.2.0/app/code/Magento/Store/Model/ScopeInterface.php#L18 * @used-by df_scope_stores() - * @used-by \Df\Config\Comment::sibling() - * @used-by \Df\Config\Settings::scope() - * @used-by \Df\Config\Source::sibling() - * @used-by \Df\OAuth\Settings::authenticatedB() - * @used-by \Dfe\Dynamics365\Button::onFormInitialized() + * @used-by Df\Config\Comment::sibling() + * @used-by Df\Config\Settings::scope() + * @used-by Df\Config\Source::sibling() + * @used-by Df\OAuth\Settings::authenticatedB() + * @used-by Dfe\Dynamics365\Button::onFormInitialized() * @return array(string, int) */ function df_scope():array { @@ -105,9 +105,9 @@ function df_scope():array { * The @see \Magento\Store\Model\ScopeInterface::SCOPE_STORE constant exists in all the Magento 2 versions: * https://github.com/magento/magento2/blob/2.0.0/app/code/Magento/Store/Model/ScopeInterface.php#L17 * @used-by df_store_code() - * @used-by \Df\Config\Settings::_a() - * @used-by \Df\Config\Settings::_font() - * @used-by \Df\Config\Settings::_matrix() + * @used-by Df\Config\Settings::_a() + * @used-by Df\Config\Settings::_font() + * @used-by Df\Config\Settings::_matrix() * @param null|string|int|ScopeA|Store $s [optional] */ function df_scope_code($s = null, string $type = SS::SCOPE_STORE):string { From 009d3baefaa035c7b797bee55e27fbfaaf87ca92 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:15:19 +0100 Subject: [PATCH 388/717] https://github.com/mage2pro/core/issues/440 --- Config/lib/structure.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Config/lib/structure.php b/Config/lib/structure.php index cd5ba6dfe..bca26c89f 100644 --- a/Config/lib/structure.php +++ b/Config/lib/structure.php @@ -42,11 +42,11 @@ function df_config_e($path, bool $throw = true, string $expectedClass = '') { /* /** * 2015-11-14 * 2017-06-29 - * В контексте @used-by \Df\Config\Backend::fc() при загрузке настроек эта функция работает правильно, + * В контексте @used-by Df\Config\Backend::fc() при загрузке настроек эта функция работает правильно, * проверил в отладчике. * @used-by df_config_field_path() - * @used-by \Df\Config\Backend::fc() - * @used-by \Df\Config\Source::f() + * @used-by Df\Config\Backend::fc() + * @used-by Df\Config\Source::f() * @param V|null $v [optional] */ function df_config_field(V $v = null):F {/** @var F $r */ @@ -135,7 +135,7 @@ function df_config_field(V $v = null):F {/** @var F $r */ * 1) "@uses \Magento\Config\Model\Config\Structure\AbstractElement::getPath() * ignores a custom `config_path` value": https://mage2.pro/t/5148 * 2) @uses df_config_field() returns a flyweight: https://en.wikipedia.org/wiki/Flyweight_pattern - * @used-by \Df\Config\Comment::groupPath() + * @used-by Df\Config\Comment::groupPath() */ function df_config_field_path():string { $f = df_config_field(); /** @var F $f */ @@ -144,7 +144,7 @@ function df_config_field_path():string { /** * 2016-08-02 - * @used-by \Df\Payment\Comment\Description::locations() + * @used-by Df\Payment\Comment\Description::locations() * @return Group|null */ function df_config_group(string $path, bool $throw = true) {return df_config_e($path, $throw, Group::class);} @@ -159,13 +159,13 @@ function df_config_section(string $path, bool $throw = true) {return df_config_e /** * 2016-08-02 By analogy with @see \Magento\Config\Block\System\Config\Form::__construct() * @used-by df_config_e() - * @used-by \Df\Config\Backend::label() - * @used-by \Df\Config\Model\Config\Structure::tab() + * @used-by Df\Config\Backend::label() + * @used-by Df\Config\Model\Config\Structure::tab() */ function df_config_structure():Structure {return df_o(Structure::class);} /** * 2016-08-02 - * @used-by \Df\Config\Backend::label() + * @used-by Df\Config\Backend::label() */ function df_config_tab_label(Section $s):string {return DfStructure::tab($s->getData()['tab'], 'label');} \ No newline at end of file From a75ff2197ae712b35f6ad1c7f80142778e610a57 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:15:26 +0100 Subject: [PATCH 389/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/clean/filter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/array/clean/filter.php b/Core/lib/array/clean/filter.php index b3fc53e21..f5e0b9cb1 100644 --- a/Core/lib/array/clean/filter.php +++ b/Core/lib/array/clean/filter.php @@ -17,8 +17,8 @@ * https://php.watch/versions/8.0/union-types * https://3v4l.org/AOWmO * @used-by df_clean_r() - * @used-by \Frugue\Core\Plugin\Sales\Model\Quote::afterGetAddressesCollection() - * @used-by \TFC\Core\Plugin\Sales\Model\Order::afterGetParentItemsRandomCollection() + * @used-by Frugue\Core\Plugin\Sales\Model\Quote::afterGetAddressesCollection() + * @used-by TFC\Core\Plugin\Sales\Model\Order::afterGetParentItemsRandomCollection() * @param callable|iterable $a1 * @param callable|iterable $a2 * @return array(int|string => mixed) @@ -102,7 +102,7 @@ function df_filter_head($a1, $a2):array {return df_filter_f($a1, $a2, function(a * 2) We still can not use «Union Types» (e.g. `callable|iterable`) because they require PHP ≥ 8 (we need to support PHP ≥ 7.1): * 2.1) https://php.watch/versions/8.0/union-types * 2.2) https://3v4l.org/AOWmO - * @used-by \Df\Qa\Trace::__construct() + * @used-by Df\Qa\Trace::__construct() * @param callable|iterable $a1 * @param callable|iterable $a2 * @return array(int|string => mixed) From 49e4f2007be46267386f325843aee0a755872c74 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:15:32 +0100 Subject: [PATCH 390/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/clean/main.php | 106 +++++++++++++++++----------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/Core/lib/array/clean/main.php b/Core/lib/array/clean/main.php index dd6270cac..9594c41b6 100644 --- a/Core/lib/array/clean/main.php +++ b/Core/lib/array/clean/main.php @@ -42,50 +42,50 @@ * @used-by df_page_result() * @used-by df_store_code_from_url() * @used-by df_zf_http_last_req() - * @used-by \Df\API\Facade::p() - * @used-by \Df\Framework\Plugin\Reflection\DataObjectProcessor::aroundBuildOutputDataArray() - * @used-by \Dfe\GingerPaymentsBase\Charge::pCustomer() - * @used-by \Dfe\GingerPaymentsBase\Test\CreateOrder::t01_success() - * @used-by \Df\OAuth\App::pCommon() - * @used-by \Df\OAuth\FE\Button::onFormInitialized() - * @used-by \Df\Payment\Block\Info::rPDF() - * @used-by \Df\Payment\ConfigProvider\GlobalT::icons() - * @used-by \Df\Payment\Method::iiaSetTRR() - * @used-by \Df\Payment\W\F::c() - * @used-by \Df\Sentry\Client::capture() - * @used-by \Df\Sentry\Client::send() - * @used-by \Df\Sso\Button\Js::attributes() - * @used-by \Df\Sso\CustomerReturn::customerData() - * @used-by \Df\Sso\CustomerReturn::register() - * @used-by \Dfe\AllPay\Block\Info\BankCard::custom() - * @used-by \Dfe\AlphaCommerceHub\Charge::pCharge() - * @used-by \Dfe\CheckoutCom\Response::a() - * @used-by \Dfe\Customer\Plugin\Customer\Model\Address\AbstractAddress::afterValidate() - * @used-by \Dfe\Dynamics365\API\Facade::productpricelevels() - * @used-by \Dfe\Dynamics365\Button::pExtra() - * @used-by \Dfe\FacebookLogin\Customer::req() - * @used-by \Dfe\Klarna\Api\Checkout\V2\Charge::kl_order_lines() - * @used-by \Dfe\Markdown\Modifier::modifyData() - * @used-by \Dfe\Moip\API\Validator::long() - * @used-by \Dfe\Moip\P\Reg::p() - * @used-by \Dfe\Moip\Test\Card::card() - * @used-by \Dfe\Moip\Test\CaseT\Customer::pCustomer() - * @used-by \Dfe\PostFinance\Signer::sign() - * @used-by \Dfe\PostFinance\Signer::sign() - * @used-by \Dfe\Salesforce\Button::pExtra() - * @used-by \Dfe\Sift\Payload\Promotions::p() - * @used-by \Dfe\Stripe\Facade\Charge::refund() - * @used-by \Dfe\Stripe\Facade\Charge::refundMeta() - * @used-by \Dfe\Stripe\P\Reg::p() - * @used-by \Dfe\TwoCheckout\Charge::lineItems() - * @used-by \Dfe\TwoCheckout\Exception::messageC() - * @used-by \Dfe\TwoCheckout\LineItem::build() - * @used-by \Dfe\TwoCheckout\LineItem\Product::build() - * @used-by \Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::_p() - * @used-by \KingPalm\B2B\Block\Registration::text() - * @used-by \SpryngPaymentsApiPhp\Controller\TransactionController::refund() - * @used-by \Stock2Shop\OrderExport\Payload::visitor() - * @used-by \TFC\Core\B\Home\Slider::i() + * @used-by Df\API\Facade::p() + * @used-by Df\Framework\Plugin\Reflection\DataObjectProcessor::aroundBuildOutputDataArray() + * @used-by Dfe\GingerPaymentsBase\Charge::pCustomer() + * @used-by Dfe\GingerPaymentsBase\Test\CreateOrder::t01_success() + * @used-by Df\OAuth\App::pCommon() + * @used-by Df\OAuth\FE\Button::onFormInitialized() + * @used-by Df\Payment\Block\Info::rPDF() + * @used-by Df\Payment\ConfigProvider\GlobalT::icons() + * @used-by Df\Payment\Method::iiaSetTRR() + * @used-by Df\Payment\W\F::c() + * @used-by Df\Sentry\Client::capture() + * @used-by Df\Sentry\Client::send() + * @used-by Df\Sso\Button\Js::attributes() + * @used-by Df\Sso\CustomerReturn::customerData() + * @used-by Df\Sso\CustomerReturn::register() + * @used-by Dfe\AllPay\Block\Info\BankCard::custom() + * @used-by Dfe\AlphaCommerceHub\Charge::pCharge() + * @used-by Dfe\CheckoutCom\Response::a() + * @used-by Dfe\Customer\Plugin\Customer\Model\Address\AbstractAddress::afterValidate() + * @used-by Dfe\Dynamics365\API\Facade::productpricelevels() + * @used-by Dfe\Dynamics365\Button::pExtra() + * @used-by Dfe\FacebookLogin\Customer::req() + * @used-by Dfe\Klarna\Api\Checkout\V2\Charge::kl_order_lines() + * @used-by Dfe\Markdown\Modifier::modifyData() + * @used-by Dfe\Moip\API\Validator::long() + * @used-by Dfe\Moip\P\Reg::p() + * @used-by Dfe\Moip\Test\Card::card() + * @used-by Dfe\Moip\Test\CaseT\Customer::pCustomer() + * @used-by Dfe\PostFinance\Signer::sign() + * @used-by Dfe\PostFinance\Signer::sign() + * @used-by Dfe\Salesforce\Button::pExtra() + * @used-by Dfe\Sift\Payload\Promotions::p() + * @used-by Dfe\Stripe\Facade\Charge::refund() + * @used-by Dfe\Stripe\Facade\Charge::refundMeta() + * @used-by Dfe\Stripe\P\Reg::p() + * @used-by Dfe\TwoCheckout\Charge::lineItems() + * @used-by Dfe\TwoCheckout\Exception::messageC() + * @used-by Dfe\TwoCheckout\LineItem::build() + * @used-by Dfe\TwoCheckout\LineItem\Product::build() + * @used-by Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::_p() + * @used-by KingPalm\B2B\Block\Registration::text() + * @used-by SpryngPaymentsApiPhp\Controller\TransactionController::refund() + * @used-by Stock2Shop\OrderExport\Payload::visitor() + * @used-by TFC\Core\B\Home\Slider::i() * @param mixed ...$k [optional] */ function df_clean(array $r, ...$k):array {/** @var mixed[] $r */return df_clean_r( @@ -95,10 +95,10 @@ function df_clean(array $r, ...$k):array {/** @var mixed[] $r */return df_clean_ /** * 2017-02-18 * https://3v4l.org/l2b4m - * @used-by \Df\PaypalClone\Charge::p() - * @used-by \Df\StripeClone\P\Charge::request() - * @used-by \Df\StripeClone\P\Reg::request() - * @used-by \Dfe\Qiwi\Signer::sign() + * @used-by Df\PaypalClone\Charge::p() + * @used-by Df\StripeClone\P\Charge::request() + * @used-by Df\StripeClone\P\Reg::request() + * @used-by Dfe\Qiwi\Signer::sign() * @param array(int|string => mixed) $a * @param mixed ...$remove [optional] * @return array(int|string => mixed) @@ -132,8 +132,8 @@ function df_clean_null(array $r):array {return array_filter($r, function($v) {re * @used-by df_clean() * @used-by df_clean_r() * @used-by df_xml_atts - * @used-by \Df\Core\Html\Tag::__construct() - * @used-by \Dfe\Sift\API\Client::_construct() + * @used-by Df\Core\Html\Tag::__construct() + * @used-by Dfe\Sift\API\Client::_construct() */ function df_clean_r(array $r, array $k = [], bool $req = true):array {/** @var mixed[] $r */ /** 2020-02-05 @see array_unique() does not work correctly here, even with the @see SORT_REGULAR flag. */ @@ -157,9 +157,9 @@ function df_clean_xml(array $a):array {return df_clean($a, [df_cdata('')]);} /** * 2018-08-11 * @used-by dfa_remove_objects() - * @used-by \Stock2Shop\OrderExport\Payload::address() - * @used-by \Stock2Shop\OrderExport\Payload::get() - * @used-by \Stock2Shop\OrderExport\Payload::payment() + * @used-by Stock2Shop\OrderExport\Payload::address() + * @used-by Stock2Shop\OrderExport\Payload::get() + * @used-by Stock2Shop\OrderExport\Payload::payment() * @param _DO|mixed[] $v * @return mixed */ From 0bdd7866f7012ff208cda69ac823566df06adedc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:15:47 +0100 Subject: [PATCH 391/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/key/transform.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/lib/array/key/transform.php b/Core/lib/array/key/transform.php index 55c296d86..130d08b12 100644 --- a/Core/lib/array/key/transform.php +++ b/Core/lib/array/key/transform.php @@ -28,7 +28,7 @@ function dfa_key_case(array $a, int $c):array {return dfak_transform_r($a, funct /** * 2017-09-03 - * @used-by \Dfe\Qiwi\API\Validator::codes() + * @used-by Dfe\Qiwi\API\Validator::codes() * @uses df_int() * @see df_int_simple() * @param array(int|string => mixed) $a @@ -41,7 +41,7 @@ function dfa_key_int(array $a):array {return dfak_transform($a, 'df_int');} * 2020-02-04 * It does not change keys of a non-associative array, * but it is applied recursively to nested arrays, so it could change keys their keys. - * @used-by \Dfe\Sift\API\Client::_construct() + * @used-by Dfe\Sift\API\Client::_construct() * @param array(string => mixed) $a * @return array(string => mixed) */ @@ -60,10 +60,10 @@ function dfak_prefix(array $a, string $p, bool $req = false):array {return dfak_ * @used-by dfak_prefix() * @used-by dfak_transform() * @used-by dfak_transform_r() - * @used-by \Df\Framework\Request::extra() - * @used-by \Df\Sentry\Client::tags() - * @used-by \Df\Sentry\Extra::adjust() - * @used-by \Dfe\YandexKassa\Charge::pLoan() + * @used-by Df\Framework\Request::extra() + * @used-by Df\Sentry\Client::tags() + * @used-by Df\Sentry\Extra::adjust() + * @used-by Dfe\YandexKassa\Charge::pLoan() * @param iterable|callable $a1 * @param iterable|callable $a2 * @return array(string => mixed) @@ -109,7 +109,7 @@ function dfak_transform_r($a1, $a2):array {return dfak_transform($a1, $a2, true) /** * 2017-02-01 - * @used-by \Dfe\PostFinance\Signer::sign() + * @used-by Dfe\PostFinance\Signer::sign() * @param array(string => mixed) $a * @return array(string => mixed) */ From 8ec2f977d78b4ffe8770bf9b394c6b3527418713 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:15:54 +0100 Subject: [PATCH 392/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/map/.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Core/lib/array/map/.php b/Core/lib/array/map/.php index 98d03e249..9a191c83b 100644 --- a/Core/lib/array/map/.php +++ b/Core/lib/array/map/.php @@ -34,23 +34,23 @@ * @used-by df_trim_text_left() * @used-by df_xml_atts * @used-by ikf_api_oi() - * @used-by \CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) - * @used-by \CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order::afterCanInvoice() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/256) - * @used-by \Df\Payment\ConfigProvider\GlobalT::icons() - * @used-by \Df\Xml\A::p() - * @used-by \Dfe\Color\Image::probabilities() - * @used-by \Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() - * @used-by \Dfe\Sift\Payload\OQI::p() - * @used-by \Dfe\YandexKassa\Source\Option::map() - * @used-by \Inkifi\Map\HTML::tiles() - * @used-by \Inkifi\Mediaclip\API\Facade\Order\Item::files() - * @used-by \Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::pOI() - * @used-by \Inkifi\Pwinty\Event::shipments() - * @used-by \CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/site/issues/98) - * @used-by \Sharapov\Cabinetsbay\Setup\UpgradeData::p101() (https://github.com/cabinetsbay/site/issues/98) - * @used-by \TFC\Core\B\Home\Slider::p() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) - * @used-by \Wolf\Filter\Controller\Index\Change::execute() - * @used-by \Wolf\Filter\Observer\ControllerActionPredispatch::execute() + * @used-by CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) + * @used-by CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order::afterCanInvoice() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/256) + * @used-by Df\Payment\ConfigProvider\GlobalT::icons() + * @used-by Df\Xml\A::p() + * @used-by Dfe\Color\Image::probabilities() + * @used-by Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() + * @used-by Dfe\Sift\Payload\OQI::p() + * @used-by Dfe\YandexKassa\Source\Option::map() + * @used-by Inkifi\Map\HTML::tiles() + * @used-by Inkifi\Mediaclip\API\Facade\Order\Item::files() + * @used-by Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::pOI() + * @used-by Inkifi\Pwinty\Event::shipments() + * @used-by CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/site/issues/98) + * @used-by Sharapov\Cabinetsbay\Setup\UpgradeData::p101() (https://github.com/cabinetsbay/site/issues/98) + * @used-by TFC\Core\B\Home\Slider::p() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) + * @used-by Wolf\Filter\Controller\Index\Change::execute() + * @used-by Wolf\Filter\Observer\ControllerActionPredispatch::execute() * @used-by https://github.com/tradefurniturecompany/report/blob/1.0.3/view/frontend/templates/index.phtml#L25 * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l2/l3/filters.phtml (https://github.com/cabinetsbay/catalog/issues/18) * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/products/not-empty.phtml (https://github.com/cabinetsbay/catalog/issues/38) From f1301214e83bcfd36c416aa8c03b02ab485831ab Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:00 +0100 Subject: [PATCH 393/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/map/each.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/map/each.php b/Core/lib/array/map/each.php index 15eaecb18..8386bf3b2 100644 --- a/Core/lib/array/map/each.php +++ b/Core/lib/array/map/each.php @@ -19,7 +19,7 @@ * 2.1) https://php.watch/versions/8.0/union-types * 2.2) https://3v4l.org/AOWmO * @used-by df_category_names() - * @used-by \Df\Config\Backend\ArrayT::processI() + * @used-by Df\Config\Backend\ArrayT::processI() * @param Traversable|array(int|string => _DO|array(string => mixed)) $c * @param string|callable $f * @param mixed ...$p From 480054d224ef26029e6d9bcaa22c7f2eda4c348f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:07 +0100 Subject: [PATCH 394/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/map/k.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/lib/array/map/k.php b/Core/lib/array/map/k.php index c679dc47d..41af9a62d 100644 --- a/Core/lib/array/map/k.php +++ b/Core/lib/array/map/k.php @@ -13,13 +13,13 @@ * @used-by df_modules_my() * @used-by dfe_modules_log() * @used-by dfp_methods() - * @used-by \Df\Payment\ConfigProvider::configOptions() - * @used-by \Df\Qa\Dumper::dumpArrayElements() - * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Df\Sentry\Client::send() - * @used-by \Dfe\PostFinance\Signer::sign() - * @used-by \Sharapov\Cabinetsbay\Setup\UpgradeData::p100() (https://github.com/cabinetsbay/site/issues/98) - * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() + * @used-by Df\Payment\ConfigProvider::configOptions() + * @used-by Df\Qa\Dumper::dumpArrayElements() + * @used-by Df\Qa\Trace\Formatter::p() + * @used-by Df\Sentry\Client::send() + * @used-by Dfe\PostFinance\Signer::sign() + * @used-by Sharapov\Cabinetsbay\Setup\UpgradeData::p100() (https://github.com/cabinetsbay/site/issues/98) + * @used-by Wolf\Filter\Block\Navigation::hDropdowns() * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l3/tabs/overview.phtml (https://github.com/cabinetsbay/catalog/issues/22) * @used-by vendor/mage2pro/color/view/frontend/templates/index.phtml * @param callable|iterable $a1 From 32a6a47c4743b17c93ce75667433f2e995232625 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:13 +0100 Subject: [PATCH 395/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/map/kr.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/lib/array/map/kr.php b/Core/lib/array/map/kr.php index 2a87515df..7abac4db6 100644 --- a/Core/lib/array/map/kr.php +++ b/Core/lib/array/map/kr.php @@ -11,12 +11,12 @@ * 2.1) https://php.watch/versions/8.0/union-types * 2.2) https://3v4l.org/AOWmO * @used-by dfak_transform() - * @used-by \Df\Config\Source\Block::map() - * @used-by \Df\Core\Text\Regex::getErrorCodeMap() - * @used-by \Dfe\Color\Image::labels() - * @used-by \Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() - * @used-by \Dfe\Robokassa\Api\Options::p() - * @used-by \Doormall\Shipping\Partner\Entity::locations() + * @used-by Df\Config\Source\Block::map() + * @used-by Df\Core\Text\Regex::getErrorCodeMap() + * @used-by Dfe\Color\Image::labels() + * @used-by Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() + * @used-by Dfe\Robokassa\Api\Options::p() + * @used-by Doormall\Shipping\Partner\Entity::locations() * @param callable|iterable $a1 * @param callable|iterable $a2 * @return array(int|string => mixed) From ed1606f234d89183ea1d32eaaf972ab39ceee615 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:18 +0100 Subject: [PATCH 396/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/map/r.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Core/lib/array/map/r.php b/Core/lib/array/map/r.php index 9e97476e8..0cd318ba5 100644 --- a/Core/lib/array/map/r.php +++ b/Core/lib/array/map/r.php @@ -13,16 +13,16 @@ * @used-by df_parse_colon() * @used-by dfe_packages() * @used-by dfe_portal_stripe_customers() - * @used-by \Df\Config\Source\Block::map() - * @used-by \Df\Directory\Model\ResourceModel\Country\Collection::mapFrom3To2() - * @used-by \Df\Directory\Model\ResourceModel\Country\Collection::mapFromCodeToName() - * @used-by \Df\Framework\Form\Element\Multiselect::getElementHtml() - * @used-by \Dfe\Oro\Test\Basic::t02_orders_stripe() - * @used-by \Dfe\ZohoBI\Source\Organization::fetch() - * @used-by \Dfe\PostFinance\Source\Hash\Algorithm::map() - * @used-by \Dfe\Spryng\Source\Account::fetch() - * @used-by \Mineralair\Core\Controller\Modal\Index::execute() - * @used-by \TFC\GoogleShopping\Products::atts() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) + * @used-by Df\Config\Source\Block::map() + * @used-by Df\Directory\Model\ResourceModel\Country\Collection::mapFrom3To2() + * @used-by Df\Directory\Model\ResourceModel\Country\Collection::mapFromCodeToName() + * @used-by Df\Framework\Form\Element\Multiselect::getElementHtml() + * @used-by Dfe\Oro\Test\Basic::t02_orders_stripe() + * @used-by Dfe\ZohoBI\Source\Organization::fetch() + * @used-by Dfe\PostFinance\Source\Hash\Algorithm::map() + * @used-by Dfe\Spryng\Source\Account::fetch() + * @used-by Mineralair\Core\Controller\Modal\Index::execute() + * @used-by TFC\GoogleShopping\Products::atts() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) * @param callable|iterable $a1 * @param callable|iterable $a2 * @return array(int|string => mixed) From aabfea34684b4ef3d1fb5623a8fc7d20eacadd65 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:28 +0100 Subject: [PATCH 397/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/array.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/array/other/array.php b/Core/lib/array/other/array.php index ee7700733..f565826cb 100644 --- a/Core/lib/array/other/array.php +++ b/Core/lib/array/other/array.php @@ -5,9 +5,9 @@ * @used-by df_fe_init() * @used-by df_find() * @used-by df_map() - * @used-by \Df\API\Facade::p() - * @used-by \Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterGetComment() - * @used-by \TFC\Core\B\Home\Slider::p() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) + * @used-by Df\API\Facade::p() + * @used-by Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterGetComment() + * @used-by TFC\Core\B\Home\Slider::p() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) * @param mixed|mixed[] $v */ function df_array($v):array {return is_array($v) ? $v : [$v];} \ No newline at end of file From 6f98dfdf1a7d2f68a8782cccad7518b47d19a8c0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:34 +0100 Subject: [PATCH 398/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/chop.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/other/chop.php b/Core/lib/array/other/chop.php index 0ebff4e93..107768654 100644 --- a/Core/lib/array/other/chop.php +++ b/Core/lib/array/other/chop.php @@ -7,7 +7,7 @@ * If $length is NULL, then @uses mb_substr() returns all characters to the end of the string. * https://3v4l.org/ijD3V * 2022-11-26 That is why I use @uses df_etn(). - * @used-by \Df\Payment\Charge::metadata() + * @used-by Df\Payment\Charge::metadata() * @param string[] $a * @return string[] */ From 6e99306bcf8462042cd0ef5b6f8922bc8f97f5f2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:41 +0100 Subject: [PATCH 399/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/combine_self.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/lib/array/other/combine_self.php b/Core/lib/array/other/combine_self.php index 4875f4ce2..08fe56e86 100644 --- a/Core/lib/array/other/combine_self.php +++ b/Core/lib/array/other/combine_self.php @@ -1,12 +1,12 @@ int|string) From 84a1b7c1b177d7e7785083d1372180ce2b8f1868 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:46 +0100 Subject: [PATCH 400/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/flatten.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/array/other/flatten.php b/Core/lib/array/other/flatten.php index 35310d4b7..81ee8a430 100644 --- a/Core/lib/array/other/flatten.php +++ b/Core/lib/array/other/flatten.php @@ -19,8 +19,8 @@ * @used-by df_mail() * @used-by df_string_clean() * @used-by dfa_unpack() - * @used-by \Df\Payment\Block\Info::rPDF() - * @used-by \Inkifi\Pwinty\AvailableForDownload::_p() + * @used-by Df\Payment\Block\Info::rPDF() + * @used-by Inkifi\Pwinty\AvailableForDownload::_p() */ function dfa_flatten(array $a):array { $r = []; /** @var mixed[] $r */ From e510d7faec0d8a2a6fbc43a5213c1172da3d33c5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:16:52 +0100 Subject: [PATCH 401/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/other/group.php b/Core/lib/array/other/group.php index db3e8d80c..f4db486e2 100644 --- a/Core/lib/array/other/group.php +++ b/Core/lib/array/other/group.php @@ -2,7 +2,7 @@ /** * 2018-04-24 * 2024-04-08 I added the `is_null($k)` case: https://github.com/thehcginstitute-com/m1/issues/551 - * @used-by \Doormall\Shipping\Partner\Entity::locations() + * @used-by Doormall\Shipping\Partner\Entity::locations() * @param array(int|string => mixed) $a * @param string|int|null $k * @return array(int|string => array(int|string => mixed)) From e43f8c3afbbb09660da981f48a802bc511c3e5a7 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:17:02 +0100 Subject: [PATCH 402/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/ids.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/other/ids.php b/Core/lib/array/other/ids.php index 00a9f25a7..f66e29488 100644 --- a/Core/lib/array/other/ids.php +++ b/Core/lib/array/other/ids.php @@ -9,7 +9,7 @@ * 2) `iterable` is supported by PHP ≥ 7.1: https://3v4l.org/qNX1j * 3) https://php.net/manual/en/language.types.iterable.php * @uses df_id() - * @used-by \Df\Config\Backend\ArrayT::processI() + * @used-by Df\Config\Backend\ArrayT::processI() * @param Traversable|array(int|string => _DO|AI) $c * @return int[]|string[] */ From 37f5b32dbf7020e4aceabfec4e1a9c6601333c81 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:17:11 +0100 Subject: [PATCH 403/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/other/index.php b/Core/lib/array/other/index.php index 63f769197..5e144f6b9 100644 --- a/Core/lib/array/other/index.php +++ b/Core/lib/array/other/index.php @@ -8,7 +8,7 @@ * 3) https://php.net/manual/en/language.types.iterable.php * https://3v4l.org/AOWmO * @used-by df_mvars() - * @used-by \Df\Config\A::get() + * @used-by Df\Config\A::get() * @param string|Closure $k * @param Traversable|array(int|string => _DO) $a */ From 7f4b7074efd2d4c67e44fd959d9da4d9ba6cce41 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:17:19 +0100 Subject: [PATCH 404/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/ita.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/other/ita.php b/Core/lib/array/other/ita.php index a760c9f98..76e3a5536 100644 --- a/Core/lib/array/other/ita.php +++ b/Core/lib/array/other/ita.php @@ -18,6 +18,6 @@ * @used-by df_map() * @used-by dfa_select_ordered() * @used-by dfak_transform() - * @used-by \Df\Qa\Dumper::dumpObject() + * @used-by Df\Qa\Dumper::dumpObject() */ function df_ita(iterable $i):array {return is_array($i) ? $i : iterator_to_array($i);} \ No newline at end of file From 1edce9a72b66839907bbc95167d11eb568ef8432 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:17:28 +0100 Subject: [PATCH 405/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/repeated.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/other/repeated.php b/Core/lib/array/other/repeated.php index 768eb7117..5be5af872 100644 --- a/Core/lib/array/other/repeated.php +++ b/Core/lib/array/other/repeated.php @@ -10,6 +10,6 @@ * formerly array has been copied and non-unique elements have been removed (without packing the array afterwards), * but now a new array is built by adding the unique elements. This can result in different numeric indexes. * https://php.net/manual/function.array-unique.php#refsect1-function.array-unique-changelog - * @used-by \Df\Config\Backend\ArrayT::processI() + * @used-by Df\Config\Backend\ArrayT::processI() */ function dfa_repeated(array $a):array {return array_values(array_unique(array_diff_key($a, array_unique($a))));} \ No newline at end of file From c334bf76cdd9e0ca904fae9a8c93b22784cd25be Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:17:33 +0100 Subject: [PATCH 406/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/tr.php | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Core/lib/array/other/tr.php b/Core/lib/array/other/tr.php index f1147a047..ee15a4a1c 100644 --- a/Core/lib/array/other/tr.php +++ b/Core/lib/array/other/tr.php @@ -6,27 +6,27 @@ * @used-by df_cfg_save() * @used-by df_url_bp() * @used-by ikf_pw_country() - * @used-by \Df\Directory\FE\Currency::v() - * @used-by \Dfe\GingerPaymentsBase\Block\Info::prepareCommon() - * @used-by \Dfe\GingerPaymentsBase\Choice::title() - * @used-by \Dfe\GingerPaymentsBase\Method::optionE() - * @used-by \Dfe\GingerPaymentsBase\Method::optionI() - * @used-by \Df\Payment\BankCardNetworkDetector::label() - * @used-by \Df\PaypalClone\W\Event::statusT() - * @used-by \Dfe\AllPay\W\Reader::te2i() - * @used-by \Dfe\IPay88\W\Event::optionTitle() - * @used-by \Dfe\Moip\Facade\Card::brand() - * @used-by \Dfe\Moip\Facade\Card::logoId() - * @used-by \Dfe\Moip\Facade\Card::numberLength() - * @used-by \Dfe\Paymill\Facade\Card::brand() - * @used-by \Dfe\PostFinance\W\Event::optionTitle() - * @used-by \Dfe\Robokassa\W\Event::optionTitle() - * @used-by \Dfe\Square\Facade\Card::brand() - * @used-by \Dfe\Stripe\FE\Currency::getComment() - * @used-by \Dfe\Stripe\Init\Action::redirectUrl() - * @used-by \Dfe\Vantiv\Facade\Card::brandCodeE() - * @used-by \Frugue\Store\Block\Switcher::map() - * @used-by \Frugue\Store\Block\Switcher::name() + * @used-by Df\Directory\FE\Currency::v() + * @used-by Dfe\GingerPaymentsBase\Block\Info::prepareCommon() + * @used-by Dfe\GingerPaymentsBase\Choice::title() + * @used-by Dfe\GingerPaymentsBase\Method::optionE() + * @used-by Dfe\GingerPaymentsBase\Method::optionI() + * @used-by Df\Payment\BankCardNetworkDetector::label() + * @used-by Df\PaypalClone\W\Event::statusT() + * @used-by Dfe\AllPay\W\Reader::te2i() + * @used-by Dfe\IPay88\W\Event::optionTitle() + * @used-by Dfe\Moip\Facade\Card::brand() + * @used-by Dfe\Moip\Facade\Card::logoId() + * @used-by Dfe\Moip\Facade\Card::numberLength() + * @used-by Dfe\Paymill\Facade\Card::brand() + * @used-by Dfe\PostFinance\W\Event::optionTitle() + * @used-by Dfe\Robokassa\W\Event::optionTitle() + * @used-by Dfe\Square\Facade\Card::brand() + * @used-by Dfe\Stripe\FE\Currency::getComment() + * @used-by Dfe\Stripe\Init\Action::redirectUrl() + * @used-by Dfe\Vantiv\Facade\Card::brandCodeE() + * @used-by Frugue\Store\Block\Switcher::map() + * @used-by Frugue\Store\Block\Switcher::name() * @param int|string $v * @param array(int|string => mixed) $map * @return int|string|mixed From dd28cb9d485420f17dc316d8eddd30d42bcf71f1 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:17:50 +0100 Subject: [PATCH 407/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/other/unset.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/lib/array/other/unset.php b/Core/lib/array/other/unset.php index 42b6d91a3..f28cfb7ed 100644 --- a/Core/lib/array/other/unset.php +++ b/Core/lib/array/other/unset.php @@ -10,10 +10,10 @@ * $this->unsetData(['can_use_default_value', 'can_use_website_value', 'scope']); * 2022-11-26 * We can not declare the argument $k as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm - * @used-by \Df\Config\Backend::value() - * @used-by \Df\Config\Backend\ArrayT::processI() - * @used-by \Df\Framework\Request::clean() - * @used-by \Dfe\Markdown\Observer\Catalog\ControllerAction::processPost() + * @used-by Df\Config\Backend::value() + * @used-by Df\Config\Backend\ArrayT::processI() + * @used-by Df\Framework\Request::clean() + * @used-by Dfe\Markdown\Observer\Catalog\ControllerAction::processPost() * @param array(string => mixed) $a * @param string|string[] ...$k * @return array(string => mixed) From ee3803b40326d27a25ebea8d298da0de61720fa8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:17:59 +0100 Subject: [PATCH 408/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/select/cahed/function.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/array/select/cahed/function.php b/Core/lib/array/select/cahed/function.php index 456233588..afcb1b0fb 100644 --- a/Core/lib/array/select/cahed/function.php +++ b/Core/lib/array/select/cahed/function.php @@ -6,8 +6,8 @@ * @see dfaoc() * @used-by df_credentials() * @used-by dfe_portal_module() - * @used-by \Df\Framework\Request::extra() - * @used-by \Df\OAuth\App::state() + * @used-by Df\Framework\Request::extra() + * @used-by Df\OAuth\App::state() * @param string|string[] $k [optional] * @param mixed|callable|null $d [optional] * @return mixed From c8911988ae15c0b3cbb31754450bb45984b0ab25 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:18:06 +0100 Subject: [PATCH 409/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/select/cahed/method.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/lib/array/select/cahed/method.php b/Core/lib/array/select/cahed/method.php index ad3e03517..ae28c7026 100644 --- a/Core/lib/array/select/cahed/method.php +++ b/Core/lib/array/select/cahed/method.php @@ -7,13 +7,13 @@ * `object` as an argument type is not supported by PHP < 7.2: https://github.com/mage2pro/core/issues/174#user-content-object * 2024-06-03 We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @see dfac() - * @used-by \Df\Config\A::get() - * @used-by \Df\Core\Visitor::r() - * @used-by \Df\Framework\Form\Element\Fieldset::v() - * @used-by \Df\Payment\TM::req() - * @used-by \Df\Payment\TM::res0() - * @used-by \Dfe\CheckoutCom\Response::a() - * @used-by \Dfe\FacebookLogin\Customer::r() + * @used-by Df\Config\A::get() + * @used-by Df\Core\Visitor::r() + * @used-by Df\Framework\Form\Element\Fieldset::v() + * @used-by Df\Payment\TM::req() + * @used-by Df\Payment\TM::res0() + * @used-by Dfe\CheckoutCom\Response::a() + * @used-by Dfe\FacebookLogin\Customer::r() * @param object $o * @param string|string[] $k [optional] * @param mixed|callable|null $d [optional] From 9fea64697df12082318e45ec276c0fa0edc6795c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:18:12 +0100 Subject: [PATCH 410/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/select/.php | 72 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/Core/lib/array/select/.php b/Core/lib/array/select/.php index e6dfef806..896488735 100644 --- a/Core/lib/array/select/.php +++ b/Core/lib/array/select/.php @@ -45,42 +45,42 @@ * @used-by dfac() * @used-by dfad() * @used-by dfaoc() - * @used-by \Alignet\Paymecheckout\Controller\Classic\Response::execute() (innomuebles.com, https://github.com/innomuebles/m2/issues/11) - * @used-by \Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) - * @used-by \Amasty\Checkout\Model\Optimization\LayoutJsDiffProcessor::moveArray(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/120) - * @used-by \Df\Config\Source::options() - * @used-by \Df\Core\Controller\Index\Index::execute() - * @used-by \Df\Core\O::a() - * @used-by \Df\Framework\Form\Element\Fieldset::select() - * @used-by \Df\Framework\Log\Dispatcher::handle() - * @used-by \Df\Framework\Plugin\Css\PreProcessor\File\FileList\Collator::afterCollate() - * @used-by \Df\Framework\Request::extra() - * @used-by \Dfe\FacebookLogin\Customer::responseJson() - * @used-by \Df\Payment\Charge::metadata() - * @used-by \Dfe\GoogleFont\ResponseValidator::short() - * @used-by \Dfe\GoogleFont\Font\Variant\Preview\Params::fromRequest() - * @used-by \Dfe\GoogleFont\Fonts::get() - * @used-by \Dfe\GoogleFont\Fonts::responseA() - * @used-by \Df\Payment\W\Reader::r() - * @used-by \Df\Payment\W\Reader::test() - * @used-by \Df\PaypalClone\Signer::v() - * @used-by \Df\Sentry\Client::__construct() - * @used-by \Df\Sentry\Client::capture() - * @used-by \Df\Sentry\Client::get_http_data() - * @used-by \Df\Sso\CustomerReturn::mc() - * @used-by \Df\Xml\G::importArray() - * @used-by \Dfe\AlphaCommerceHub\W\Event::providerRespL() - * @used-by \Dfe\AmazonLogin\Customer::res() - * @used-by \Dfe\CheckoutCom\Source\Prefill::config() - * @used-by \Dfe\CurrencyFormat\O::postProcess() - * @used-by \Dfe\TwoCheckout\Handler\RefundIssued::process() - * @used-by \Dfe\TwoCheckout\Method::charge() - * @used-by \DxMoto\Core\Observer\CanLog::execute() - * @used-by \Mageside\CanadaPostShipping\Model\Carrier::_doRatesRequest() (canadasatellite.ca) - * @used-by \Mangoit\MediaclipHub\Helper\Data::getMediaClipProjects() - * @used-by \TFC\Core\Observer\CanLog::execute() - * @used-by \TFC\GoogleShopping\Att\Brand::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/8) - * @used-by \VegAndTheCity\Core\Plugin\Mageplaza\Search\Helper\Data::afterGetProducts() + * @used-by Alignet\Paymecheckout\Controller\Classic\Response::execute() (innomuebles.com, https://github.com/innomuebles/m2/issues/11) + * @used-by Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) + * @used-by Amasty\Checkout\Model\Optimization\LayoutJsDiffProcessor::moveArray(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/120) + * @used-by Df\Config\Source::options() + * @used-by Df\Core\Controller\Index\Index::execute() + * @used-by Df\Core\O::a() + * @used-by Df\Framework\Form\Element\Fieldset::select() + * @used-by Df\Framework\Log\Dispatcher::handle() + * @used-by Df\Framework\Plugin\Css\PreProcessor\File\FileList\Collator::afterCollate() + * @used-by Df\Framework\Request::extra() + * @used-by Dfe\FacebookLogin\Customer::responseJson() + * @used-by Df\Payment\Charge::metadata() + * @used-by Dfe\GoogleFont\ResponseValidator::short() + * @used-by Dfe\GoogleFont\Font\Variant\Preview\Params::fromRequest() + * @used-by Dfe\GoogleFont\Fonts::get() + * @used-by Dfe\GoogleFont\Fonts::responseA() + * @used-by Df\Payment\W\Reader::r() + * @used-by Df\Payment\W\Reader::test() + * @used-by Df\PaypalClone\Signer::v() + * @used-by Df\Sentry\Client::__construct() + * @used-by Df\Sentry\Client::capture() + * @used-by Df\Sentry\Client::get_http_data() + * @used-by Df\Sso\CustomerReturn::mc() + * @used-by Df\Xml\G::importArray() + * @used-by Dfe\AlphaCommerceHub\W\Event::providerRespL() + * @used-by Dfe\AmazonLogin\Customer::res() + * @used-by Dfe\CheckoutCom\Source\Prefill::config() + * @used-by Dfe\CurrencyFormat\O::postProcess() + * @used-by Dfe\TwoCheckout\Handler\RefundIssued::process() + * @used-by Dfe\TwoCheckout\Method::charge() + * @used-by DxMoto\Core\Observer\CanLog::execute() + * @used-by Mageside\CanadaPostShipping\Model\Carrier::_doRatesRequest() (canadasatellite.ca) + * @used-by Mangoit\MediaclipHub\Helper\Data::getMediaClipProjects() + * @used-by TFC\Core\Observer\CanLog::execute() + * @used-by TFC\GoogleShopping\Att\Brand::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/8) + * @used-by VegAndTheCity\Core\Plugin\Mageplaza\Search\Helper\Data::afterGetProducts() * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l3/tabs.phtml (https://github.com/cabinetsbay/catalog/issues/9) * @param array(int|string => mixed) $a * @param string|string[]|int|null $k From b0e0c8a83fd40bffc1d4907cfa487fe910391c1e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:18:26 +0100 Subject: [PATCH 411/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/select/column.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/select/column.php b/Core/lib/array/select/column.php index af9bdf380..3f495bb63 100644 --- a/Core/lib/array/select/column.php +++ b/Core/lib/array/select/column.php @@ -15,7 +15,7 @@ * 3) https://php.net/manual/en/language.types.iterable.php * @used-by df_index() * @used-by df_product_images_additional() - * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() + * @used-by Wolf\Filter\Block\Navigation::hDropdowns() * @param Traversable|array(int|string => _DO|array(string => mixed)) $c * @param string|callable $fv * @param string|callable|null $fk [optional] From 4016f048ef06b0c47d1a217bca58e62842139870 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:18:31 +0100 Subject: [PATCH 412/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/select/getData.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/array/select/getData.php b/Core/lib/array/select/getData.php index 466dc1d00..6dafd4b5a 100644 --- a/Core/lib/array/select/getData.php +++ b/Core/lib/array/select/getData.php @@ -5,9 +5,9 @@ /** * 2020-01-29 * @used-by df_call() - * @used-by \Df\Config\Backend::fc() - * @used-by \Df\Payment\Block\Info::ii() - * @used-by \Df\Payment\Method::ii() + * @used-by Df\Config\Backend::fc() + * @used-by Df\Payment\Block\Info::ii() + * @used-by Df\Payment\Method::ii() * @param _DO|AE $o * @param string|string[] $k [optional] * @param mixed|callable|null $d [optional] From b3a76592256c13329598e66616ed9c6ac46728bd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:18:42 +0100 Subject: [PATCH 413/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/select/strict.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Core/lib/array/select/strict.php b/Core/lib/array/select/strict.php index 7003d5866..691710152 100644 --- a/Core/lib/array/select/strict.php +++ b/Core/lib/array/select/strict.php @@ -3,17 +3,17 @@ /** * 2022-11-27 - * 1) $onE is a function in @used-by \Df\PaypalClone\W\Event::statusT(). - * 2) $onE is a non-function custom value in many places, e.g. @used-by \Df\Payment\W\Strategy\ConfirmPending::_handle() + * 1) $onE is a function in @used-by Df\PaypalClone\W\Event::statusT(). + * 2) $onE is a non-function custom value in many places, e.g. @used-by Df\Payment\W\Strategy\ConfirmPending::_handle() * @see dftr() - * @used-by \Df\Payment\W\Reader::rr() - * @used-by \Df\Payment\W\Strategy\ConfirmPending::_handle() - * @used-by \Df\PaypalClone\W\Event::idE() - * @used-by \Df\PaypalClone\W\Event::signatureProvided() - * @used-by \Df\PaypalClone\W\Event::status() - * @used-by \Df\PaypalClone\W\Event::statusT() - * @used-by \Dfe\Qiwi\W\Event::ttCurrent() - * @used-by \Dfe\YandexKassa\W\Event::ttCurrent() + * @used-by Df\Payment\W\Reader::rr() + * @used-by Df\Payment\W\Strategy\ConfirmPending::_handle() + * @used-by Df\PaypalClone\W\Event::idE() + * @used-by Df\PaypalClone\W\Event::signatureProvided() + * @used-by Df\PaypalClone\W\Event::status() + * @used-by Df\PaypalClone\W\Event::statusT() + * @used-by Dfe\Qiwi\W\Event::ttCurrent() + * @used-by Dfe\YandexKassa\W\Event::ttCurrent() * @param string|int|null $k * @param F|bool|mixed $onE [optional] * @return array|mixed|null From 7f0e1abd669db8b733bbf905b39ca284917fd044 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:18:47 +0100 Subject: [PATCH 414/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/select/try.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/array/select/try.php b/Core/lib/array/select/try.php index 992f276c0..a497e67af 100644 --- a/Core/lib/array/select/try.php +++ b/Core/lib/array/select/try.php @@ -1,7 +1,7 @@ Date: Tue, 24 Sep 2024 10:18:58 +0100 Subject: [PATCH 415/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/deep.php | 58 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Core/lib/array/deep.php b/Core/lib/array/deep.php index a793007cf..304e93be1 100644 --- a/Core/lib/array/deep.php +++ b/Core/lib/array/deep.php @@ -17,32 +17,32 @@ * @used-by dfe_portal_module() * @used-by dfe_portal_plugins() * @used-by dfe_portal_stripe_customers() - * @used-by \Df\API\Client::resPath() - * @used-by \Df\Config\Backend::value() - * @used-by \Df\Config\Fieldset::_getHeaderCommentHtml() - * @used-by \Df\Config\Model\Config\Structure::tab() - * @used-by \Df\Config\Plugin\Model\Config\Structure\Element\Iterator\Tab::beforeSetElements() - * @used-by \Df\Config\Settings::_matrix() - * @used-by \Df\Core\O::offsetExists() - * @used-by \Df\Core\O::offsetGet() - * @used-by \Dfe\GingerPaymentsBase\Block\Info::psDetails() - * @used-by \Dfe\Oro\Test\Basic::t02_orders_stripe() - * @used-by \Df\Payment\ConfigProvider::p() - * @used-by \Df\StripeClone\Block\Info::cardDataFromChargeResponse() - * @used-by \Dfe\AllPay\W\Event::tlByCode() - * @used-by \Dfe\CheckoutCom\Handler::r() - * @used-by \Dfe\FacebookLogin\Customer::picture() - * @used-by \Dfe\Moip\API\Validator::short() - * @used-by \Dfe\Moip\Facade\Card::country() - * @used-by \Dfe\Moip\Facade\Card::owner() - * @used-by \Dfe\Paymill\Facade\O::toArray() - * @used-by \Dfe\Paymill\Test\CaseT::token() - * @used-by \Dfe\Square\Facade\Card::country() - * @used-by \Dfe\Stripe\Facade\Card::__construct() - * @used-by \Dfe\TwoCheckout\Method::charge() - * @used-by \Dfe\YandexKassa\Source\Option::map() - * @used-by \Doormall\Shipping\Partner\Entity::locations() - * @used-by \TemplateMonster\Megamenu\Observer\PrepareCategory::execute() (frugue.com) + * @used-by Df\API\Client::resPath() + * @used-by Df\Config\Backend::value() + * @used-by Df\Config\Fieldset::_getHeaderCommentHtml() + * @used-by Df\Config\Model\Config\Structure::tab() + * @used-by Df\Config\Plugin\Model\Config\Structure\Element\Iterator\Tab::beforeSetElements() + * @used-by Df\Config\Settings::_matrix() + * @used-by Df\Core\O::offsetExists() + * @used-by Df\Core\O::offsetGet() + * @used-by Dfe\GingerPaymentsBase\Block\Info::psDetails() + * @used-by Dfe\Oro\Test\Basic::t02_orders_stripe() + * @used-by Df\Payment\ConfigProvider::p() + * @used-by Df\StripeClone\Block\Info::cardDataFromChargeResponse() + * @used-by Dfe\AllPay\W\Event::tlByCode() + * @used-by Dfe\CheckoutCom\Handler::r() + * @used-by Dfe\FacebookLogin\Customer::picture() + * @used-by Dfe\Moip\API\Validator::short() + * @used-by Dfe\Moip\Facade\Card::country() + * @used-by Dfe\Moip\Facade\Card::owner() + * @used-by Dfe\Paymill\Facade\O::toArray() + * @used-by Dfe\Paymill\Test\CaseT::token() + * @used-by Dfe\Square\Facade\Card::country() + * @used-by Dfe\Stripe\Facade\Card::__construct() + * @used-by Dfe\TwoCheckout\Method::charge() + * @used-by Dfe\YandexKassa\Source\Option::map() + * @used-by Doormall\Shipping\Partner\Entity::locations() + * @used-by TemplateMonster\Megamenu\Observer\PrepareCategory::execute() (frugue.com) * @param array(string => mixed) $a * @param string|string[] $path * @param mixed $d [optional] @@ -91,8 +91,8 @@ function dfa_deep(array $a, $path = '', $d = null) {/** @var mixed|null $r */ /* /** * 2015-12-07 - * @used-by \Df\Core\O::offsetSet() - * @used-by \KingPalm\Core\Plugin\GroupedProduct\Ui\DataProvider\Product\Form\Modifier\Grouped::afterModifyMeta() + * @used-by Df\Core\O::offsetSet() + * @used-by KingPalm\Core\Plugin\GroupedProduct\Ui\DataProvider\Product\Form\Modifier\Grouped::afterModifyMeta() * @param array(string => mixed) $array * @param string|string[] $path * @param mixed $value @@ -131,7 +131,7 @@ function($v) use($l) {return !is_array($v) ? $v : dfa_deep_slice($v, $l - 1);}, * 2017-07-13 * @see dfa_unset() * @used-by dfa_deep_unset() - * @used-by \Df\Core\O::offsetUnset() + * @used-by Df\Core\O::offsetUnset() * @param array(string => mixed) $a * @param string|string[] $path * @throws DFE From 0f1b05f7ce751dce4933c2b13013c59daabc9bee Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:04 +0100 Subject: [PATCH 416/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/find.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Core/lib/array/find.php b/Core/lib/array/find.php index 06acb1e9c..67205bc42 100644 --- a/Core/lib/array/find.php +++ b/Core/lib/array/find.php @@ -30,16 +30,16 @@ * @used-by dfa_has_objects() * @used-by ikf_oi_pid() * @used-by mnr_recurring() - * @used-by \Df\Framework\Plugin\View\Layout::afterIsCacheable() - * @used-by \Df\Payment\Info\Report::addAfter() - * @used-by \Df\Payment\Method::amountFactor() - * @used-by \Df\Payment\TM::confirmed() - * @used-by \Dfe\Stripe\Method::cardType() - * @used-by \Frugue\Core\Plugin\Sales\Model\Quote::afterGetAddressesCollection() - * @used-by \Inkifi\Mediaclip\API\Entity\Order\Item::mProduct() - * @used-by \Inkifi\Mediaclip\Event::_areAllOIAvailableForDownload() - * @used-by \Inkifi\Mediaclip\Event::oi() - * @used-by \TFC\Core\Plugin\Catalog\Block\Product\View\GalleryOptions::afterGetOptionsJson() + * @used-by Df\Framework\Plugin\View\Layout::afterIsCacheable() + * @used-by Df\Payment\Info\Report::addAfter() + * @used-by Df\Payment\Method::amountFactor() + * @used-by Df\Payment\TM::confirmed() + * @used-by Dfe\Stripe\Method::cardType() + * @used-by Frugue\Core\Plugin\Sales\Model\Quote::afterGetAddressesCollection() + * @used-by Inkifi\Mediaclip\API\Entity\Order\Item::mProduct() + * @used-by Inkifi\Mediaclip\Event::_areAllOIAvailableForDownload() + * @used-by Inkifi\Mediaclip\Event::oi() + * @used-by TFC\Core\Plugin\Catalog\Block\Product\View\GalleryOptions::afterGetOptionsJson() * @param callable|iterable $a1 * @param callable|iterable $a2 * @param mixed|mixed[] $pAppend [optional] @@ -94,7 +94,7 @@ function df_find($a1, $a2, $pAppend = [], $pPrepend = [], int $keyPosition = 0, /** * 2020-04-25 * @used-by dfa_r() - * @used-by \VegAndTheCity\Core\Plugin\Mageplaza\Search\Helper\Data::afterGetProducts() + * @used-by VegAndTheCity\Core\Plugin\Mageplaza\Search\Helper\Data::afterGetProducts() * @param mixed $d [optional] * @return mixed|null */ From 8cce473a6574788b915380646d414acc03cd0e47 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:10 +0100 Subject: [PATCH 417/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/first.php | 64 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Core/lib/array/first.php b/Core/lib/array/first.php index 601ff075e..55c2e7c4b 100644 --- a/Core/lib/array/first.php +++ b/Core/lib/array/first.php @@ -17,19 +17,19 @@ * @used-by dfa_group() * @used-by dfa_try() * @used-by dfe_alphacommercehub_fix_amount_bug() - * @used-by \CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) - * @used-by \Df\Customer\AddAttribute\Customer::p() - * @used-by \Dfe\GoogleFont\ResponseValidator::short() - * @used-by \Df\Payment\TM::response() - * @used-by \Dfe\Color\Image::dist() - * @used-by \Inkifi\Consolidation\Processor::pid() - * @used-by \Inkifi\Mediaclip\API\Entity\Order\Item::mProduct() - * @used-by \Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::writeLocal() - * @used-by \Inkifi\Mediaclip\T\CaseT\Order\Item::t01() - * @used-by \Mangoit\MediaclipHub\Controller\Index\OrderStatusUpdateEndpoint::execute() - * @used-by \Mineralair\Core\Controller\Modal\Index::execute() - * @used-by \TFC\GoogleShopping\Att\Brand::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/8) - * @used-by \VegAndTheCity\Core\Plugin\Mageplaza\Search\Helper\Data::afterGetProducts() + * @used-by CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) + * @used-by Df\Customer\AddAttribute\Customer::p() + * @used-by Dfe\GoogleFont\ResponseValidator::short() + * @used-by Df\Payment\TM::response() + * @used-by Dfe\Color\Image::dist() + * @used-by Inkifi\Consolidation\Processor::pid() + * @used-by Inkifi\Mediaclip\API\Entity\Order\Item::mProduct() + * @used-by Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::writeLocal() + * @used-by Inkifi\Mediaclip\T\CaseT\Order\Item::t01() + * @used-by Mangoit\MediaclipHub\Controller\Index\OrderStatusUpdateEndpoint::execute() + * @used-by Mineralair\Core\Controller\Modal\Index::execute() + * @used-by TFC\GoogleShopping\Att\Brand::v() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/8) + * @used-by VegAndTheCity\Core\Plugin\Mageplaza\Search\Helper\Data::afterGetProducts() * @used-by frugue/core/view/frontend/templates/wishlist/item/column/image.phtml * @return mixed|null */ @@ -37,7 +37,7 @@ function df_first(iterable $i) {return !($a = df_ita($i)) ? null : reset($a);} /** * 2019-08-21 https://php.net/manual/en/function.array-key-first.php - * @used-by \Dfe\Color\Observer\ProductSaveBefore::execute() + * @used-by Dfe\Color\Observer\ProductSaveBefore::execute() * @param array(int|string => mixed) $a * @return string|int|null */ @@ -72,24 +72,24 @@ function df_first_key(array $a) { * @used-by df_url_path() * @used-by df_url_staged() * @used-by ikf_eti() - * @used-by \Df\Config\Backend::value() - * @used-by \Df\Core\Text\Regex::match() - * @used-by \Df\Customer\Settings\BillingAddress::disabled() - * @used-by \Df\Framework\Form\Element::uidSt() - * @used-by \Df\Framework\Plugin\Session\SessionManager::beforeStart() - * @used-by \Df\Payment\Operation::customerNameL() - * @used-by \Df\Payment\Source\API\Key\Testable::_test() - * @used-by \Df\Payment\TM::response() - * @used-by \Df\PaypalClone\Init\Action::redirectParams() - * @used-by \Df\StripeClone\Payer::cardId() - * @used-by \Dfe\AlphaCommerceHub\W\Event::providerRespL() - * @used-by \Dfe\AmazonLogin\Customer::nameLast() - * @used-by \Dfe\Omise\Facade\Customer::cardAdd() - * @used-by \Dfe\Salesforce\Test\Basic::t02_the_latest_version() - * @used-by \Dfe\Stripe\W\Handler\Charge\Refunded::amount() - * @used-by \Dfe\Stripe\W\Handler\Charge\Refunded::eTransId() - * @used-by \KingPalm\Core\Plugin\Aitoc\OrdersExportImport\Model\Processor\Config\ExportConfigMapper::aroundToConfig() - * @used-by \TFC\Core\Router::match() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/40) + * @used-by Df\Config\Backend::value() + * @used-by Df\Core\Text\Regex::match() + * @used-by Df\Customer\Settings\BillingAddress::disabled() + * @used-by Df\Framework\Form\Element::uidSt() + * @used-by Df\Framework\Plugin\Session\SessionManager::beforeStart() + * @used-by Df\Payment\Operation::customerNameL() + * @used-by Df\Payment\Source\API\Key\Testable::_test() + * @used-by Df\Payment\TM::response() + * @used-by Df\PaypalClone\Init\Action::redirectParams() + * @used-by Df\StripeClone\Payer::cardId() + * @used-by Dfe\AlphaCommerceHub\W\Event::providerRespL() + * @used-by Dfe\AmazonLogin\Customer::nameLast() + * @used-by Dfe\Omise\Facade\Customer::cardAdd() + * @used-by Dfe\Salesforce\Test\Basic::t02_the_latest_version() + * @used-by Dfe\Stripe\W\Handler\Charge\Refunded::amount() + * @used-by Dfe\Stripe\W\Handler\Charge\Refunded::eTransId() + * @used-by KingPalm\Core\Plugin\Aitoc\OrdersExportImport\Model\Processor\Config\ExportConfigMapper::aroundToConfig() + * @used-by TFC\Core\Router::match() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/40) * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/products/not-empty.phtml (https://github.com/cabinetsbay/catalog/issues/38) * @return mixed|null */ From 386b0b52953470e038639f388e34925f6c5a1960 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:15 +0100 Subject: [PATCH 418/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/insert.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/array/insert.php b/Core/lib/array/insert.php index 6c20327ee..20123b6e5 100644 --- a/Core/lib/array/insert.php +++ b/Core/lib/array/insert.php @@ -8,8 +8,8 @@ * 2016-11-23 * Достоинство этой функции перед @uses array_splice() ещё и в отсутствии требования передачи первого параметра по ссылке. * 2016-11-24 Отныне функция правильно работает с ассоциативными массивами. - * @used-by \Df\Sso\Source\Button\Type\UNL::map() - * @used-by \Dfe\SecurePay\Signer::sign() + * @used-by Df\Sso\Source\Button\Type\UNL::map() + * @used-by Dfe\SecurePay\Signer::sign() * @param mixed|mixed[] $add */ function dfa_insert(array $a, int $pos, $add):array { From 159e5a972f7ef3a2c801cceb65610ac6cd8f7f86 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:21 +0100 Subject: [PATCH 419/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/is.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/lib/array/is.php b/Core/lib/array/is.php index 4500d3ae0..c3690757d 100644 --- a/Core/lib/array/is.php +++ b/Core/lib/array/is.php @@ -15,8 +15,8 @@ * @used-by dfa_deep_slice() * @used-by dfa_insert() * @used-by dfak_transform() - * @used-by \Df\Payment\ConfigProvider::configOptions() - * @used-by \Df\Payment\Method::isAvailable() + * @used-by Df\Payment\ConfigProvider::configOptions() + * @used-by Df\Payment\Method::isAvailable() * @param array(int|string => mixed) $a */ function array_is_list(array $a):bool { @@ -53,8 +53,8 @@ function array_is_list(array $a):bool { * @used-by df_error_create() * @used-by df_filter_f() * @used-by df_ksort() - * @used-by \Df\Core\Exception::__construct() - * @used-by \Df\Xml\G::importArray() + * @used-by Df\Core\Exception::__construct() + * @used-by Df\Xml\G::importArray() * @param array(int|string => mixed)|mixed $a */ function df_is_assoc($a):bool {return is_array($a) && (!$a || !array_is_list($a));} @@ -62,7 +62,7 @@ function df_is_assoc($a):bool {return is_array($a) && (!$a || !array_is_list($a) /** * 2023-07-25 * @uses is_object() - * @used-by \Df\Qa\Dumper::dumpArray() + * @used-by Df\Qa\Dumper::dumpArray() * @param iterable $a */ function dfa_has_objects($a):bool {return !!df_find($a, 'is_object', [], [], 0, true);} \ No newline at end of file From 92bf2d1c270226ef344b60d51c5125498c3b2144 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:26 +0100 Subject: [PATCH 420/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/merge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/array/merge.php b/Core/lib/array/merge.php index c7abe2252..5a42278df 100644 --- a/Core/lib/array/merge.php +++ b/Core/lib/array/merge.php @@ -61,8 +61,8 @@ function dfa_merge_numeric(array $r, array $b):array { * @used-by df_log_l() * @used-by df_oi_add() * @used-by df_sentry() - * @used-by \Dfe\AlphaCommerceHub\W\Reader::reqFilter() - * @used-by \Dfe\TBCBank\Test\CaseT\Regular::t02() + * @used-by Dfe\AlphaCommerceHub\W\Reader::reqFilter() + * @used-by Dfe\TBCBank\Test\CaseT\Regular::t02() * @param array(string => mixed) $old * @param array(string => mixed) $new * @return array(string => mixed) From d9366b9bee733c2f5203a6ccafd6482df2bbf146 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:33 +0100 Subject: [PATCH 421/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/part.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/lib/array/part.php b/Core/lib/array/part.php index 64947119a..c5417225f 100644 --- a/Core/lib/array/part.php +++ b/Core/lib/array/part.php @@ -4,9 +4,9 @@ * Отсекает последний элемент массива и возвращает «голову» (массив оставшихся элементов). * Похожая системная функция @see array_pop() возвращает отсечённый последний элемент. * Противоположная системная функция @see df_tail() отсекает первый элемент массива. - * @used-by \Df\Config\Comment::groupPath() - * @used-by \Df\Config\Source::sibling() - * @used-by \Mineralair\Core\Controller\Modal\Index::execute() + * @used-by Df\Config\Comment::groupPath() + * @used-by Df\Config\Source::sibling() + * @used-by Mineralair\Core\Controller\Modal\Index::execute() */ function df_head(array $a):array {return array_slice($a, 0, -1);} @@ -16,7 +16,7 @@ function df_head(array $a):array {return array_slice($a, 0, -1);} * so I convert `0` and other empty values to `null`. * @used-by df_bt() * @used-by df_product_images_additional() - * @used-by \Df\Qa\Trace\Frame::url() + * @used-by Df\Qa\Trace\Frame::url() */ function df_slice(array $a, int $offset, int $length = 0):array {return array_slice($a, $offset, df_etn($length));} @@ -28,8 +28,8 @@ function df_slice(array $a, int $offset, int $length = 0):array {return array_sl * @used-by df_error_create() * @used-by df_sprintf_strict() * @used-by df_zf_http_last_req() - * @used-by \Df\Core\Text\Regex::match() - * @used-by \Doormall\Shipping\Partner\Entity::locations() + * @used-by Df\Core\Text\Regex::match() + * @used-by Doormall\Shipping\Partner\Entity::locations() * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l3/tabs.phtml (https://github.com/cabinetsbay/catalog/issues/10) */ function df_tail(array $a):array {return array_slice($a, 1);} \ No newline at end of file From 779f811f002fc9a6de78a1575fdf9bb564a461f2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:39 +0100 Subject: [PATCH 422/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/sort.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Core/lib/array/sort.php b/Core/lib/array/sort.php index 6c84cf626..2695b313a 100644 --- a/Core/lib/array/sort.php +++ b/Core/lib/array/sort.php @@ -7,10 +7,10 @@ * @used-by df_ksort_r() * @used-by df_stores() * @used-by df_trd_set() - * @used-by \Df\Qa\Dumper::dumpArrayElements() - * @used-by \Dfe\Dynamics365\API\Facade::p() - * @used-by \Dfe\Qiwi\Signer::sign() - * @used-by \Dfe\Robokassa\Api\Options::p() + * @used-by Df\Qa\Dumper::dumpArrayElements() + * @used-by Dfe\Dynamics365\API\Facade::p() + * @used-by Dfe\Qiwi\Signer::sign() + * @used-by Dfe\Robokassa\Api\Options::p() * @param array(int|string => mixed) $a * @return array(int|string => mixed) */ @@ -94,10 +94,10 @@ function df_ksort_r_ci(array $a):array {return array_is_list($a) * 3) $isGet = true in: * @used-by df_oqi_leafs() * @used-by dfe_portal_stripe_customers() - * @used-by \Dfe\Oro\Test\Basic::t02_orders_stripe() + * @used-by Dfe\Oro\Test\Basic::t02_orders_stripe() * 4) $l is used in: * @used-by df_oqi_leafs() - * @used-by \Df\Directory\Model\ResourceModel\Country\Collection::mapFromCodeToName() + * @used-by Df\Directory\Model\ResourceModel\Country\Collection::mapFromCodeToName() * @see df_ksort() * @see df_sort_posix() * @used-by df_countries_options() @@ -108,17 +108,17 @@ function df_ksort_r_ci(array $a):array {return array_is_list($a) * @used-by df_sort_posix() * @used-by df_zf_http_last_req() * @used-by dfe_portal_stripe_customers() - * @used-by \Df\Config\Backend\ArrayT::processI() - * @used-by \Df\Directory\Model\ResourceModel\Country\Collection::mapFromCodeToName() - * @used-by \Df\Framework\Plugin\Css\PreProcessor\File\FileList\Collator::afterCollate() - * @used-by \Df\Payment\Info\Report::sort() - * @used-by \Df\Payment\TM::tResponses() - * @used-by \Dfe\Color\Image::probabilities() - * @used-by \Dfe\Oro\Test\Basic::t02_orders_stripe() - * @used-by \Dfe\Robokassa\Api\Options::p() - * @used-by \Dfe\YandexKassa\Source\Option::map() - * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() - * @used-by \Wolf\Filter\Controller\Index\Change::execute() + * @used-by Df\Config\Backend\ArrayT::processI() + * @used-by Df\Directory\Model\ResourceModel\Country\Collection::mapFromCodeToName() + * @used-by Df\Framework\Plugin\Css\PreProcessor\File\FileList\Collator::afterCollate() + * @used-by Df\Payment\Info\Report::sort() + * @used-by Df\Payment\TM::tResponses() + * @used-by Dfe\Color\Image::probabilities() + * @used-by Dfe\Oro\Test\Basic::t02_orders_stripe() + * @used-by Dfe\Robokassa\Api\Options::p() + * @used-by Dfe\YandexKassa\Source\Option::map() + * @used-by Wolf\Filter\Block\Navigation::hDropdowns() + * @used-by Wolf\Filter\Controller\Index\Change::execute() * @param array(int|string => mixed) $a * @param Closure|string|null $f [optional] * @return array(int|string => mixed) @@ -185,7 +185,7 @@ function df_sort(array $a, $f = null, bool $isGet = false, string $l = ''):array /** * 2018-05-21 - * @used-by \Df\Config\Source\Block::map() + * @used-by Df\Config\Source\Block::map() * @param array(int|string => mixed) $a * @return array(int|string => mixed) */ @@ -230,7 +230,7 @@ function df_sort_a(array $a):array {asort($a); return $a;} * 5.2) The first 2 elements of the test array are inverted with other locales, e.g.: * 5.2.1) 'en_US': https://3v4l.org/FMcdf * 5.2.2) 'root': https://3v4l.org/Cevuk - * @used-by \CabinetsBay\Catalog\B\Category::images() (https://github.com/cabinetsbay/catalog/issues/28) + * @used-by CabinetsBay\Catalog\B\Category::images() (https://github.com/cabinetsbay/catalog/issues/28) * @param array(int|string => mixed) $a * @param Closure|string|null $f [optional] * @return array(int|string => mixed) From 6e68a30fc6a6273b138f193f16da323c908ba62e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:45 +0100 Subject: [PATCH 423/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/array/unpack.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/array/unpack.php b/Core/lib/array/unpack.php index 48b1646bb..63e4ee68a 100644 --- a/Core/lib/array/unpack.php +++ b/Core/lib/array/unpack.php @@ -13,8 +13,8 @@ * @see df_args() * @see dfa_unpack() * @used-by df_contains() - * @used-by \Df\Payment\TM::req() - * @used-by \Dfe\CheckoutCom\Response::a() + * @used-by Df\Payment\TM::req() + * @used-by Dfe\CheckoutCom\Response::a() * @return mixed|mixed[] */ function df_arg(array $a) {return isset($a[0]) && !isset($a[1]) ? $a[0] : $a;} From 15e0b5aab7d5147c7fc6064d84621b87b94bf7ed Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:50 +0100 Subject: [PATCH 424/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cache/clean-types.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/cache/clean-types.php b/Core/lib/cache/clean-types.php index 4e79666b1..660e65fca 100644 --- a/Core/lib/cache/clean-types.php +++ b/Core/lib/cache/clean-types.php @@ -5,7 +5,7 @@ /** * 2021-09-22 - * @used-by \Df\Directory\Plugin\Model\Currency::afterSaveRates() + * @used-by Df\Directory\Plugin\Model\Currency::afterSaveRates() */ function df_cache_clean_blocks():void {df_cache_clean_type(TBlock::TYPE_IDENTIFIER);} @@ -17,7 +17,7 @@ function df_cache_clean_cfg():void {df_cache_clean_type(TConfig::TYPE_IDENTIFIER /** * 2021-09-22 - * @used-by \Df\Directory\Plugin\Model\Currency::afterSaveRates() + * @used-by Df\Directory\Plugin\Model\Currency::afterSaveRates() */ function df_cache_clean_pages():void {df_cache_clean_type(TPage::TYPE_IDENTIFIER);} From 51f832e371035c931aa8e574e6b94c2f42732df0 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:19:55 +0100 Subject: [PATCH 425/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cache/clean.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/cache/clean.php b/Core/lib/cache/clean.php index b3ea69562..8fe2d8d94 100644 --- a/Core/lib/cache/clean.php +++ b/Core/lib/cache/clean.php @@ -4,8 +4,8 @@ /** * 2017-06-30 «How does `Flush Cache Storage` work?» https://mage2.pro/t/4118 * @see \Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute() - * @used-by \Df\OAuth\App::getAndSaveTheRefreshToken() - * @used-by \Dfe\Moip\Backend\Enable::dfSaveAfter() + * @used-by Df\OAuth\App::getAndSaveTheRefreshToken() + * @used-by Dfe\Moip\Backend\Enable::dfSaveAfter() */ function df_cache_clean():void { df_map(function(IFrontend $f) {$f->getBackend()->clean();}, df_cache_pool()); @@ -23,7 +23,7 @@ function df_cache_clean():void { * 2017-06-30 «How does `Flush Cache Storage` work?» https://mage2.pro/t/4118 * @see \Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute() * @uses \Magento\Framework\App\Cache\TypeList::cleanType() - * @used-by \Df\API\Client::p() + * @used-by Df\API\Client::p() */ function df_cache_clean_tag(string $tag):void { df_cache()->clean([$tag]); From 1fc2b52bf99f5f45fdbf5a247349f771d8a354ce Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:20:01 +0100 Subject: [PATCH 426/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cache/dfc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/lib/cache/dfc.php b/Core/lib/cache/dfc.php index 6d3fc9acb..2f4f9e9ea 100644 --- a/Core/lib/cache/dfc.php +++ b/Core/lib/cache/dfc.php @@ -25,15 +25,15 @@ * Today I have noticed that you can use a void-result $f with dfc(): https://3v4l.org/CYJ1X * So I removed df_once(). * 3) The methods which use dfc() with a void-result $f: - * @used-by \Df\Framework\Form\Element\Select2::setRenderer() - * @used-by \Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterSetForm() - * @used-by \Df\Sso\Button::_prepareLayout() + * @used-by Df\Framework\Form\Element\Select2::setRenderer() + * @used-by Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterSetForm() + * @used-by Df\Sso\Button::_prepareLayout() * 2024-06-03 We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @see df_no_rec() * @see df_prop() * @see dfaoc() * @used-by dfaoc() - * @used-by \CabinetsBay\Catalog\B\Category::title() (https://github.com/cabinetsbay/catalog/issues/22) + * @used-by CabinetsBay\Catalog\B\Category::title() (https://github.com/cabinetsbay/catalog/issues/22) * @param object $o * @return mixed */ From f805407928498d169b1dcef1978da60faaa446bd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:20:06 +0100 Subject: [PATCH 427/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cache/dfcf.php | 80 ++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/Core/lib/cache/dfcf.php b/Core/lib/cache/dfcf.php index b0a9f93d8..d01164fec 100644 --- a/Core/lib/cache/dfcf.php +++ b/Core/lib/cache/dfcf.php @@ -83,46 +83,46 @@ * @used-by dfpm_c() * @used-by dfpm_code() * @used-by dfs_con() - * @used-by \Df\API\Facade::s() - * @used-by \Df\Config\Settings::_a() - * @used-by \Df\Config\Settings::convention() - * @used-by \Df\Config\Settings::s() - * @used-by \Df\Config\Source::s() - * @used-by \Df\Config\Source\WaitPeriodType::calculate() - * @used-by \Df\Core\R\ConT::generic() - * @used-by \Df\Core\Session::s() - * @used-by \Df\Core\Text\Regex::getErrorCodeMap() - * @used-by \Df\Core\Visitor::sp() - * @used-by \Df\Directory\FE\Currency::map() - * @used-by \Df\Framework\Log\Handler\Info::lb() - * @used-by \Df\Framework\Request::extraKeysRaw() - * @used-by \Df\OAuth\App::state() - * @used-by \Df\Payment\Choice::f() - * @used-by \Df\Payment\Currency::f() - * @used-by \Df\Payment\Facade::s() - * @used-by \Df\Payment\Init\Action::sg() - * @used-by \Df\Payment\Method::codeS() - * @used-by \Df\Payment\Method::sg() - * @used-by \Df\Payment\TID::s() - * @used-by \Df\Payment\TM::s() - * @used-by \Df\Payment\Url::f() - * @used-by \Df\Payment\W\F::s() - * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Df\Shipping\Method::codeS() - * @used-by \Df\Shipping\Method::sg() - * @used-by \Df\Sso\Button::sModule() - * @used-by \Df\Sso\Css::isAccConfirmation() - * @used-by \Df\Sso\Css::isRegCompletion() - * @used-by \Df\StripeClone\CardFormatter::s() - * @used-by \Df\StripeClone\P\Charge::sn() - * @used-by \Dfe\AllPay\W\Event::time() - * @used-by \Dfe\Color\Image::optsM() - * @used-by \Dfe\Color\Image::palette() - * @used-by \Dfe\Facebook\I::init() - * @used-by \Dfe\Robokassa\Api\Options::map() - * @used-by \Dfe\Robokassa\Api\Options::p() - * @used-by \Dfe\Sift\Payload\Promotion\Discount::desc() - * @used-by \Dfe\Stripe\Facade\Token::trimmed() + * @used-by Df\API\Facade::s() + * @used-by Df\Config\Settings::_a() + * @used-by Df\Config\Settings::convention() + * @used-by Df\Config\Settings::s() + * @used-by Df\Config\Source::s() + * @used-by Df\Config\Source\WaitPeriodType::calculate() + * @used-by Df\Core\R\ConT::generic() + * @used-by Df\Core\Session::s() + * @used-by Df\Core\Text\Regex::getErrorCodeMap() + * @used-by Df\Core\Visitor::sp() + * @used-by Df\Directory\FE\Currency::map() + * @used-by Df\Framework\Log\Handler\Info::lb() + * @used-by Df\Framework\Request::extraKeysRaw() + * @used-by Df\OAuth\App::state() + * @used-by Df\Payment\Choice::f() + * @used-by Df\Payment\Currency::f() + * @used-by Df\Payment\Facade::s() + * @used-by Df\Payment\Init\Action::sg() + * @used-by Df\Payment\Method::codeS() + * @used-by Df\Payment\Method::sg() + * @used-by Df\Payment\TID::s() + * @used-by Df\Payment\TM::s() + * @used-by Df\Payment\Url::f() + * @used-by Df\Payment\W\F::s() + * @used-by Df\Qa\Trace\Formatter::p() + * @used-by Df\Shipping\Method::codeS() + * @used-by Df\Shipping\Method::sg() + * @used-by Df\Sso\Button::sModule() + * @used-by Df\Sso\Css::isAccConfirmation() + * @used-by Df\Sso\Css::isRegCompletion() + * @used-by Df\StripeClone\CardFormatter::s() + * @used-by Df\StripeClone\P\Charge::sn() + * @used-by Dfe\AllPay\W\Event::time() + * @used-by Dfe\Color\Image::optsM() + * @used-by Dfe\Color\Image::palette() + * @used-by Dfe\Facebook\I::init() + * @used-by Dfe\Robokassa\Api\Options::map() + * @used-by Dfe\Robokassa\Api\Options::p() + * @used-by Dfe\Sift\Payload\Promotion\Discount::desc() + * @used-by Dfe\Stripe\Facade\Token::trimmed() * @return mixed */ function dfcf(Closure $f, array $a = [], array $tags = [], bool $unique = true, int $offset = 0) { From 1564df52104c8bd8ab8f497a98540e4e88e82fe2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:20:12 +0100 Subject: [PATCH 428/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cache/o.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/cache/o.php b/Core/lib/cache/o.php index 6411b41e0..4065b039a 100644 --- a/Core/lib/cache/o.php +++ b/Core/lib/cache/o.php @@ -32,6 +32,6 @@ function df_cache_type_list() {return df_o(ITypeList::class);} * @used-by df_cache_clean() * @used-by df_cache_clean_tag() * @used-by dfcf() - * @used-by \Df\Payment\Method::sgReset() + * @used-by Df\Payment\Method::sgReset() */ function df_ram():RAM {return RAM::s();} \ No newline at end of file From 09499ef6810e652bf352e62da993821360e1a7db Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:20:18 +0100 Subject: [PATCH 429/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cache/other.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Core/lib/cache/other.php b/Core/lib/cache/other.php index 8a4dbdc6b..8ec298b35 100644 --- a/Core/lib/cache/other.php +++ b/Core/lib/cache/other.php @@ -23,14 +23,14 @@ function df_cache_enabled(string $type):bool { * 2022-11-23 `callable` as an argument type is supported by PHP ≥ 5.4: * https://github.com/mage2pro/core/issues/174#user-content-callable * @used-by dfe_portal_stripe_customers() - * @used-by \Df\API\Client::p() - * @used-by \Dfe\GingerPaymentsBase\Api::idealBanks() - * @used-by \Dfe\GoogleFont\Controller\Index\Index::execute() - * @used-by \Df\Payment\Observer\DataProvider\SearchResult::execute() - * @used-by \Dfe\Robokassa\Api\Options::p() - * @used-by \Doormall\Shipping\Partner\Entity::locations() - * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() - * @used-by \Wolf\Filter\Controller\Index\Change::execute() + * @used-by Df\API\Client::p() + * @used-by Dfe\GingerPaymentsBase\Api::idealBanks() + * @used-by Dfe\GoogleFont\Controller\Index\Index::execute() + * @used-by Df\Payment\Observer\DataProvider\SearchResult::execute() + * @used-by Dfe\Robokassa\Api\Options::p() + * @used-by Doormall\Shipping\Partner\Entity::locations() + * @used-by Wolf\Filter\Block\Navigation::hDropdowns() + * @used-by Wolf\Filter\Controller\Index\Change::execute() * @param string|string[] $k * @param string[] $tags [optional] * @param mixed ...$args [optional] @@ -68,8 +68,8 @@ function df_cache_get_simple($k, callable $f, array $tags = [], ...$args) {retur /** * 2015-08-13 - * @used-by \Df\Sales\Observer\OrderPlaceAfter::execute() - * @used-by \Dfe\Color\Image::dominant() + * @used-by Df\Sales\Observer\OrderPlaceAfter::execute() + * @used-by Dfe\Color\Image::dominant() * @return string|false */ function df_cache_load(string $key) {return df_cache()->load($key);} @@ -78,8 +78,8 @@ function df_cache_load(string $key) {return df_cache()->load($key);} * 2016-07-18 * 2017-02-01 It will cache forever if $lifeTime is null: https://mage2.pro/t/2584 * @used-by df_cache_get_simple() - * @used-by \Df\Sales\Observer\OrderPlaceAfter::execute() - * @used-by \Dfe\Color\Image::dominant() + * @used-by Df\Sales\Observer\OrderPlaceAfter::execute() + * @used-by Dfe\Color\Image::dominant() * @param mixed $data * @param string[] $tags [optional] * @param int|null $lifeTime [optional] From ead886d7590226d318a9d0a5fae7390e41a6fe77 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:20:25 +0100 Subject: [PATCH 430/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/caller/entry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/caller/entry.php b/Core/lib/caller/entry.php index e496ca147..8c150aad1 100644 --- a/Core/lib/caller/entry.php +++ b/Core/lib/caller/entry.php @@ -13,7 +13,7 @@ * @used-by df_caller_mf() * @used-by df_log_l() * @used-by df_sentry() - * @used-by \Df\Framework\Log\Dispatcher::handle() + * @used-by Df\Framework\Log\Dispatcher::handle() * @param T|int|null|array(array(string => string|int)) $p [optional] * @return array(string => string|int) */ From fe18f842e87e96494c4d840d89ba90c4dd9b8f6b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:20:31 +0100 Subject: [PATCH 431/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/caller/other.php | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/Core/lib/caller/other.php b/Core/lib/caller/other.php index cc1a0b5d8..eb226eaf8 100644 --- a/Core/lib/caller/other.php +++ b/Core/lib/caller/other.php @@ -16,41 +16,41 @@ function df_caller_c(int $o = 0):string {return df_first(df_explode_method(df_ca * 2020-07-08 The function's new implementation is from the previous df_caller_ff() function. * @used-by df_oqi_amount() * @used-by df_prop() - * @used-by \Df\API\Facade::p() - * @used-by \Df\API\Settings::probablyTestable() - * @used-by \Df\API\Settings::testable() - * @used-by \Df\API\Settings::testableB() - * @used-by \Df\API\Settings::testableGeneric() - * @used-by \Df\API\Settings::testableP() - * @used-by \Df\API\Settings::testablePV() - * @used-by \Df\Config\O::filter() - * @used-by \Df\Config\O::v() - * @used-by \Df\Config\O::v0() - * @used-by \Df\Config\Settings::_a() - * @used-by \Df\Config\Settings::_font() - * @used-by \Df\Config\Settings::_matrix() - * @used-by \Df\Config\Settings::b() - * @used-by \Df\Config\Settings::bv() - * @used-by \Df\Config\Settings::csv() - * @used-by \Df\Config\Settings::i() - * @used-by \Df\Config\Settings::json() - * @used-by \Df\Config\Settings::nat() - * @used-by \Df\Config\Settings::nat0() - * @used-by \Df\Config\Settings::nwb() - * @used-by \Df\Config\Settings::nwbn() - * @used-by \Df\Config\Settings::p() - * @used-by \Df\Config\Settings::v() - * @used-by \Df\Config\Source\WaitPeriodType::calculate() - * @used-by \Df\Payment\Method::action() - * @used-by \Df\Payment\Method::convert() - * @used-by \Df\Payment\TM::response() - * @used-by \Df\PaypalClone\Signer::_sign() - * @used-by \Df\StripeClone\Method::transInfo() - * @used-by \Df\Typography\Font::size() - * @used-by \Dfe\AlphaCommerceHub\API\Facade\BankCard::op() - * @used-by \Dfe\AlphaCommerceHub\Method::transInfo() - * @used-by \Dfe\Dynamics365\Test\TestCase::p() - * @used-by \KingPalm\B2B\Schema::f() + * @used-by Df\API\Facade::p() + * @used-by Df\API\Settings::probablyTestable() + * @used-by Df\API\Settings::testable() + * @used-by Df\API\Settings::testableB() + * @used-by Df\API\Settings::testableGeneric() + * @used-by Df\API\Settings::testableP() + * @used-by Df\API\Settings::testablePV() + * @used-by Df\Config\O::filter() + * @used-by Df\Config\O::v() + * @used-by Df\Config\O::v0() + * @used-by Df\Config\Settings::_a() + * @used-by Df\Config\Settings::_font() + * @used-by Df\Config\Settings::_matrix() + * @used-by Df\Config\Settings::b() + * @used-by Df\Config\Settings::bv() + * @used-by Df\Config\Settings::csv() + * @used-by Df\Config\Settings::i() + * @used-by Df\Config\Settings::json() + * @used-by Df\Config\Settings::nat() + * @used-by Df\Config\Settings::nat0() + * @used-by Df\Config\Settings::nwb() + * @used-by Df\Config\Settings::nwbn() + * @used-by Df\Config\Settings::p() + * @used-by Df\Config\Settings::v() + * @used-by Df\Config\Source\WaitPeriodType::calculate() + * @used-by Df\Payment\Method::action() + * @used-by Df\Payment\Method::convert() + * @used-by Df\Payment\TM::response() + * @used-by Df\PaypalClone\Signer::_sign() + * @used-by Df\StripeClone\Method::transInfo() + * @used-by Df\Typography\Font::size() + * @used-by Dfe\AlphaCommerceHub\API\Facade\BankCard::op() + * @used-by Dfe\AlphaCommerceHub\Method::transInfo() + * @used-by Dfe\Dynamics365\Test\TestCase::p() + * @used-by KingPalm\B2B\Schema::f() */ function df_caller_f(int $o = 0):string {return df_caller_entry(++$o)['function'];} @@ -108,7 +108,7 @@ function df_caller_ml(int $o = 0):string {return df_caller_m(++$o) . '()';} * @used-by df_log_l() * @used-by df_sentry() * @used-by df_sentry_m() - * @used-by \Df\Framework\Log\Handler\Info::lb() + * @used-by Df\Framework\Log\Handler\Info::lb() * @param T|int $p */ function df_caller_module($p = 0):string {return !($e = df_caller_entry_m(df_bt_inc($p))) ? 'Df_Core' : ( From 6d36235a9dd00bf3056f2ad0a88c94965d4e18c9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:20:54 +0100 Subject: [PATCH 432/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/js/data-mage-init.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/lib/js/data-mage-init.php b/Core/lib/js/data-mage-init.php index f673c2264..c2dc7b838 100644 --- a/Core/lib/js/data-mage-init.php +++ b/Core/lib/js/data-mage-init.php @@ -36,10 +36,10 @@ * оказывается ассоциированным с неким конкретным элементом HTML: * этим данный способ инициализации отличается от способа функции @see df_js(), * которая не привязывает код JavaScript браузерного компонента ни к какому элементу HTML. - * @used-by \Df\Sso\Button\Js::attributes() - * @used-by \Dfe\Klarna\Button::_toHtml() - * @used-by \Dfe\Stripe\Block\Multishipping::_toHtml() - * @used-by \KingPalm\B2B\Block\Registration::_toHtml() + * @used-by Df\Sso\Button\Js::attributes() + * @used-by Dfe\Klarna\Button::_toHtml() + * @used-by Dfe\Stripe\Block\Multishipping::_toHtml() + * @used-by KingPalm\B2B\Block\Registration::_toHtml() * @param string|object|null $m * $m could be: * 1) A module name: «A_B» @@ -55,7 +55,7 @@ function df_widget($m, $s = null, array $p = []):array {return ['data-mage-init' * 2019-11-13 * I intentionally use `!is_null($s)` instead of `$s ?:`. * 1) `is_null($s)` means that $s should be `main`. - * it is @used-by \KingPalm\B2B\Block\Registration::_toHtml(): + * it is @used-by KingPalm\B2B\Block\Registration::_toHtml(): * https://github.com/kingpalm-com/b2b/blob/1.6.1/Block/Registration.php#L43 * 2) `'' === $s` means that $s should not be added to the result at all. */ From e310fe1a62fc7d356b2989803405a6a280703f29 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:21:02 +0100 Subject: [PATCH 433/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/js/main.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Core/lib/js/main.php b/Core/lib/js/main.php index 3ae0c1c09..0bc674a70 100644 --- a/Core/lib/js/main.php +++ b/Core/lib/js/main.php @@ -16,21 +16,21 @@ * 2.4) 2017-10-16: `null`, if $script is an absolute URL. * @used-by df_fe_init() * @used-by df_js_c() - * @used-by \CanadaSatellite\Amelia\Block::_toHtml() (canadasatellite.ca, https://github.com/canadasatellite-ca/amelia/issues/1) - * @used-by \Df\Checkout\B\Messages::_toHtml() - * @used-by \Df\Checkout\B\Payment::_toHtml() - * @used-by \Df\Intl\Js::_toHtml() - * @used-by \Dfe\Phone\Js::_toHtml() - * @used-by \Df\Sso\Css::_toHtml() - * @used-by \Dfe\AmazonLogin\Button::loggedIn() - * @used-by \Dfe\Customer\Block::_toHtml() - * @used-by \Dfe\Markdown\FormElement::getAfterElementHtml() - * @used-by \Dfe\Sift\Js::_toHtml() - * @used-by \Dfe\Stripe\Block\Js::_toHtml() - * @used-by \KingPalm\B2B\Block\RegionJS\Backend::_toHtml() - * @used-by \RWCandy\Captcha\Js() - * @used-by \TFC\Core\B\Category::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/30) - * @used-by \TFC\Core\B\Checkout\Success::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/42) + * @used-by CanadaSatellite\Amelia\Block::_toHtml() (canadasatellite.ca, https://github.com/canadasatellite-ca/amelia/issues/1) + * @used-by Df\Checkout\B\Messages::_toHtml() + * @used-by Df\Checkout\B\Payment::_toHtml() + * @used-by Df\Intl\Js::_toHtml() + * @used-by Dfe\Phone\Js::_toHtml() + * @used-by Df\Sso\Css::_toHtml() + * @used-by Dfe\AmazonLogin\Button::loggedIn() + * @used-by Dfe\Customer\Block::_toHtml() + * @used-by Dfe\Markdown\FormElement::getAfterElementHtml() + * @used-by Dfe\Sift\Js::_toHtml() + * @used-by Dfe\Stripe\Block\Js::_toHtml() + * @used-by KingPalm\B2B\Block\RegionJS\Backend::_toHtml() + * @used-by RWCandy\Captcha\Js() + * @used-by TFC\Core\B\Category::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/30) + * @used-by TFC\Core\B\Checkout\Success::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/42) * @param string|object|null $m * @param array(string => mixed) $p [optional] */ From ea66d3b3a7f4ed0361292ca669a595a31dfc8f7c Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:21:16 +0100 Subject: [PATCH 434/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/js/x-magento-init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/js/x-magento-init.php b/Core/lib/js/x-magento-init.php index ade0672d9..ec3fdfc91 100644 --- a/Core/lib/js/x-magento-init.php +++ b/Core/lib/js/x-magento-init.php @@ -7,7 +7,7 @@ * 3) An object: it comes down to the case 2 via @see get_class() * 4) `null`. * @used-by df_js() - * @used-by \KingPalm\B2B\Block\RegionJS\Frontend::_toHtml() + * @used-by KingPalm\B2B\Block\RegionJS\Frontend::_toHtml() * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/products/not-empty.phtml (https://github.com/cabinetsbay/catalog/issues/38) * @used-by vendor/kingpalm/adult/view/frontend/templates/popup.phtml * @see df_widget() From 12289bc4c182c9d9a765cbc7fae90a5645d3a4d4 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:21:41 +0100 Subject: [PATCH 435/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/call/parent.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/lang/call/parent.php b/Core/lib/lang/call/parent.php index 76a67e559..f1dc06c3a 100644 --- a/Core/lib/lang/call/parent.php +++ b/Core/lib/lang/call/parent.php @@ -11,8 +11,8 @@ * 2) We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @see dfr_prop_get() * @see dfr_prop_set() - * @used-by \Df\Framework\Config\Dom\L::init() - * @used-by \Df\Framework\Config\Dom\L::validate() + * @used-by Df\Framework\Config\Dom\L::init() + * @used-by Df\Framework\Config\Dom\L::validate() * @param object $o * @return mixed */ From 068dde2993595b443fd8d0f8d4a36d461e5e02b9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:21:48 +0100 Subject: [PATCH 436/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/prop/custom.php | 122 +++++++++++++++++----------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/Core/lib/lang/prop/custom.php b/Core/lib/lang/prop/custom.php index 2b7ee76c8..04b60500a 100644 --- a/Core/lib/lang/prop/custom.php +++ b/Core/lib/lang/prop/custom.php @@ -5,37 +5,37 @@ * @used-by df_n_set() * @used-by df_prop() * @used-by df_prop_k() - * @used-by \CanadaSatellite\Bambora\Session::failedCount() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/14) - * @used-by \Df\API\Client::logging() - * @used-by \Df\API\FacadeOptions::resC() - * @used-by \Df\API\FacadeOptions::silent() - * @used-by \Df\Checkout\Session::customer() - * @used-by \Df\Checkout\Session::messages() - * @used-by \Df\Core\Exception::context() - * @used-by \Df\Core\Json::bSort() - * @used-by \Df\Customer\Session::needConfirm() - * @used-by \Df\Customer\Session::ssoId() - * @used-by \Df\Customer\Session::ssoProvider() - * @used-by \Df\Paypal\Plugin\Model\Payflow\Service\Gateway::req() - * @used-by \Df\Zf\Validate::v() - * @used-by \Dfe\Omise\Exception\Charge::context() - * @used-by \Dfe\Sift\API\Client::cfg() - * @used-by \Dfe\TBCBank\Session::data() - * @used-by \Frugue\Core\Session::country() - * @used-by \Frugue\Core\Session::redirected() - * @used-by \Inkifi\Pwinty\API\Entity\Image::attributes() - * @used-by \Inkifi\Pwinty\API\Entity\Image::copies() - * @used-by \Inkifi\Pwinty\API\Entity\Image::sizing() - * @used-by \Inkifi\Pwinty\API\Entity\Image::type() - * @used-by \Inkifi\Pwinty\API\Entity\Image::url() - * @used-by \Inkifi\Pwinty\API\Entity\Order::magentoOrder() - * @used-by \Wolf\Filter\Customer::categoryPath() - * @used-by \Wolf\Filter\Customer::garage() + * @used-by CanadaSatellite\Bambora\Session::failedCount() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/14) + * @used-by Df\API\Client::logging() + * @used-by Df\API\FacadeOptions::resC() + * @used-by Df\API\FacadeOptions::silent() + * @used-by Df\Checkout\Session::customer() + * @used-by Df\Checkout\Session::messages() + * @used-by Df\Core\Exception::context() + * @used-by Df\Core\Json::bSort() + * @used-by Df\Customer\Session::needConfirm() + * @used-by Df\Customer\Session::ssoId() + * @used-by Df\Customer\Session::ssoProvider() + * @used-by Df\Paypal\Plugin\Model\Payflow\Service\Gateway::req() + * @used-by Df\Zf\Validate::v() + * @used-by Dfe\Omise\Exception\Charge::context() + * @used-by Dfe\Sift\API\Client::cfg() + * @used-by Dfe\TBCBank\Session::data() + * @used-by Frugue\Core\Session::country() + * @used-by Frugue\Core\Session::redirected() + * @used-by Inkifi\Pwinty\API\Entity\Image::attributes() + * @used-by Inkifi\Pwinty\API\Entity\Image::copies() + * @used-by Inkifi\Pwinty\API\Entity\Image::sizing() + * @used-by Inkifi\Pwinty\API\Entity\Image::type() + * @used-by Inkifi\Pwinty\API\Entity\Image::url() + * @used-by Inkifi\Pwinty\API\Entity\Order::magentoOrder() + * @used-by Wolf\Filter\Customer::categoryPath() + * @used-by Wolf\Filter\Customer::garage() */ const DF_N = 'df-null'; /** - * @used-by \Df\Payment\Init\Action::preconfigured() + * @used-by Df\Payment\Init\Action::preconfigured() * @param mixed|string $v * @return mixed|null */ @@ -54,38 +54,38 @@ function df_n_set($v) {return is_null($v) ? DF_N : $v;} * 2023-12-31 For static properties, pass `null` as the first argument, e.g.: * @see \Df\Core\Json::bSort() * @see \Df\Paypal\Plugin\Model\Payflow\Service\Gateway::req() - * @used-by \CanadaSatellite\Bambora\Response::authCode() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Bambora\Response::avsResult() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Bambora\Response::errorType() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Bambora\Response::messageId() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Bambora\Response::messageText (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Bambora\Response::trnApproved() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Bambora\Response::trnId() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Bambora\Session::failedCount() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/14) - * @used-by \Df\API\Client::logging() - * @used-by \Df\API\FacadeOptions::resC() - * @used-by \Df\API\FacadeOptions::silent() - * @used-by \Df\Checkout\Session::customer() - * @used-by \Df\Checkout\Session::messages() - * @used-by \Df\Core\Exception::context() - * @used-by \Df\Core\Json::bSort() - * @used-by \Df\Customer\Session::needConfirm() - * @used-by \Df\Customer\Session::ssoId() - * @used-by \Df\Customer\Session::ssoProvider() - * @used-by \Df\Paypal\Plugin\Model\Payflow\Service\Gateway::req() - * @used-by \Df\Zf\Validate::v() - * @used-by \Dfe\Sift\API\Client::cfg() - * @used-by \Dfe\TBCBank\Session::data() - * @used-by \Frugue\Core\Session::country() - * @used-by \Frugue\Core\Session::redirected() - * @used-by \Inkifi\Pwinty\API\Entity\Image::attributes() - * @used-by \Inkifi\Pwinty\API\Entity\Image::copies() - * @used-by \Inkifi\Pwinty\API\Entity\Image::sizing() - * @used-by \Inkifi\Pwinty\API\Entity\Image::type() - * @used-by \Inkifi\Pwinty\API\Entity\Image::url() - * @used-by \Inkifi\Pwinty\API\Entity\Order::magentoOrder() - * @used-by \Wolf\Filter\Customer::categoryPath() - * @used-by \Wolf\Filter\Customer::garage() + * @used-by CanadaSatellite\Bambora\Response::authCode() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Bambora\Response::avsResult() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Bambora\Response::errorType() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Bambora\Response::messageId() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Bambora\Response::messageText (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Bambora\Response::trnApproved() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Bambora\Response::trnId() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Bambora\Session::failedCount() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/14) + * @used-by Df\API\Client::logging() + * @used-by Df\API\FacadeOptions::resC() + * @used-by Df\API\FacadeOptions::silent() + * @used-by Df\Checkout\Session::customer() + * @used-by Df\Checkout\Session::messages() + * @used-by Df\Core\Exception::context() + * @used-by Df\Core\Json::bSort() + * @used-by Df\Customer\Session::needConfirm() + * @used-by Df\Customer\Session::ssoId() + * @used-by Df\Customer\Session::ssoProvider() + * @used-by Df\Paypal\Plugin\Model\Payflow\Service\Gateway::req() + * @used-by Df\Zf\Validate::v() + * @used-by Dfe\Sift\API\Client::cfg() + * @used-by Dfe\TBCBank\Session::data() + * @used-by Frugue\Core\Session::country() + * @used-by Frugue\Core\Session::redirected() + * @used-by Inkifi\Pwinty\API\Entity\Image::attributes() + * @used-by Inkifi\Pwinty\API\Entity\Image::copies() + * @used-by Inkifi\Pwinty\API\Entity\Image::sizing() + * @used-by Inkifi\Pwinty\API\Entity\Image::type() + * @used-by Inkifi\Pwinty\API\Entity\Image::url() + * @used-by Inkifi\Pwinty\API\Entity\Order::magentoOrder() + * @used-by Wolf\Filter\Customer::categoryPath() + * @used-by Wolf\Filter\Customer::garage() * @see df_no_rec() * @see dfc() * @param object|null|ArrayAccess $o @@ -135,8 +135,8 @@ function df_prop($o, $v = DF_N, $d = null, string $type = '') {/** @var object|m * 2) "Suppress the «Variable variable used» inspection for the code intended for PHP < 8.2": * https://github.com/mage2pro/core/issues/294 * @used-by df_prop() - * @used-by \Df\Backend\Model\Auth::loginByEmail() - * @used-by \Df\User\Plugin\Model\User::aroundAuthenticate() + * @used-by Df\Backend\Model\Auth::loginByEmail() + * @used-by Df\User\Plugin\Model\User::aroundAuthenticate() * @param object|ArrayAccess $o * @param mixed|string $v [optional] * @param string|mixed|null $d [optional] From e9644d08880be26a2f5d794c85a03c57c79a3e46 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:21:56 +0100 Subject: [PATCH 437/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/prop/native.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/lang/prop/native.php b/Core/lib/lang/prop/native.php index f48990ff4..4cbf3df5e 100644 --- a/Core/lib/lang/prop/native.php +++ b/Core/lib/lang/prop/native.php @@ -34,7 +34,7 @@ function dfr_prop($o, string $n):RP { * 2) We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @see df_call_parent() * @see dfr_prop_set() - * @used-by \Df\Framework\Config\Dom\L::init() + * @used-by Df\Framework\Config\Dom\L::init() * @param object $o * @return mixed */ @@ -47,7 +47,7 @@ function dfr_prop_get($o, string $n) {return dfr_prop($o, $n)->getValue($o);} * 2) We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @see df_call_parent() * @see dfr_prop_get() - * @used-by \Df\Framework\Config\Dom\L::init() + * @used-by Df\Framework\Config\Dom\L::init() * @param object $o * @param mixed $v */ From dc533d7be44bb66007ac2a4a7fa8eab532437e18 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:09 +0100 Subject: [PATCH 438/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/type/conversion/string.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/lang/type/conversion/string.php b/Core/lib/lang/type/conversion/string.php index 2b11dd98b..8fbe2641e 100644 --- a/Core/lib/lang/type/conversion/string.php +++ b/Core/lib/lang/type/conversion/string.php @@ -15,9 +15,9 @@ * @see df_dump() * @see df_is_stringable() * @used-by df_type() - * @used-by \Df\Framework\W\Result\Json::prepare() - * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Xml\G::importString() + * @used-by Df\Framework\W\Result\Json::prepare() + * @used-by Df\Qa\Dumper::dumpObject() + * @used-by Df\Xml\G::importString() * @param mixed $v */ function df_string($v):string {return df_dump(strval(df_assert_stringable($v)));} \ No newline at end of file From 06a012862457c31ff6cb18d1fda117779da2ff54 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:16 +0100 Subject: [PATCH 439/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/type/stringable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/lang/type/stringable.php b/Core/lib/lang/type/stringable.php index 831c9558e..af7162722 100644 --- a/Core/lib/lang/type/stringable.php +++ b/Core/lib/lang/type/stringable.php @@ -4,8 +4,8 @@ * @see df_string() * @used-by df_assert_stringable() * @used-by dfw_encode() - * @used-by \Df\Framework\W\Result\Json::prepare() - * @used-by \Df\Qa\Dumper::dumpObject() + * @used-by Df\Framework\W\Result\Json::prepare() + * @used-by Df\Qa\Dumper::dumpObject() */ function df_is_stringable($v):bool {return !is_array($v) && /** From 211609af39ff1920e0417dedcb83fff657dedb0a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:23 +0100 Subject: [PATCH 440/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/if.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/lang/if.php b/Core/lib/lang/if.php index a56183b17..d954cae1b 100644 --- a/Core/lib/lang/if.php +++ b/Core/lib/lang/if.php @@ -19,7 +19,7 @@ function df_if1(bool $cond, $onTrue, $onFalse = null) {return $cond ? df_call_if /** * 2016-02-09 Осуществляет ленивое ветвление только для второй ветки. - * @used-by \Df\Config\Settings::p() + * @used-by Df\Config\Settings::p() * @param mixed $onTrue * @param mixed|null|callable $onFalse [optional] * @return mixed From 50cca36d20fd2220996ccc4ec4fc3d2b36448131 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:32 +0100 Subject: [PATCH 441/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/other.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/lib/lang/other.php b/Core/lib/lang/other.php index 622fc08f3..01a126225 100644 --- a/Core/lib/lang/other.php +++ b/Core/lib/lang/other.php @@ -3,11 +3,11 @@ * 2017-02-07 * @used-by df_lang_zh() * @used-by df_lang_ru() - * @used-by \Df\Payment\Block\Info::extended() - * @used-by \Df\Payment\Method::test() - * @used-by \Df\Payment\Source\API\Key\Testable::test() - * @used-by \Dfe\Moip\FE\Webhooks::onFormInitialized() - * @used-by \Dfe\Paymill\Settings::test3DS() + * @used-by Df\Payment\Block\Info::extended() + * @used-by Df\Payment\Method::test() + * @used-by Df\Payment\Source\API\Key\Testable::test() + * @used-by Dfe\Moip\FE\Webhooks::onFormInitialized() + * @used-by Dfe\Paymill\Settings::test3DS() * $args — массив либо пустой, либо из 2 элементов с целочисленными индексами 0 и 1. * Если массив $args пуст, то функция возвращает $r. * Если массив $args непуст, то функция возвращает: @@ -23,7 +23,7 @@ function df_b(array $args, bool $r) {return !$args ? $r : $args[intval(!$r)];} * @see dfc() * @see dfcf() * @used-by df_sprintf_strict() - * @used-by \Df\Qa\Failure\Error::log() + * @used-by Df\Qa\Failure\Error::log() */ function df_no_rec(Closure $f):void { static $inProcess = []; /** @var bool[] $inProcess */ @@ -36,7 +36,7 @@ function df_no_rec(Closure $f):void { } /** - * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() + * @used-by Df\Core\Html\Tag::openTagWithAttributesAsText() * @param mixed $v * @return mixed */ From 03c16eff5305e1b7290aa6086ae2b81c3d9d4fbd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:37 +0100 Subject: [PATCH 442/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/lang/sync.php b/Core/lib/lang/sync.php index b91ba8979..f3e39e601 100644 --- a/Core/lib/lang/sync.php +++ b/Core/lib/lang/sync.php @@ -4,7 +4,7 @@ * 2015-12-06 * 2022-11-23 `callable` as an argument type is supported by PHP ≥ 5.4: * https://github.com/mage2pro/core/issues/174#user-content-callable - * @used-by \Dfe\GoogleFont\Controller\Index\Index::execute() + * @used-by Dfe\GoogleFont\Controller\Index\Index::execute() * @param string|object $id * @return mixed */ From 0eda71a1f52191c7857114759d2482acbac7bffd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:43 +0100 Subject: [PATCH 443/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/lang/try.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Core/lib/lang/try.php b/Core/lib/lang/try.php index f63ac7b12..5063826ca 100644 --- a/Core/lib/lang/try.php +++ b/Core/lib/lang/try.php @@ -23,25 +23,25 @@ * @used-by df_xml_x() * @used-by df_zuri() * @used-by dfp_refund() - * @used-by \Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) - * @used-by \Amasty\Checkout\Controller\Index\Index::isSecureRequest() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/241) - * @used-by \CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order\Item::aroundGetProductOptions(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/62) - * @used-by \Df\Framework\Console\Command::execute() - * @used-by \Df\Payment\BankCardNetworks::url() - * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Df\Qa\Trace\Frame::methodR() - * @used-by \Df\Theme\Controller\Result\MessagePlugin::getCookiesMessages() - * @used-by \Df\Xml\G::addChild() - * @used-by \Dfe\CheckoutCom\Method::leh() - * @used-by \Dfe\GoogleFont\Font\Variant\Preview::box() - * @used-by \Dfe\GoogleFont\Fonts\Png::url() - * @used-by \Dfe\Moip\FE\Webhooks::onFormInitialized() - * @used-by \Dfe\Moip\Facade\Customer::_get() - * @used-by \Dfe\Square\Facade\Customer::_get() - * @used-by \Doormall\Shipping\Partner\Entity::locationM() - * @used-by \Inkifi\Mediaclip\API\Facade\User::projects() - * @used-by \CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/catalog/issues/6) - * @used-by \TFC\GoogleShopping\Controller\Index\Index::execute() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) + * @used-by Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) + * @used-by Amasty\Checkout\Controller\Index\Index::isSecureRequest() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/241) + * @used-by CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order\Item::aroundGetProductOptions(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/62) + * @used-by Df\Framework\Console\Command::execute() + * @used-by Df\Payment\BankCardNetworks::url() + * @used-by Df\Qa\Trace\Formatter::p() + * @used-by Df\Qa\Trace\Frame::methodR() + * @used-by Df\Theme\Controller\Result\MessagePlugin::getCookiesMessages() + * @used-by Df\Xml\G::addChild() + * @used-by Dfe\CheckoutCom\Method::leh() + * @used-by Dfe\GoogleFont\Font\Variant\Preview::box() + * @used-by Dfe\GoogleFont\Fonts\Png::url() + * @used-by Dfe\Moip\FE\Webhooks::onFormInitialized() + * @used-by Dfe\Moip\Facade\Customer::_get() + * @used-by Dfe\Square\Facade\Customer::_get() + * @used-by Doormall\Shipping\Partner\Entity::locationM() + * @used-by Inkifi\Mediaclip\API\Facade\User::projects() + * @used-by CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/catalog/issues/6) + * @used-by TFC\GoogleShopping\Controller\Index\Index::execute() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) * @param F|T|bool|mixed $onE [optional] * @return mixed * @throws T From 48414c662326a7de5ee636a47b4ffd7fa551d00a Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:49 +0100 Subject: [PATCH 444/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/object/get-data.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/object/get-data.php b/Core/lib/object/get-data.php index 65cf3621a..1183da0eb 100644 --- a/Core/lib/object/get-data.php +++ b/Core/lib/object/get-data.php @@ -20,8 +20,8 @@ function df_assert_gd($v) {return df_has_gd($v) ? $v : df_error(df_ucfirst( * 2020-02-04 * @used-by dfad() * @used-by dfa_remove_objects() - * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Sentry\Extra::adjust() + * @used-by Df\Qa\Dumper::dumpObject() + * @used-by Df\Sentry\Extra::adjust() * @param mixed|_DO|AE|oAPI $v * @param F|bool|mixed $onE [optional] * @return array(string => mixed) @@ -40,7 +40,7 @@ function df_gd($v, $onE = true):array {return df_try(function() use($v) {return * similar to `Magento\Framework\DataObject`": https://github.com/mage2pro/core/issues/290 * @used-by df_assert_gd() * @used-by df_call() - * @used-by \Df\Sentry\Extra::adjust() + * @used-by Df\Sentry\Extra::adjust() * @param mixed $v */ function df_has_gd($v):bool {return $v instanceof _DO || $v instanceof AE || df_is_api_o($v);} \ No newline at end of file From 2654aa3b00251a5004ac3ea64fe1d99089c71258 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:22:58 +0100 Subject: [PATCH 445/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/object/new.php | 74 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Core/lib/object/new.php b/Core/lib/object/new.php index 722307330..48986446f 100644 --- a/Core/lib/object/new.php +++ b/Core/lib/object/new.php @@ -12,19 +12,19 @@ * https://php.net/manual/functions.arguments.php#example-145 * 2022-10-31 `object` as a return type is not supported by PHP < 7.2: https://3v4l.org/dAmcs * @used-by df_newa() - * @used-by \Df\Payment\Currency::f() - * @used-by \Df\Payment\W\F::__construct() - * @used-by \Df\PaypalClone\Charge::p() - * @used-by \Df\PaypalClone\Signer::_sign() - * @used-by \Df\Sso\Button::s() - * @used-by \Df\Sso\CustomerReturn::c() - * @used-by \Df\StripeClone\Facade\Card::create() - * @used-by \Df\StripeClone\P\Charge::sn() - * @used-by \Df\StripeClone\P\Preorder::request() - * @used-by \Df\StripeClone\P\Reg::request() - * @used-by \Dfe\Zoho\API\Client::i() - * @used-by \Dfe\CheckoutCom\Handler::p() - * @used-by \Dfe\TwoCheckout\Handler::p() + * @used-by Df\Payment\Currency::f() + * @used-by Df\Payment\W\F::__construct() + * @used-by Df\PaypalClone\Charge::p() + * @used-by Df\PaypalClone\Signer::_sign() + * @used-by Df\Sso\Button::s() + * @used-by Df\Sso\CustomerReturn::c() + * @used-by Df\StripeClone\Facade\Card::create() + * @used-by Df\StripeClone\P\Charge::sn() + * @used-by Df\StripeClone\P\Preorder::request() + * @used-by Df\StripeClone\P\Reg::request() + * @used-by Dfe\Zoho\API\Client::i() + * @used-by Dfe\CheckoutCom\Handler::p() + * @used-by Dfe\TwoCheckout\Handler::p() * @param mixed ...$a * @return object */ @@ -37,9 +37,9 @@ function df_new(string $c, ...$a) {return new $c(...$a);} * В отличие от @see df_new_om(), она не использует Object Manager. * 2022-10-31 `object` as a return type is not supported by PHP < 7.2: https://3v4l.org/dAmcs * @used-by dfs_con() - * @used-by \Df\API\Facade::p() - * @used-by \Df\Payment\W\F::aspect() - * @used-by \Df\Zf\Validate\StringT\Parser::getZendValidator() + * @used-by Df\API\Facade::p() + * @used-by Df\Payment\W\F::aspect() + * @used-by Df\Zf\Validate\StringT\Parser::getZendValidator() * @param mixed ...$a * @return object */ @@ -75,27 +75,27 @@ function df_newa(string $c, string $expected = '', ...$a) {return df_ar(df_new($ * @used-by ikf_product_c() * @used-by ikf_project() * @used-by mc_h() - * @used-by \Df\Customer\AddAttribute\Address::p() - * @used-by \Df\Customer\Plugin\Model\ResourceModel\AddressRepository::aroundSave() - * @used-by \Df\Directory\Model\Country::c() - * @used-by \Df\Framework\Log\Handler\Info::lb() - * @used-by \Df\Framework\Plugin\Data\Form\Element\Fieldset::beforeAddField() - * @used-by \Df\Framework\Upgrade::sEav() - * @used-by \Df\Payment\ConfigProvider::p() - * @used-by \Df\Sales\Model\Order\Payment::getInvoiceForTransactionId() - * @used-by \Df\Sales\Plugin\Model\Order\Address\Renderer::addressConfig() - * @used-by \Df\Sso\CustomerReturn::mc() - * @used-by \Df\Sso\CustomerReturn::register() - * @used-by \Dfe\SalesSequence\Plugin\Model\Manager::aroundGetSequence() - * @used-by \Doormall\Shipping\Method::collectRates() - * @used-by \Frugue\Shipping\Method::collectRates() - * @used-by \Inkifi\Mediaclip\API\Entity\Order\Item::mProduct() - * @used-by \Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::pShipment() - * @used-by \Inkifi\Pwinty\Controller\Index\Index::execute() - * @used-by \Interactivated\Quotecheckout\Controller\Index\Updateordermethod::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) - * @used-by \KingPalm\B2B\Setup\V140\MoveDataToAddress::p() - * @used-by \Mangoit\MediaclipHub\Controller\Index\AddToCart::execute() - * @used-by \PPCs\Core\Plugin\Quote\Model\QuoteRepository::aroundGetActiveForCustomer() + * @used-by Df\Customer\AddAttribute\Address::p() + * @used-by Df\Customer\Plugin\Model\ResourceModel\AddressRepository::aroundSave() + * @used-by Df\Directory\Model\Country::c() + * @used-by Df\Framework\Log\Handler\Info::lb() + * @used-by Df\Framework\Plugin\Data\Form\Element\Fieldset::beforeAddField() + * @used-by Df\Framework\Upgrade::sEav() + * @used-by Df\Payment\ConfigProvider::p() + * @used-by Df\Sales\Model\Order\Payment::getInvoiceForTransactionId() + * @used-by Df\Sales\Plugin\Model\Order\Address\Renderer::addressConfig() + * @used-by Df\Sso\CustomerReturn::mc() + * @used-by Df\Sso\CustomerReturn::register() + * @used-by Dfe\SalesSequence\Plugin\Model\Manager::aroundGetSequence() + * @used-by Doormall\Shipping\Method::collectRates() + * @used-by Frugue\Shipping\Method::collectRates() + * @used-by Inkifi\Mediaclip\API\Entity\Order\Item::mProduct() + * @used-by Inkifi\Mediaclip\H\AvailableForDownload\Pureprint::pShipment() + * @used-by Inkifi\Pwinty\Controller\Index\Index::execute() + * @used-by Interactivated\Quotecheckout\Controller\Index\Updateordermethod::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) + * @used-by KingPalm\B2B\Setup\V140\MoveDataToAddress::p() + * @used-by Mangoit\MediaclipHub\Controller\Index\AddToCart::execute() + * @used-by PPCs\Core\Plugin\Quote\Model\QuoteRepository::aroundGetActiveForCustomer() * @param array(string => mixed) $p [optional] * @return _DO|object */ From a640f6a418d1366ea2f396093a06192f02e94344 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:04 +0100 Subject: [PATCH 446/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/object/objects.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Core/lib/object/objects.php b/Core/lib/object/objects.php index 3de4e73ec..cce9653f4 100644 --- a/Core/lib/object/objects.php +++ b/Core/lib/object/objects.php @@ -6,7 +6,7 @@ * 1) The `object` type requires PHP ≥ 7.2: https://github.com/mage2pro/core/issues/174#user-content-object * 2) We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @used-by df_sc() - * @used-by \Df\Config\Backend\Serialized::processI() + * @used-by Df\Config\Backend\Serialized::processI() * @param string|null|array(string => mixed) $a2 [optional] * @param array(string => mixed) $a3 [optional] * @return _DO|object @@ -32,14 +32,14 @@ function df_ic(string $resultClass, $a2 = null, array $a3 = []) { * 1) The `object` type requires PHP ≥ 7.2: https://github.com/mage2pro/core/issues/174#user-content-object * 2) We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @used-by df_oq_sa() - * @used-by \CanadaSatellite\Core\Plugin\Magento\Sales\Api\Data\OrderInterface::afterGetPayment() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/29) - * @used-by \Df\Widget\P\Wysiwyg::prepareElementHtml() (https://github.com/mage2pro/core/issues/392) - * @used-by \Dfe\Markdown\Plugin\Ui\Component\Form\Element\Wysiwyg::beforePrepare() - * @used-by \Doormall\Shipping\Method::collectRates() - * @used-by \Frugue\Core\Plugin\Sales\Model\Quote::afterGetAddressesCollection() - * @used-by \Frugue\Shipping\Method::collectRates() - * @used-by \KingPalm\B2B\Block\Registration::e() - * @used-by \KingPalm\B2B\Block\Registration::form() + * @used-by CanadaSatellite\Core\Plugin\Magento\Sales\Api\Data\OrderInterface::afterGetPayment() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/29) + * @used-by Df\Widget\P\Wysiwyg::prepareElementHtml() (https://github.com/mage2pro/core/issues/392) + * @used-by Dfe\Markdown\Plugin\Ui\Component\Form\Element\Wysiwyg::beforePrepare() + * @used-by Doormall\Shipping\Method::collectRates() + * @used-by Frugue\Core\Plugin\Sales\Model\Quote::afterGetAddressesCollection() + * @used-by Frugue\Shipping\Method::collectRates() + * @used-by KingPalm\B2B\Block\Registration::e() + * @used-by KingPalm\B2B\Block\Registration::form() * @param array(string => mixed) $d [optional] * @return _DO|object */ @@ -51,8 +51,8 @@ function df_new_omd(string $c, array $d = []) {return df_om()->create($c, ['data * 1) The `object` type requires PHP ≥ 7.2: https://github.com/mage2pro/core/issues/174#user-content-object * 2) We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @see df_ic() - * @used-by \Dfe\GingerPaymentsBase\Settings::os() - * @used-by \Df\Payment\Settings::_options() + * @used-by Dfe\GingerPaymentsBase\Settings::os() + * @used-by Df\Payment\Settings::_options() * @param array(string => mixed) $params [optional] * @return _DO|object */ @@ -77,9 +77,9 @@ function df_sc(string $resultClass, string $expectedClass = '', array $params = * `object` as an argument type is not supported by PHP < 7.2: https://github.com/mage2pro/core/issues/174#user-content-object * 2024-06-03 We need to support PHP ≥ 7.1: https://github.com/mage2pro/core/issues/368 * @see dfa() - * @used-by \Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) - * @used-by \Df\StripeClone\Facade\Charge::cardData() - * @used-by \MageSuper\Faq\Observer\CheckRecaptcha3::execute() (canadasatellite.ca) + * @used-by Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) + * @used-by Df\StripeClone\Facade\Charge::cardData() + * @used-by MageSuper\Faq\Observer\CheckRecaptcha3::execute() (canadasatellite.ca) * @param object $o * @param string|int $k * @param mixed|callable|null $d [optional] @@ -98,8 +98,8 @@ function dfo($o, $k, $d = null) {return * The result should be a descendant of the $owner, and should exist (it is not defaulted to $owner). * 2022-10-31 `object` as a return type is not supported by PHP < 7.2: https://3v4l.org/dAmcs * @used-by df_oauth_app() - * @used-by \Dfe\Zoho\App::s() - * @used-by \Dfe\ZohoBI\API\Facade::s() + * @used-by Dfe\Zoho\App::s() + * @used-by Dfe\ZohoBI\API\Facade::s() * @param string|object $caller * @return object */ From d0f64442b41377f3a5c4631fe3a603c5bc85727e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:11 +0100 Subject: [PATCH 447/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/object/om.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Core/lib/object/om.php b/Core/lib/object/om.php index bf9eda5f0..6627c44b5 100644 --- a/Core/lib/object/om.php +++ b/Core/lib/object/om.php @@ -14,7 +14,7 @@ function df_ctr(string $c):string {return df_vtr(df_om_config()->getPreference($ /** * 2017-03-20 - * @used-by \Df\Framework\Plugin\App\Router\ActionList::aroundGet() + * @used-by Df\Framework\Plugin\App\Router\ActionList::aroundGet() */ function df_is_virtual(string $c):bool {return !!dfa(df_virtual_types(), $c);} @@ -72,16 +72,16 @@ function df_is_virtual(string $c):bool {return !!dfa(df_virtual_types(), $c);} * @used-by df_stock_h() * @used-by df_url_finder() * @used-by df_url_h() - * @used-by \Df\Core\Session::st() - * @used-by \Df\Customer\Plugin\Js\CustomerId::afterGetSectionData() - * @used-by \Df\Payment\Settings::applicableForQuoteByCountry() - * @used-by \Dfe\KlarnaC\OL::fetch() - * @used-by \Frugue\Core\Plugin\Directory\Model\Resource\Country\Collection::aroundLoadByStore() - * @used-by \Hotlink\Framework\Model\Schedule\Cron\Config\Plugin::afterGetJobs() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/site/issues/127) - * @used-by \Interactivated\Quotecheckout\Controller\Index\Updateordermethod::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) - * @used-by \Mageplaza\Blog\Controller\Router::match() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/190) - * @used-by \SayItWithAGift\Options\Frontend::_toHtml() - * @used-by \Wolf\Filter\Block\Navigation::selectedPath() + * @used-by Df\Core\Session::st() + * @used-by Df\Customer\Plugin\Js\CustomerId::afterGetSectionData() + * @used-by Df\Payment\Settings::applicableForQuoteByCountry() + * @used-by Dfe\KlarnaC\OL::fetch() + * @used-by Frugue\Core\Plugin\Directory\Model\Resource\Country\Collection::aroundLoadByStore() + * @used-by Hotlink\Framework\Model\Schedule\Cron\Config\Plugin::afterGetJobs() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/site/issues/127) + * @used-by Interactivated\Quotecheckout\Controller\Index\Updateordermethod::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/116) + * @used-by Mageplaza\Blog\Controller\Router::match() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/190) + * @used-by SayItWithAGift\Options\Frontend::_toHtml() + * @used-by Wolf\Filter\Block\Navigation::selectedPath() * @used-by https://github.com/tradefurniturecompany/report/blob/1.0.3/view/frontend/templates/index.phtml#L20 * @used-by app/code/WeltPixel/QuickCart/view/frontend/templates/checkout/cart/item/price/sidebar.phtml (https://github.com/cabinetsbay/site/issues/145) * @return mixed @@ -93,7 +93,7 @@ function df_o(string $t) {return dfcf(function(string $t) {return df_om()->get($ * @used-by df_cms_block_r() * @used-by df_ic() * @used-by df_o() - * @used-by \Df\Payment\ConfigProvider::p() + * @used-by Df\Payment\ConfigProvider::p() * @return OM|IOM */ function df_om() {return OM::getInstance();} @@ -102,7 +102,7 @@ function df_om() {return OM::getInstance();} * 2016-05-06 * @used-by df_class_exists() * @used-by df_virtual_types() - * @used-by \Df\Framework\Plugin\App\Router\ActionList::aroundGet() + * @used-by Df\Framework\Plugin\App\Router\ActionList::aroundGet() * @return IConfig|Config|Compiled|Developer */ function df_om_config() {return df_o(IConfig::class);} @@ -110,7 +110,7 @@ function df_om_config() {return df_o(IConfig::class);} /** * 2017-03-20 * @used-by df_ctr() - * @used-by \Df\Framework\Plugin\App\Router\ActionList::aroundGet() + * @used-by Df\Framework\Plugin\App\Router\ActionList::aroundGet() */ function df_vtr(string $c):string {return df_om_config()->getInstanceType($c);} From 8cc22ddeae3a7ed334ab4eda5a0a6fd765c6d751 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:23 +0100 Subject: [PATCH 448/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/reflection/text/cc.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Core/lib/reflection/text/cc.php b/Core/lib/reflection/text/cc.php index 838385c83..76ec31684 100644 --- a/Core/lib/reflection/text/cc.php +++ b/Core/lib/reflection/text/cc.php @@ -7,9 +7,9 @@ * @used-by df_class_suffix() * @used-by df_con_hier_suf() * @used-by df_con_hier_suf_ta() - * @used-by \Df\Payment\W\F::c() - * @used-by \Dfe\AllPay\Method::getInfoBlockType() - * @used-by \Dfe\TwoCheckout\Handler::p() + * @used-by Df\Payment\W\F::c() + * @used-by Dfe\AllPay\Method::getInfoBlockType() + * @used-by Dfe\TwoCheckout\Handler::p() * @param string|string[] ...$a */ function df_cc_class(...$a):string {return implode('\\', df_clean(dfa_flatten($a)));} @@ -21,10 +21,10 @@ function df_cc_class(...$a):string {return implode('\\', df_clean(dfa_flatten($a * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @see df_cc_class() * @used-by df_con_hier_suf_ta() - * @used-by \Df\Framework\Plugin\App\Router\ActionList::aroundGet() - * @used-by \Df\Payment\W\F::try_() - * @used-by \Dfe\CheckoutCom\Handler::p() - * @used-by \Dfe\Moip\Method::getInfoBlockType() + * @used-by Df\Framework\Plugin\App\Router\ActionList::aroundGet() + * @used-by Df\Payment\W\F::try_() + * @used-by Dfe\CheckoutCom\Handler::p() + * @used-by Dfe\Moip\Method::getInfoBlockType() * @param string|string[] ...$a */ function df_cc_class_uc(...$a):string {return df_cc_class(df_ucfirst(dfa_flatten($a)));} @@ -34,7 +34,7 @@ function df_cc_class_uc(...$a):string {return df_cc_class(df_ucfirst(dfa_flatten * @used-by df_caller_m() * @used-by df_caller_mf() * @used-by df_rest_action() - * @used-by \Df\Qa\Trace\Frame::method() + * @used-by Df\Qa\Trace\Frame::method() * @param string|object|null|array(object|string)|array(string = string) $a1 * @param string|null $a2 [optional] */ From bb9c8881ef246e51def6a053349367d102e78109 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:28 +0100 Subject: [PATCH 449/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/reflection/text/check.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/lib/reflection/text/check.php b/Core/lib/reflection/text/check.php index 3c1603b6a..4bac66b1b 100644 --- a/Core/lib/reflection/text/check.php +++ b/Core/lib/reflection/text/check.php @@ -11,8 +11,8 @@ * @used-by df_assert_class_exists() * @used-by df_catalog_locator_exists() * @used-by df_con_hier_suf() - * @used-by \Df\Core\R\ConT::generic() - * @used-by \Df\Payment\W\F::c() + * @used-by Df\Core\R\ConT::generic() + * @used-by Df\Payment\W\F::c() */ function df_class_exists(string $c):bool {$c = df_ctr($c); return @class_exists($c);} @@ -21,7 +21,7 @@ function df_class_exists(string $c):bool {$c = df_ctr($c); return @class_exists( * 2016-10-20 * Making $c optional leads to the error «get_class() called without object from outside a class»: https://3v4l.org/k6Hd5 * https://3v4l.org/k6Hd5 - * @used-by \Df\Config\Plugin\Model\Config\SourceFactory::aroundCreate() + * @used-by Df\Config\Plugin\Model\Config\SourceFactory::aroundCreate() * @param string|object $c */ function df_class_my($c):bool {return in_array(df_class_f($c), ['Df', 'Dfe', 'Dfr']);} @@ -29,7 +29,7 @@ function df_class_my($c):bool {return in_array(df_class_f($c), ['Df', 'Dfe', 'Df /** * 2017-01-11 http://stackoverflow.com/a/666701 * @used-by df_con_hier_suf() - * @used-by \Df\Core\R\ConT::generic() - * @used-by \Df\Payment\W\F::i() + * @used-by Df\Core\R\ConT::generic() + * @used-by Df\Payment\W\F::i() */ function df_is_abstract(string $c):bool {df_param_sne($c, 0); return (new RC(df_ctr($c)))->isAbstract();} \ No newline at end of file From f1048cbac69ae9bcaa1160eed2603a6c0e9b8770 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:35 +0100 Subject: [PATCH 450/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/reflection/text/con_.php | 54 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Core/lib/reflection/text/con_.php b/Core/lib/reflection/text/con_.php index 64d925066..bf23ecf07 100644 --- a/Core/lib/reflection/text/con_.php +++ b/Core/lib/reflection/text/con_.php @@ -13,7 +13,7 @@ * 1) a class name: «A\B\C». * 2) an object. It is reduced to case 1 via @see get_class() * @used-by dfs_con() - * @used-by \Df\Framework\Mail\TransportObserver::execute() + * @used-by Df\Framework\Mail\TransportObserver::execute() * @param string|string[] $suf * @return string|null */ @@ -58,18 +58,18 @@ function($c, $suf) {return df_cc(df_cld($c), $c, $suf);}, $c, $suf, $def, $throw * 2017-02-11 Отныне функция позволяет в качестве $def передавать интерфейс: @see df_class_suffix() * @used-by dfpm_c() * @used-by dfsm_c() - * @used-by \Df\API\Facade::p() - * @used-by \Dfe\GingerPaymentsBase\Settings::os() - * @used-by \Df\Payment\Currency::f() - * @used-by \Df\Payment\Facade::s() - * @used-by \Df\PaypalClone\Charge::p() - * @used-by \Df\Sso\Button::s() - * @used-by \Df\Sso\CustomerReturn::c() - * @used-by \Df\StripeClone\Facade\Card::create() - * @used-by \Df\StripeClone\P\Charge::sn() - * @used-by \Df\StripeClone\P\Preorder::request() - * @used-by \Df\StripeClone\P\Reg::request() - * @used-by \Dfe\Zoho\API\Client::i() + * @used-by Df\API\Facade::p() + * @used-by Dfe\GingerPaymentsBase\Settings::os() + * @used-by Df\Payment\Currency::f() + * @used-by Df\Payment\Facade::s() + * @used-by Df\PaypalClone\Charge::p() + * @used-by Df\Sso\Button::s() + * @used-by Df\Sso\CustomerReturn::c() + * @used-by Df\StripeClone\Facade\Card::create() + * @used-by Df\StripeClone\P\Charge::sn() + * @used-by Df\StripeClone\P\Preorder::request() + * @used-by Df\StripeClone\P\Reg::request() + * @used-by Dfe\Zoho\API\Client::i() * @param object|string $c * @return string|null */ @@ -81,16 +81,16 @@ function df_con_heir($c, string $def) {return df_ar(df_con(df_module_name_c($c), * а затем спускается по иерархии наследования для $c, * и так до тех пор, пока не найдёт в папке предка класс с суффиксом, как у $ar. * 2017-02-11 Отныне функция позволяет в качестве $ar передавать интерфейс: @see df_class_suffix() - * @used-by \Df\Config\Settings::convention() - * @used-by \Df\Payment\Choice::f() - * @used-by \Df\Payment\Init\Action::sg() - * @used-by \Df\Payment\Method::getFormBlockType() - * @used-by \Df\Payment\Method::getInfoBlockType() - * @used-by \Df\Payment\Method::s() - * @used-by \Df\Payment\Url::f() - * @used-by \Df\Payment\W\F::__construct() - * @used-by \Df\Payment\W\F::s() - * @used-by \Df\Shipping\Method::s() + * @used-by Df\Config\Settings::convention() + * @used-by Df\Payment\Choice::f() + * @used-by Df\Payment\Init\Action::sg() + * @used-by Df\Payment\Method::getFormBlockType() + * @used-by Df\Payment\Method::getInfoBlockType() + * @used-by Df\Payment\Method::s() + * @used-by Df\Payment\Url::f() + * @used-by Df\Payment\W\F::__construct() + * @used-by Df\Payment\W\F::s() + * @used-by Df\Shipping\Method::s() * @param object|string $c * @return string|null * @throws DFE @@ -128,8 +128,8 @@ function df_con_hier_suf($c, string $suf, bool $throw = true) {/** @var string|n /** * 2017-03-20 Сначала проходит по иерархии суффиксов, и лишь затем — по иерархии наследования. - * @used-by \Df\Payment\W\F::tryTA() - * @used-by \Df\PaypalClone\Signer::_sign() + * @used-by Df\Payment\W\F::tryTA() + * @used-by Df\PaypalClone\Signer::_sign() * @param object|string $c * @param string|string[] $sufBase * @param string|string[] $ta @@ -157,7 +157,7 @@ function df_con_hier_suf_ta($c, $sufBase, $ta, bool $throw = true) { * 2016-08-29 * @used-by dfpm_call_s() * @used-by dfsm_call_s() - * @used-by \Df\StripeClone\Method::chargeNew() + * @used-by Df\StripeClone\Method::chargeNew() * @param string|object $c * @param string|string[] $suffix * @return mixed @@ -189,7 +189,7 @@ function($c, $suffix, $method, array $params = []) { * df_con_sibling($this, 'Webhook\Report', \Df\Payment\Xxx\Yyy) * работает точно так же, но запись длиннее * + не проверяет, что результат имеет класс \Df\Payment\Xxx\Yyy или его потомка. - * @used-by \Df\Payment\W\Handler::exceptionC() + * @used-by Df\Payment\W\Handler::exceptionC() * @param object|string $c * @param string|string[] $nameLast * @return string|null From 8f68867a54e4e3f0383d12334ab8d55e5090a034 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:42 +0100 Subject: [PATCH 451/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/reflection/text/cts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/reflection/text/cts.php b/Core/lib/reflection/text/cts.php index 085f7c030..4e91a58c4 100644 --- a/Core/lib/reflection/text/cts.php +++ b/Core/lib/reflection/text/cts.php @@ -9,7 +9,7 @@ * @used-by df_interceptor() * @used-by df_module_name() * @used-by dfsm_code() - * @used-by \Df\Payment\Method::getInfoBlockType() + * @used-by Df\Payment\Method::getInfoBlockType() * @param string|object $c */ function df_cts($c, string $del = '\\'):string {/** @var string $r */ From abd2c9b5fd8a2d9cc4f073459992c0f233d2c93d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:52 +0100 Subject: [PATCH 452/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/reflection/text/interceptor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/reflection/text/interceptor.php b/Core/lib/reflection/text/interceptor.php index 31604bd41..47af9dc2f 100644 --- a/Core/lib/reflection/text/interceptor.php +++ b/Core/lib/reflection/text/interceptor.php @@ -18,6 +18,6 @@ function df_interceptor($c):string {return df_cts($c) . DF_INTERCEPTOR;} /** * 2021-03-26 * @used-by df_cts() - * @used-by \Df\Framework\Plugin\EntityManager\TypeResolver::afterResolve() + * @used-by Df\Framework\Plugin\EntityManager\TypeResolver::afterResolve() */ function df_trim_interceptor(string $c):string {return df_trim_text_right($c, DF_INTERCEPTOR);} \ No newline at end of file From 5e56e607c17379ab1f82782ccdfacd7c421c75fc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:23:58 +0100 Subject: [PATCH 453/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/reflection/text/other.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/reflection/text/other.php b/Core/lib/reflection/text/other.php index a980ac4ad..58ce0aad0 100644 --- a/Core/lib/reflection/text/other.php +++ b/Core/lib/reflection/text/other.php @@ -41,8 +41,8 @@ function df_cld($c):string {return df_contains(df_cts($c) , '\\') ? '\\' : '_';} * 2016-08-10 * @uses defined() не реагирует на методы класса, в том числе на статические, * поэтому нам использовать эту функию безопасно: https://3v4l.org/9RBfr - * @used-by \Df\Config\O::ct() - * @used-by \Df\Payment\Method::codeS() + * @used-by Df\Config\O::ct() + * @used-by Df\Payment\Method::codeS() * @param string|object $c * @param mixed|callable $def [optional] * @return mixed From ebb67b0324ef63d0d62b3e8b791af83524a4d1ab Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:24:04 +0100 Subject: [PATCH 454/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/reflection/text/part.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Core/lib/reflection/text/part.php b/Core/lib/reflection/text/part.php index f79de534e..217454712 100644 --- a/Core/lib/reflection/text/part.php +++ b/Core/lib/reflection/text/part.php @@ -13,15 +13,15 @@ function df_class_f($c):string {return df_first(df_explode_class($c));} * 2016-10-20 * Making $c optional leads to the error «get_class() called without object from outside a class»: https://3v4l.org/k6Hd5 * @used-by df_class_llc() - * @used-by \Df\API\Facade::path() - * @used-by \Df\Payment\W\F::aspect() - * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Dfe\AlphaCommerceHub\Test\CaseT\BankCard\CancelPayment::t01() - * @used-by \Dfe\AlphaCommerceHub\Test\CaseT\BankCard\CapturePayment::t01() - * @used-by \Dfe\AlphaCommerceHub\Test\CaseT\BankCard\RefundPayment::t01() - * @used-by \Dfe\AlphaCommerceHub\Test\CaseT\PayPal\CapturePayment::t01() - * @used-by \Dfe\AlphaCommerceHub\Test\CaseT\PayPal\PaymentStatus::t01() - * @used-by \Dfe\AlphaCommerceHub\Test\CaseT\PayPal\RefundPayment::t01() + * @used-by Df\API\Facade::path() + * @used-by Df\Payment\W\F::aspect() + * @used-by Df\Qa\Trace\Formatter::p() + * @used-by Dfe\AlphaCommerceHub\Test\CaseT\BankCard\CancelPayment::t01() + * @used-by Dfe\AlphaCommerceHub\Test\CaseT\BankCard\CapturePayment::t01() + * @used-by Dfe\AlphaCommerceHub\Test\CaseT\BankCard\RefundPayment::t01() + * @used-by Dfe\AlphaCommerceHub\Test\CaseT\PayPal\CapturePayment::t01() + * @used-by Dfe\AlphaCommerceHub\Test\CaseT\PayPal\PaymentStatus::t01() + * @used-by Dfe\AlphaCommerceHub\Test\CaseT\PayPal\RefundPayment::t01() * @param string|object $c */ function df_class_l($c):string {return df_last(df_explode_class($c));} @@ -29,7 +29,7 @@ function df_class_l($c):string {return df_last(df_explode_class($c));} /** * 2018-01-30 * 2021-10-27 @deprecared It is unused. - * @used-by \CabinetsBay\Catalog\B\Featured::p() (https://github.com/cabinetsbay/catalog/issues/27) + * @used-by CabinetsBay\Catalog\B\Featured::p() (https://github.com/cabinetsbay/catalog/issues/27) * @param string|object $c */ function df_class_llc($c):string {return strtolower(df_class_l($c));} @@ -39,7 +39,7 @@ function df_class_llc($c):string {return strtolower(df_class_l($c));} * 2016-10-20 * Making $c optional leads to the error «get_class() called without object from outside a class»: https://3v4l.org/k6Hd5 * https://3v4l.org/k6Hd5 - * @used-by \Df\API\Settings::titleB() + * @used-by Df\API\Settings::titleB() * @param string|object $c */ function df_class_second($c):string {return df_explode_class($c)[1];} From 7b387dcbbbf3b0499e77f640475b1219ee9d382d Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:24:13 +0100 Subject: [PATCH 455/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/contains/.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Core/lib/text/contains/.php b/Core/lib/text/contains/.php index b9740d886..017c26652 100644 --- a/Core/lib/text/contains/.php +++ b/Core/lib/text/contains/.php @@ -13,17 +13,17 @@ * @used-by df_rp_has() * @used-by ikf_ite() * @used-by mnr_recurring_is() - * @used-by \Alignet\Paymecheckout\Plugin\Magento\Framework\Session\SidResolver::aroundGetSid() (innomuebles.com, https://github.com/innomuebles/m2/issues/11) - * @used-by \CanadaSatellite\Bambora\Facade::api() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) - * @used-by \CanadaSatellite\Core\Plugin\Mageplaza\Blog\Helper\Data::afterGetBlogUrl() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) - * @used-by \Df\Cron\Model\LoggerHandler::p() - * @used-by \Df\Framework\Config\Dom\L::validate() - * @used-by \Df\Sentry\Trace::get_frame_context() - * @used-by \Df\Xml\G::k() - * @used-by \Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::parse() - * @used-by \DxMoto\Core\Observer\CanLog::execute() - * @used-by \RWCandy\Captcha\Assert::name() - * @used-by \TFC\Core\Observer\CanLog::execute() + * @used-by Alignet\Paymecheckout\Plugin\Magento\Framework\Session\SidResolver::aroundGetSid() (innomuebles.com, https://github.com/innomuebles/m2/issues/11) + * @used-by CanadaSatellite\Bambora\Facade::api() (canadasatellite.ca, https://github.com/canadasatellite-ca/bambora/issues/1) + * @used-by CanadaSatellite\Core\Plugin\Mageplaza\Blog\Helper\Data::afterGetBlogUrl() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) + * @used-by Df\Cron\Model\LoggerHandler::p() + * @used-by Df\Framework\Config\Dom\L::validate() + * @used-by Df\Sentry\Trace::get_frame_context() + * @used-by Df\Xml\G::k() + * @used-by Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::parse() + * @used-by DxMoto\Core\Observer\CanLog::execute() + * @used-by RWCandy\Captcha\Assert::name() + * @used-by TFC\Core\Observer\CanLog::execute() * @param string|string[] ...$n */ function df_contains(string $haystack, ...$n):bool {/** @var bool $r */ From 9adf13e42a477d8b652adc40d6c3c584a0320f00 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:24:22 +0100 Subject: [PATCH 456/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/is/guid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/text/is/guid.php b/Core/lib/text/is/guid.php index 404410022..258b90441 100644 --- a/Core/lib/text/is/guid.php +++ b/Core/lib/text/is/guid.php @@ -2,7 +2,7 @@ /** * 2019-01-11 * 2019-11-15 https://stackoverflow.com/a/1253417 - * @used-by \Inkifi\Consolidation\Controller\Adminhtml\Index\Index::execute() + * @used-by Inkifi\Consolidation\Controller\Adminhtml\Index\Index::execute() */ function df_is_guid(string $s):bool {return 36 === strlen($s) && preg_match( '#^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$#', $s From ca44b088fe24ac973c990dcae47b28d718bd4d3e Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:24:30 +0100 Subject: [PATCH 457/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/n/cc.php | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Core/lib/text/n/cc.php b/Core/lib/text/n/cc.php index 071c8288e..3f5d2c7a3 100644 --- a/Core/lib/text/n/cc.php +++ b/Core/lib/text/n/cc.php @@ -12,29 +12,29 @@ * @used-by df_xml_prettify() * @used-by df_zf_http_last_req() * @used-by dfp_error_message() - * @used-by \Df\Core\Html\Tag::content() - * @used-by \Df\Core\Text\Regex::getSubjectReportPart() - * @used-by \Df\Framework\Plugin\View\Asset\Source::aroundGetContent() - * @used-by \Df\Payment\Comment\Description::getCommentText() - * @used-by \Df\Qa\Dumper::dumpArrayElements() - * @used-by \Df\Qa\Method::raiseErrorParam() - * @used-by \Df\Qa\Method::raiseErrorResult() - * @used-by \Df\Qa\Method::raiseErrorVariable() - * @used-by \Df\Typography\Css::render() - * @used-by \Dfe\AllPay\Block\Info\Barcode::paymentId() - * @used-by \Dfe\Frontend\Block\ProductView\Css::_toHtml() - * @used-by \Dfe\GoogleFont\ResponseValidator::short() - * @used-by \Dfe\Klarna\Button::_toHtml() - * @used-by \Dfe\Markdown\FormElement::css() - * @used-by \Dfe\Sift\Test\CaseT\API\Account\Decisions::t01() - * @used-by \Dfe\Stripe\Block\Multishipping::_toHtml() - * @used-by \Inkifi\Map\HTML::tiles() - * @used-by \SayItWithAGift\Options\Frontend::_toHtml() - * @used-by \CabinetsBay\Catalog\B\Category::title() (https://github.com/cabinetsbay/catalog/issues/5) - * @used-by \TFC\Core\B\Home\Slider::i() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) - * @used-by \TFC\Core\B\Home\Slider::p() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) - * @used-by \Verdepieno\Core\CustomerAddressForm::f() - * @used-by \Wyomind\SimpleGoogleShopping\Model\Observer::checkToGenerate(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/26) + * @used-by Df\Core\Html\Tag::content() + * @used-by Df\Core\Text\Regex::getSubjectReportPart() + * @used-by Df\Framework\Plugin\View\Asset\Source::aroundGetContent() + * @used-by Df\Payment\Comment\Description::getCommentText() + * @used-by Df\Qa\Dumper::dumpArrayElements() + * @used-by Df\Qa\Method::raiseErrorParam() + * @used-by Df\Qa\Method::raiseErrorResult() + * @used-by Df\Qa\Method::raiseErrorVariable() + * @used-by Df\Typography\Css::render() + * @used-by Dfe\AllPay\Block\Info\Barcode::paymentId() + * @used-by Dfe\Frontend\Block\ProductView\Css::_toHtml() + * @used-by Dfe\GoogleFont\ResponseValidator::short() + * @used-by Dfe\Klarna\Button::_toHtml() + * @used-by Dfe\Markdown\FormElement::css() + * @used-by Dfe\Sift\Test\CaseT\API\Account\Decisions::t01() + * @used-by Dfe\Stripe\Block\Multishipping::_toHtml() + * @used-by Inkifi\Map\HTML::tiles() + * @used-by SayItWithAGift\Options\Frontend::_toHtml() + * @used-by CabinetsBay\Catalog\B\Category::title() (https://github.com/cabinetsbay/catalog/issues/5) + * @used-by TFC\Core\B\Home\Slider::i() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) + * @used-by TFC\Core\B\Home\Slider::p() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/43) + * @used-by Verdepieno\Core\CustomerAddressForm::f() + * @used-by Wyomind\SimpleGoogleShopping\Model\Observer::checkToGenerate(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/26) * @used-by app/code/WeltPixel/QuickCart/view/frontend/templates/checkout/cart/item/price/sidebar.phtml (https://github.com/cabinetsbay/site/issues/145) * @used-by https://github.com/tradefurniturecompany/report/blob/1.0.3/view/frontend/templates/index.phtml#L25 * @used-by vendor/cabinetsbay/catalog/view/frontend/templates/category/l2/l3/filters.phtml (https://github.com/cabinetsbay/catalog/issues/18) From 3882b99f22b4f43194e9bac0c8e0967869d8d2d6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:24:40 +0100 Subject: [PATCH 458/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/n/explode.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/lib/text/n/explode.php b/Core/lib/text/n/explode.php index 914f13535..95c301070 100644 --- a/Core/lib/text/n/explode.php +++ b/Core/lib/text/n/explode.php @@ -5,12 +5,12 @@ * @used-by df_parse_colon() * @used-by df_tab() * @used-by df_zf_http_last_req() - * @used-by \Df\Core\Text\Regex::getSubjectSplitted() - * @used-by \Dfe\AllPay\Charge::descriptionOnKiosk() - * @used-by \Dfe\Moip\P\Charge::pInstructionLines() - * @used-by \Dfe\TBCBank\W\Reader::reqFilter() - * @used-by \Doormall\Shipping\Partner\Entity::locations() - * @used-by \Inkifi\Core\Plugin\Catalog\Block\Product\View::afterSetLayout() + * @used-by Df\Core\Text\Regex::getSubjectSplitted() + * @used-by Dfe\AllPay\Charge::descriptionOnKiosk() + * @used-by Dfe\Moip\P\Charge::pInstructionLines() + * @used-by Dfe\TBCBank\W\Reader::reqFilter() + * @used-by Doormall\Shipping\Partner\Entity::locations() + * @used-by Inkifi\Core\Plugin\Catalog\Block\Product\View::afterSetLayout() * @return string[] */ function df_explode_n(string $s):array {return explode("\n", df_normalize(df_trim($s)));} \ No newline at end of file From 37f412b71ce0b8fdc13eeaf666dbc4b5fa8f8db6 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:24:45 +0100 Subject: [PATCH 459/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/n/has.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/text/n/has.php b/Core/lib/text/n/has.php index 4155d9a4f..a7db12f25 100644 --- a/Core/lib/text/n/has.php +++ b/Core/lib/text/n/has.php @@ -1,8 +1,8 @@ Date: Tue, 24 Sep 2024 10:24:50 +0100 Subject: [PATCH 460/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/n/normalize.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/text/n/normalize.php b/Core/lib/text/n/normalize.php index c49a5190d..56f2e3e1a 100644 --- a/Core/lib/text/n/normalize.php +++ b/Core/lib/text/n/normalize.php @@ -5,6 +5,6 @@ * @used-by df_is_multiline() * @used-by df_single_line() * @used-by df_string() - * @used-by \Df\Qa\Dumper::dumpS() + * @used-by Df\Qa\Dumper::dumpS() */ function df_normalize(string $s):string {return strtr($s, ["\r\n" => "\n", "\r" => "\n"]);} \ No newline at end of file From 543ba9ccd7f21ba9ac64d715ab66e5173b2c9403 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:24:57 +0100 Subject: [PATCH 461/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/n/prepend.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/text/n/prepend.php b/Core/lib/text/n/prepend.php index bc4b4832e..e0cac0299 100644 --- a/Core/lib/text/n/prepend.php +++ b/Core/lib/text/n/prepend.php @@ -1,7 +1,7 @@ Date: Tue, 24 Sep 2024 10:25:07 +0100 Subject: [PATCH 462/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/prepend-append/.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/text/prepend-append/.php b/Core/lib/text/prepend-append/.php index 7b8b33f5c..fe4a7facc 100644 --- a/Core/lib/text/prepend-append/.php +++ b/Core/lib/text/prepend-append/.php @@ -10,6 +10,6 @@ function df_append(string $s, string $tail):string {return df_ends_with($s, $tai * 2016-03-08 It adds the $head prefix to the $s string if the prefix is absent in $s. * @used-by df_sys_path_abs() * @used-by ikf_ite() - * @used-by \Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterGetElementHtml() + * @used-by Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterGetElementHtml() */ function df_prepend(string $s, string $head):string {return df_starts_with($s, $head) ? $s : $head . $s;} \ No newline at end of file From 4534749d25a5945438bb6adf5b844670f94e8403 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:25:12 +0100 Subject: [PATCH 463/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/prepend-append/pad.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/text/prepend-append/pad.php b/Core/lib/text/prepend-append/pad.php index 13a8b071b..4ecccd313 100644 --- a/Core/lib/text/prepend-append/pad.php +++ b/Core/lib/text/prepend-append/pad.php @@ -3,7 +3,7 @@ * Аналог @see str_pad() для Unicode: http://stackoverflow.com/a/14773638 * @used-by df_kv() * @used-by df_pad0() - * @used-by \Dfe\Moip\CardFormatter::label() + * @used-by Dfe\Moip\CardFormatter::label() */ function df_pad(string $phrase, int $length, string $pattern = ' ', int $position = STR_PAD_RIGHT):string {/** @var string $r */ $encoding = 'UTF-8'; /** @var string $encoding */ From 672546871dbea75bc14726c7fa9c309fb69a74ba Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:25:20 +0100 Subject: [PATCH 464/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/prepend-append/tab.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/lib/text/prepend-append/tab.php b/Core/lib/text/prepend-append/tab.php index bb19260ef..d4d54094b 100644 --- a/Core/lib/text/prepend-append/tab.php +++ b/Core/lib/text/prepend-append/tab.php @@ -2,12 +2,12 @@ /** * 2022-11-26, 2024-09-23 * @used-by df_tab() - * @used-by \Df\Core\Html\Tag::content() - * @used-by \Df\Core\Html\Tag::openTagWithAttributesAsText() - * @used-by \Df\Qa\Dumper::dumpArray() - * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Qa\Dumper::dumpObject() - * @used-by \Df\Typography\Css::render() + * @used-by Df\Core\Html\Tag::content() + * @used-by Df\Core\Html\Tag::openTagWithAttributesAsText() + * @used-by Df\Qa\Dumper::dumpArray() + * @used-by Df\Qa\Dumper::dumpObject() + * @used-by Df\Qa\Dumper::dumpObject() + * @used-by Df\Typography\Css::render() * @param string|iterable $v */ function df_tab($v):string {return !is_iterable($v) ? df_tab(df_explode_n($v)) : From fd0550272e8a36b98effd113bd219b5e02fe2c82 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:25:30 +0100 Subject: [PATCH 465/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/camel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/text/camel.php b/Core/lib/text/camel.php index 0e34e28f6..776217997 100644 --- a/Core/lib/text/camel.php +++ b/Core/lib/text/camel.php @@ -3,7 +3,7 @@ * 2021-12-20 * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @see df_underscore_to_camel() - * @used-by \TFC\GoogleShopping\Products::atts() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) + * @used-by TFC\GoogleShopping\Products::atts() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) * @param string|string[] ...$a * @return string|string[] */ @@ -64,7 +64,7 @@ function df_explode_camel(...$a):array {return df_call_a(function(string $n):arr * refund_issuED => RefundIssued * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @see df_camel_to_underscore() - * @used-by \Dfe\TwoCheckout\Handler::p() + * @used-by Dfe\TwoCheckout\Handler::p() * @param string|string[] ...$a * @return string|string[] */ From 3da20649c12413b18fd79f00ae9c625404058ebc Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:25:37 +0100 Subject: [PATCH 466/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/concatenate.php | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Core/lib/text/concatenate.php b/Core/lib/text/concatenate.php index 35fd30a18..d800a5fda 100644 --- a/Core/lib/text/concatenate.php +++ b/Core/lib/text/concatenate.php @@ -11,9 +11,9 @@ function df_c(...$a):string {return implode(dfa_flatten($a));} * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @see df_ccc() * @used-by df_js_data() - * @used-by \Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) - * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Dfe\Sift\API\Facade\GetDecisions::path() + * @used-by Alignet\Paymecheckout\Model\Client\Classic\Order\DataGetter::userCodePayme() (innomuebles.com, https://github.com/innomuebles/m2/issues/17) + * @used-by Df\Qa\Trace\Formatter::p() + * @used-by Dfe\Sift\API\Facade\GetDecisions::path() * @param string|string[] ...$a */ function df_cc(string $glue, ...$a):string {return implode($glue, dfa_flatten($a));} @@ -21,10 +21,10 @@ function df_cc(string $glue, ...$a):string {return implode($glue, dfa_flatten($a /** * 2016-08-13 * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm - * @used-by \Df\Payment\Settings::messageFailure() - * @used-by \Dfe\AllPay\Choice::title() - * @used-by \Dfe\Square\API\Validator::short() - * @used-by \Stock2Shop\OrderExport\Observer\OrderSaveAfter::execute() + * @used-by Df\Payment\Settings::messageFailure() + * @used-by Dfe\AllPay\Choice::title() + * @used-by Dfe\Square\API\Validator::short() + * @used-by Stock2Shop\OrderExport\Observer\OrderSaveAfter::execute() * @param string|string[] ...$a */ function df_cc_br(...$a):string {return df_ccc("
", dfa_flatten($a));} @@ -36,19 +36,19 @@ function df_cc_br(...$a):string {return df_ccc("
", dfa_flatten($a));} * @used-by df_cli_cmd() * @used-by df_log_l() * @used-by dfe_modules_info() - * @used-by \Dfe\Square\Block\Info::prepare() - * @used-by \Dfe\Stripe\Block\Multishipping::cardholder() - * @used-by \Frugue\Shipping\Header::_toHtml() - * @used-by \Hotlink\Brightpearl\Model\Api\Transport::_submit() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/site/issues/122) - * @used-by \Inkifi\Mediaclip\API\Client::headers() - * @used-by \KingPalm\B2B\Block\Registration::_toHtml() - * @used-by \KingPalm\B2B\Block\Registration::e() - * @used-by \KingPalm\B2B\Block\Registration::region() - * @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute() - * @used-by \TFC\GoogleShopping\Att\Price::format() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/6) + * @used-by Dfe\Square\Block\Info::prepare() + * @used-by Dfe\Stripe\Block\Multishipping::cardholder() + * @used-by Frugue\Shipping\Header::_toHtml() + * @used-by Hotlink\Brightpearl\Model\Api\Transport::_submit() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/site/issues/122) + * @used-by Inkifi\Mediaclip\API\Client::headers() + * @used-by KingPalm\B2B\Block\Registration::_toHtml() + * @used-by KingPalm\B2B\Block\Registration::e() + * @used-by KingPalm\B2B\Block\Registration::region() + * @used-by KingPalm\B2B\Observer\RegisterSuccess::execute() + * @used-by TFC\GoogleShopping\Att\Price::format() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/6) * @used-by app/code/WeltPixel/QuickCart/view/frontend/templates/checkout/cart/item/price/sidebar.phtml (https://github.com/cabinetsbay/site/issues/145) * @used-by vendor/cabinetsbay/core/view/frontend/templates/Magento/Tax/item/price/unit.phtml (https://github.com/cabinetsbay/site/issues/143) - * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() + * @used-by Wolf\Filter\Block\Navigation::hDropdowns() * @param string|string[] ...$a */ function df_cc_s(...$a):string {return df_ccc(' ', dfa_flatten($a));} @@ -67,16 +67,16 @@ function df_cc_s(...$a):string {return df_ccc(' ', dfa_flatten($a));} * @used-by df_report_prefix() * @used-by df_sentry() * @used-by df_url_bp() - * @used-by \Df\Payment\Comment\Description::locations() - * @used-by \Df\Payment\TID::e2i() - * @used-by \Df\Payment\W\Handler::log() - * @used-by \Df\Payment\W\Reader::testData() - * @used-by \Df\Qa\Trace\Formatter::p() - * @used-by \Dfe\AllPay\Block\Info\BankCard::custom() - * @used-by \Dfe\AllPay\Charge::pIgnorePayment() - * @used-by \Dfe\AllPay\Charge::productUrls() - * @used-by \Dfe\AmazonLogin\Customer::url() - * @used-by \Dfe\TwoCheckout\Charge::liDiscount() + * @used-by Df\Payment\Comment\Description::locations() + * @used-by Df\Payment\TID::e2i() + * @used-by Df\Payment\W\Handler::log() + * @used-by Df\Payment\W\Reader::testData() + * @used-by Df\Qa\Trace\Formatter::p() + * @used-by Dfe\AllPay\Block\Info\BankCard::custom() + * @used-by Dfe\AllPay\Charge::pIgnorePayment() + * @used-by Dfe\AllPay\Charge::productUrls() + * @used-by Dfe\AmazonLogin\Customer::url() + * @used-by Dfe\TwoCheckout\Charge::liDiscount() * @param string|string[] ...$a */ function df_ccc(string $glue, ...$a):string {return implode($glue, df_clean(dfa_flatten($a)));} \ No newline at end of file From a68c7b4d6d9563cf5009549b81fd33876b8d48e1 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:25:43 +0100 Subject: [PATCH 467/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/csv.php | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Core/lib/text/csv.php b/Core/lib/text/csv.php index 13e81ea85..3c8c302e7 100644 --- a/Core/lib/text/csv.php +++ b/Core/lib/text/csv.php @@ -8,9 +8,9 @@ * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @see df_csv() * @used-by df_oro_get_list() - * @used-by \Dfe\AlphaCommerceHub\Charge::pCharge() - * @used-by \Dfe\CheckoutCom\Method::disableEvent() - * @used-by \Dfe\FacebookLogin\Customer::r() + * @used-by Dfe\AlphaCommerceHub\Charge::pCharge() + * @used-by Dfe\CheckoutCom\Method::disableEvent() + * @used-by Dfe\FacebookLogin\Customer::r() * @param string|string[] ...$a */ function df_csv(...$a):string {return implode(',', df_args($a));} @@ -28,14 +28,14 @@ function df_csv_o():Csv {return df_new_om(Csv::class);} * @used-by df_csv_parse_int() * @used-by df_days_off() * @used-by df_fe_fc_csv() - * @used-by \BlushMe\Checkout\Block\Extra::items() - * @used-by \Df\Config\Settings::csv() - * @used-by \Df\Framework\Validator\Currency::__construct() - * @used-by \Df\Payment\Method::amountFactor() - * @used-by \Df\Payment\Method::canUseForCountryP() - * @used-by \Dfe\CheckoutCom\Handler::isInitiatedByMyself() - * @used-by \Dfe\CheckoutCom\Method::disableEvent() - * @used-by \Wolf\Filter\Block\Navigation::hDropdowns() + * @used-by BlushMe\Checkout\Block\Extra::items() + * @used-by Df\Config\Settings::csv() + * @used-by Df\Framework\Validator\Currency::__construct() + * @used-by Df\Payment\Method::amountFactor() + * @used-by Df\Payment\Method::canUseForCountryP() + * @used-by Dfe\CheckoutCom\Handler::isInitiatedByMyself() + * @used-by Dfe\CheckoutCom\Method::disableEvent() + * @used-by Wolf\Filter\Block\Navigation::hDropdowns() * @param string|null $s * @return string[] */ @@ -43,7 +43,7 @@ function df_csv_parse($s, string $d = ','):array {return !$s ? [] : df_trim(expl /** * @used-by df_days_off() - * @used-by \CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/site/issues/98) + * @used-by CabinetsBay\Catalog\B\Category::l3p() (https://github.com/cabinetsbay/site/issues/98) * @used-by vendor/cabinetsbay/core/view/frontend/templates/home.phtml (https://github.com/cabinetsbay/core/issues/8) * @param string|null $s * @return int[] @@ -62,12 +62,12 @@ function df_csv_parse_int($s):array {return df_int(df_csv_parse($s));} * @used-by df_oro_headers() * @used-by df_style_inline_hide() * @used-by dfe_modules_log() - * @used-by \Df\Config\Backend\ArrayT::processI() - * @used-by \Df\Framework\Validator\Currency::message() - * @used-by \Df\Sentry\Client::send() - * @used-by \Dfe\Geo\Client::all() - * @used-by \Dfe\Moip\P\Reg::ga() - * @used-by \Dfe\Sift\Payload\OQI::p() + * @used-by Df\Config\Backend\ArrayT::processI() + * @used-by Df\Framework\Validator\Currency::message() + * @used-by Df\Sentry\Client::send() + * @used-by Dfe\Geo\Client::all() + * @used-by Dfe\Moip\P\Reg::ga() + * @used-by Dfe\Sift\Payload\OQI::p() * @param string|string[] ...$a */ function df_csv_pretty(...$a):string {return implode(', ', dfa_flatten($a));} From 49bb5bee2bcff75bdbcb98cb342c2508e0ceff84 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:25:49 +0100 Subject: [PATCH 468/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/explode.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Core/lib/text/explode.php b/Core/lib/text/explode.php index 3da7d5d9e..ee2ac70f2 100644 --- a/Core/lib/text/explode.php +++ b/Core/lib/text/explode.php @@ -3,7 +3,7 @@ * 2016-03-25 «charge.dispute.funds_reinstated» => [charge, dispute, funds, reinstated] * @used-by df_explode_class() * @used-by df_fe_name_short() - * @used-by \Df\Payment\W\F::c() + * @used-by Df\Payment\W\F::c() * @param string[] $delimiters * @return string[] */ @@ -19,9 +19,9 @@ function df_explode_multiple(array $delimiters, string $s):array { * 2016-09-03 Another implementation: df_explode_multiple(['/', DS], $path) * @used-by df_store_code_from_url() * @used-by df_url_trim_index() - * @used-by \Df\Config\Comment::groupPath() - * @used-by \Df\Config\Source::pathA() - * @used-by \Df\Qa\Trace\Frame::url() + * @used-by Df\Config\Comment::groupPath() + * @used-by Df\Config\Source::pathA() + * @used-by Df\Qa\Trace\Frame::url() * @return string[] */ function df_explode_path(string $p):array {return df_explode_xpath(df_path_n($p));} @@ -33,8 +33,8 @@ function df_explode_path(string $p):array {return df_explode_xpath(df_path_n($p) * @used-by df_magento_version_remote() * @used-by df_phone_explode() * @used-by df_webserver() - * @used-by \Dfe\AmazonLogin\Customer::nameA() - * @used-by \Df\Framework\Form\Element::getClassDfOnly() + * @used-by Dfe\AmazonLogin\Customer::nameA() + * @used-by Df\Framework\Form\Element::getClassDfOnly() * @return string[] */ function df_explode_space(string $s):array {return @@ -49,7 +49,7 @@ function df_explode_space(string $s):array {return ;} /** - * @used-by \TFC\Core\Router::match() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/40) + * @used-by TFC\Core\Router::match() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/40) * @return string[] */ function df_explode_url(string $url):array {return explode('/', $url);} @@ -63,7 +63,7 @@ function df_explode_url(string $url):array {return explode('/', $url);} * @used-by dfa_deep() * @used-by dfa_deep_set() * @used-by dfa_deep_unset() - * @used-by \Df\Config\Backend::value() + * @used-by Df\Config\Backend::value() * @param string|string[] $p * @return string[] */ From 37eb8262be0377549d968085de92f372c97e4ce3 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:25:54 +0100 Subject: [PATCH 469/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/filter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/lib/text/filter.php b/Core/lib/text/filter.php index de717cb35..16590541d 100644 --- a/Core/lib/text/filter.php +++ b/Core/lib/text/filter.php @@ -40,7 +40,7 @@ function df_remove_non_digits(string $s):string {return preg_replace('[\D]', '', * 2022-11-26 * We can not declare the argument as `string ...$remove` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @used-by df_phone_explode() - * @used-by \Dfe\IPay88\Signer::adjust() + * @used-by Dfe\IPay88\Signer::adjust() * @param string|string[] ...$remove */ function df_string_clean(string $s, ...$remove):string {return str_replace(dfa_flatten($remove), null, $s);} @@ -88,9 +88,9 @@ function df_string_clean(string $s, ...$remove):string {return str_replace(dfa_f * I have adapted an implementation from here: https://stackoverflow.com/questions/3371697#comment63507856_3371773 * * @used-by df_translit_url() - * @used-by \Dfe\AlphaCommerceHub\Charge::textFilter() - * @used-by \Dfe\AlphaCommerceHub\Charge::textFilterStreet() - * @used-by \Dfe\Stripe\Block\Multishipping::cardholder() - * @used-by \Dfe\TBCBank\Charge::textFilter() + * @used-by Dfe\AlphaCommerceHub\Charge::textFilter() + * @used-by Dfe\AlphaCommerceHub\Charge::textFilterStreet() + * @used-by Dfe\Stripe\Block\Multishipping::cardholder() + * @used-by Dfe\TBCBank\Charge::textFilter() */ function df_translit(string $s):string {return transliterator_transliterate('Any-Latin; Latin-ASCII', $s);} \ No newline at end of file From bcdac7000409ecfa89a2473e34a1a198e8f06d9b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:26:00 +0100 Subject: [PATCH 470/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/format.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Core/lib/text/format.php b/Core/lib/text/format.php index a08fdf9ae..6109e5788 100644 --- a/Core/lib/text/format.php +++ b/Core/lib/text/format.php @@ -5,21 +5,21 @@ * 2020-02-04 * @used-by dfp_card_format_last4() * @used-by dfp_methods() - * @used-by \Df\Config\Source\LetterCase::map() - * @used-by \Dfe\GoogleFont\Font\Variant\Preview::text() - * @used-by \Dfe\ZohoBI\Source\Organization::fetch() - * @used-by \Dfe\AllPay\Block\Info\BankCard::eci() - * @used-by \Dfe\AllPay\W\Event\Offline::expirationS() - * @used-by \Dfe\CheckoutCom\Response::messageC() - * @used-by \Dfe\Sift\Payload\Promotion\Discount::desc() - * @used-by \Dfe\Stripe\Facade\Charge::refundAdjustments() + * @used-by Df\Config\Source\LetterCase::map() + * @used-by Dfe\GoogleFont\Font\Variant\Preview::text() + * @used-by Dfe\ZohoBI\Source\Organization::fetch() + * @used-by Dfe\AllPay\Block\Info\BankCard::eci() + * @used-by Dfe\AllPay\W\Event\Offline::expirationS() + * @used-by Dfe\CheckoutCom\Response::messageC() + * @used-by Dfe\Sift\Payload\Promotion\Discount::desc() + * @used-by Dfe\Stripe\Facade\Charge::refundAdjustments() */ function df_desc(string $s1, string $s2):string {return df_es($s1) ? $s2 : (df_es($s2) || $s2 === $s1 ? $s1 : "$s1 ($s2)");} /** * @used-by df_checkout_error() * @used-by df_error_create() - * @used-by \Df\Payment\W\Exception::__construct() + * @used-by Df\Payment\W\Exception::__construct() * @param mixed ...$a */ function df_format(...$a):string { /** @var string $r */ @@ -110,10 +110,10 @@ function df_sprintf_strict($s):string {/** @var string $r */ /** @var mixed[] $a * 2016-03-09 Замещает переменные в тексте. * 2016-08-07 Сегодня разработал аналогичные функции для JavaScript: df.string.template() и df.t(). * @used-by df_file_name() - * @used-by \Dfe\GingerPaymentsBase\Block\Info::btInstructions() - * @used-by \Df\Payment\Charge::text() - * @used-by \Df\Payment\Settings::messageFailure() - * @used-by \Dfe\SalesSequence\Plugin\Model\Manager::affix() + * @used-by Dfe\GingerPaymentsBase\Block\Info::btInstructions() + * @used-by Df\Payment\Charge::text() + * @used-by Df\Payment\Settings::messageFailure() + * @used-by Dfe\SalesSequence\Plugin\Model\Manager::affix() * @param array(string => string) $variables * @param string|callable|null $onUnknown */ From 2395a2b4501fa9ecda8461604e0a6040d6577654 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:26:06 +0100 Subject: [PATCH 471/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/main.php | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Core/lib/text/main.php b/Core/lib/text/main.php index 3e2eeae22..ced85257e 100644 --- a/Core/lib/text/main.php +++ b/Core/lib/text/main.php @@ -5,8 +5,8 @@ * 1) IntelliJ IDEA этого не показывает, но пробел здесь не обычный, а узкий: https://en.wikipedia.org/wiki/Thin_space * 2) Глобальные константы появились в PHP 5.3: * http://www.codingforums.com/php/303927-unexpected-t_const-php-version-5-2-17-a.html - * @used-by \Dfe\CurrencyFormat\O::options() - * @used-by \Dfe\CurrencyFormat\O::thousandsSeparator() + * @used-by Dfe\CurrencyFormat\O::options() + * @used-by Dfe\CurrencyFormat\O::thousandsSeparator() */ const DF_THIN_SPACE = ' '; @@ -17,7 +17,7 @@ */ function df_string_split(string $s):array {return preg_split("//u", $s, -1, PREG_SPLIT_NO_EMPTY);} -/** @used-by \Df\PaypalClone\W\Event::validate() */ +/** @used-by Df\PaypalClone\W\Event::validate() */ function df_strings_are_equal_ci(string $s1, string $s2):bool {return 0 === strcmp(mb_strtolower($s1), mb_strtolower($s2));} /** @@ -29,24 +29,24 @@ function df_t():T {return T::s();} /** * 2016-07-05 $length - это длина уникальной части, без учёта $prefix. - * @used-by \Df\Core\Test\lib\DbColumn::df_db_column_add_drop() - * @used-by \Df\Core\Test\lib\DbColumn::df_db_column_add_drop_2() - * @used-by \Df\Core\Test\lib\DbColumn::df_db_column_rename() - * @used-by \Df\Core\Test\lib\DbColumn::df_db_column_rename() - * @used-by \Df\Framework\Form\Element\Multiselect::getElementHtml() - * @used-by \Df\Sso\Button::attributes() - * @used-by \Dfe\Moip\P\Reg::p() - * @used-by \Dfe\Moip\Test\CaseT\Customer::pCustomer() - * @used-by \Dfe\Moip\Test\CaseT\Notification::create() - * @used-by \Dfe\Moip\Test\Order::pOrder() - * @used-by \Dfe\Omise\Test\Customer::tRetrieveNonExistent() - * @used-by \Dfe\SecurePay\Refund::process() - * @used-by \Dfe\Sift\Session::get() - * @used-by \Dfe\TBCBank\Charge::pCharge() - * @used-by \Dfe\TBCBank\Test\CaseT\Regular::transId() - * @used-by \Dfe\Vantiv\Test\CaseT\Charge::req() - * @used-by \Inkifi\Pwinty\T\CaseT\V30\Order\AddImage::t01() - * @used-by \Inkifi\Pwinty\T\CaseT\V30\Order\AddImage::t02() + * @used-by Df\Core\Test\lib\DbColumn::df_db_column_add_drop() + * @used-by Df\Core\Test\lib\DbColumn::df_db_column_add_drop_2() + * @used-by Df\Core\Test\lib\DbColumn::df_db_column_rename() + * @used-by Df\Core\Test\lib\DbColumn::df_db_column_rename() + * @used-by Df\Framework\Form\Element\Multiselect::getElementHtml() + * @used-by Df\Sso\Button::attributes() + * @used-by Dfe\Moip\P\Reg::p() + * @used-by Dfe\Moip\Test\CaseT\Customer::pCustomer() + * @used-by Dfe\Moip\Test\CaseT\Notification::create() + * @used-by Dfe\Moip\Test\Order::pOrder() + * @used-by Dfe\Omise\Test\Customer::tRetrieveNonExistent() + * @used-by Dfe\SecurePay\Refund::process() + * @used-by Dfe\Sift\Session::get() + * @used-by Dfe\TBCBank\Charge::pCharge() + * @used-by Dfe\TBCBank\Test\CaseT\Regular::transId() + * @used-by Dfe\Vantiv\Test\CaseT\Charge::req() + * @used-by Inkifi\Pwinty\T\CaseT\V30\Order\AddImage::t01() + * @used-by Inkifi\Pwinty\T\CaseT\V30\Order\AddImage::t02() */ function df_uid(int $length = 0, string $prefix = ''):string { # Важно использовать $more_entropy = true, потому что иначе на быстрых серверах From 45c83ff1ddbcf2cbeb2d3b1d124761a1a7dd5315 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:28:09 +0100 Subject: [PATCH 472/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/parse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/text/parse.php b/Core/lib/text/parse.php index 4280d5fb5..6caee38b6 100644 --- a/Core/lib/text/parse.php +++ b/Core/lib/text/parse.php @@ -1,7 +1,7 @@ string) */ function df_parse_colon(string $s):array {return df_map_r(df_explode_n($s), function(string $s):array {return df_trim( From 95bf1e301e7b904e879a149028a94730f8cad671 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:28:16 +0100 Subject: [PATCH 473/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/quote.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/lib/text/quote.php b/Core/lib/text/quote.php index 06ed0af18..3b35fbab3 100644 --- a/Core/lib/text/quote.php +++ b/Core/lib/text/quote.php @@ -11,8 +11,8 @@ function df_quote_double($s) {return df_t()->quote($s, T::QUOTE__DOUBLE);} /** * @used-by df_csv_pretty_quote() - * @used-by \Df\Config\Backend::label() - * @used-by \Df\Framework\Validator\Currency::message() + * @used-by Df\Config\Backend::label() + * @used-by Df\Framework\Validator\Currency::message() * @param string|string[]|P|P[] $s * @return string|string[] */ @@ -20,8 +20,8 @@ function df_quote_russian($s) {return df_t()->quote($s, T::QUOTE__RUSSIAN);} /** * @used-by df_ejs() - * @used-by \Df\Typography\Font::css() - * @used-by \Dfe\Frontend\Block\ProductView\Css::customCss() + * @used-by Df\Typography\Font::css() + * @used-by Dfe\Frontend\Block\ProductView\Css::customCss() * @param string|string[]|P|P[] $s * @return string|string[] */ From 9ea13e1aba7b555a981acdd9cc67c9517c19a2b5 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:28:23 +0100 Subject: [PATCH 474/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/regex.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/text/regex.php b/Core/lib/text/regex.php index 7790e9ff9..c8421248e 100644 --- a/Core/lib/text/regex.php +++ b/Core/lib/text/regex.php @@ -2,7 +2,7 @@ use Df\Core\Text\Regex as R; /** - * @used-by \Df\Typography\Font::variantNumber() + * @used-by Df\Typography\Font::variantNumber() * @return int|null|bool */ function df_preg_int(string $pattern, string $subject, bool $throwOnNotMatch = false) {return R::i( @@ -21,7 +21,7 @@ function df_preg_match(string $pattern, string $subject, bool $throwOnNotMatch = /** * 2018-11-11 - * @used-by \Dfe\TBCBank\Test\CaseT\Validator::t01() + * @used-by Dfe\TBCBank\Test\CaseT\Validator::t01() * @return int|null|bool */ function df_preg_prefix(string $prefix, string $subject, bool $throwOnNotMatch = false) {return df_preg_match( From aba912361e8bb446bbe9fe03e8a2deb99fa24e8f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:28:29 +0100 Subject: [PATCH 475/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/starts-ends.php | 76 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Core/lib/text/starts-ends.php b/Core/lib/text/starts-ends.php index 755647389..44fcaea5d 100644 --- a/Core/lib/text/starts-ends.php +++ b/Core/lib/text/starts-ends.php @@ -13,19 +13,19 @@ * @used-by df_is_phtml() * @used-by df_referer_ends_with() * @used-by mnr_recurring_is() - * @used-by \CanadaSatellite\Core\Plugin\Magento\Customer\Api\AccountManagementInterface::aroundIsEmailAvailable() (canadasatellite.ca, https://github.com/canadasatellite-ca/core/issues/1) - * @used-by \Df\Core\Test\lib\csv::t01() - * @used-by \Df\Core\Text\Marker::marked() - * @used-by \Df\Core\Text\Regex::getErrorCodeMap() - * @used-by \Df\Cron\Model\LoggerHandler::p() - * @used-by \Df\Framework\Log\Handler\JsMap::_p() - * @used-by \Df\Paypal\Plugin\Model\Api\Nvp::eligible() - * @used-by \Df\Qa\Trace\Frame::isClosure() - * @used-by \Df\Sentry\Client::needSkipFrame() - * @used-by \Df\Sentry\Trace::get_frame_context() - * @used-by \Df\Zf\Validate\StringT\FloatT::isValid() - * @used-by \Dfe\TBCBank\Facade\Charge::tokenIsNew() - * @used-by \RWCandy\Captcha\Assert::email() + * @used-by CanadaSatellite\Core\Plugin\Magento\Customer\Api\AccountManagementInterface::aroundIsEmailAvailable() (canadasatellite.ca, https://github.com/canadasatellite-ca/core/issues/1) + * @used-by Df\Core\Test\lib\csv::t01() + * @used-by Df\Core\Text\Marker::marked() + * @used-by Df\Core\Text\Regex::getErrorCodeMap() + * @used-by Df\Cron\Model\LoggerHandler::p() + * @used-by Df\Framework\Log\Handler\JsMap::_p() + * @used-by Df\Paypal\Plugin\Model\Api\Nvp::eligible() + * @used-by Df\Qa\Trace\Frame::isClosure() + * @used-by Df\Sentry\Client::needSkipFrame() + * @used-by Df\Sentry\Trace::get_frame_context() + * @used-by Df\Zf\Validate\StringT\FloatT::isValid() + * @used-by Dfe\TBCBank\Facade\Charge::tokenIsNew() + * @used-by RWCandy\Captcha\Assert::email() * @param string|string[] $n */ function df_ends_with(string $haystack, $n):bool {return is_array($n) @@ -59,31 +59,31 @@ function df_ends_with(string $haystack, $n):bool {return is_array($n) * @used-by df_prepend() * @used-by df_starts_with() * @used-by df_zf_http_last_req() - * @used-by \CanadaSatellite\Core\Plugin\Magento\Rss\Controller\Feed::beforeExecute(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) - * @used-by \Df\Core\Test\lib\csv::t01() - * @used-by \Df\Core\Text\Marker::marked() - * @used-by \Df\Cron\Model\LoggerHandler::p() - * @used-by \Df\Framework\Form\Element::getClassDfOnly() - * @used-by \Df\Framework\Log\Handler\JsMap::_p() - * @used-by \Df\Framework\Log\Record::msg() - * @used-by \Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterGetElementHtml() - * @used-by \Df\Framework\Plugin\View\Layout::afterIsCacheable() - * @used-by \Df\Framework\Request::extraKeysRaw() - * @used-by \Df\OAuth\ReturnT::redirectUrl() - * @used-by \Df\Payment\Observer\DataProvider\SearchResult::execute() - * @used-by \Df\Payment\Observer\Multishipping::execute() - * @used-by \Df\Payment\Source\API\Key\Testable::_test() - * @used-by \Df\Payment\TID::i2e() - * @used-by \Df\Qa\Trace::__construct() - * @used-by \Df\StripeClone\Facade\Charge::tokenIsNew() - * @used-by \Df\Webapi\Plugin\Model\ServiceMetadata::aroundGetServiceName() - * @used-by \Df\Zf\Validate\StringT\IntT::isValid() - * @used-by \Dfe\Dynamics365\Test\Basic::products() - * @used-by \Dfe\Stripe\Facade\Token::isCard() - * @used-by \Dfe\Stripe\Facade\Token::isPreviouslyUsedOrTrimmedSource() - * @used-by \KingPalm\B2B\Schema::isCustom() - * @used-by \Stock2Shop\OrderExport\Payload::payment() - * @used-by \TFC\Core\Plugin\MediaStorage\App\Media::aroundLaunch() + * @used-by CanadaSatellite\Core\Plugin\Magento\Rss\Controller\Feed::beforeExecute(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/43) + * @used-by Df\Core\Test\lib\csv::t01() + * @used-by Df\Core\Text\Marker::marked() + * @used-by Df\Cron\Model\LoggerHandler::p() + * @used-by Df\Framework\Form\Element::getClassDfOnly() + * @used-by Df\Framework\Log\Handler\JsMap::_p() + * @used-by Df\Framework\Log\Record::msg() + * @used-by Df\Framework\Plugin\Data\Form\Element\AbstractElement::afterGetElementHtml() + * @used-by Df\Framework\Plugin\View\Layout::afterIsCacheable() + * @used-by Df\Framework\Request::extraKeysRaw() + * @used-by Df\OAuth\ReturnT::redirectUrl() + * @used-by Df\Payment\Observer\DataProvider\SearchResult::execute() + * @used-by Df\Payment\Observer\Multishipping::execute() + * @used-by Df\Payment\Source\API\Key\Testable::_test() + * @used-by Df\Payment\TID::i2e() + * @used-by Df\Qa\Trace::__construct() + * @used-by Df\StripeClone\Facade\Charge::tokenIsNew() + * @used-by Df\Webapi\Plugin\Model\ServiceMetadata::aroundGetServiceName() + * @used-by Df\Zf\Validate\StringT\IntT::isValid() + * @used-by Dfe\Dynamics365\Test\Basic::products() + * @used-by Dfe\Stripe\Facade\Token::isCard() + * @used-by Dfe\Stripe\Facade\Token::isPreviouslyUsedOrTrimmedSource() + * @used-by KingPalm\B2B\Schema::isCustom() + * @used-by Stock2Shop\OrderExport\Payload::payment() + * @used-by TFC\Core\Plugin\MediaStorage\App\Media::aroundLaunch() * @param string|string[] $n */ function df_starts_with(string $haystack, $n):bool {return is_array($n) From 40e31bceba54b1a5ebd3456e80f387ecb16fa9b8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:28:38 +0100 Subject: [PATCH 476/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/transform.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/lib/text/transform.php b/Core/lib/text/transform.php index a4c283fa0..f7f2dbcb8 100644 --- a/Core/lib/text/transform.php +++ b/Core/lib/text/transform.php @@ -27,7 +27,7 @@ function df_strtolower(...$a) {return df_call_a($a, function(string $s):string { * 2016-05-19 * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @see df_lcfirst - * @used-by \Dfe\Stripe\Block\Multishipping::cardholder() + * @used-by Dfe\Stripe\Block\Multishipping::cardholder() * @param string|string[] ...$a * @return string|string[] */ @@ -40,9 +40,9 @@ function df_strtoupper(...$a) {return df_call_a($a, function(string $s):string { * @used-by df_assert_gd() * @used-by df_cc_class_uc() * @used-by df_underscore_to_camel() - * @used-by \Df\Config\Source\LetterCase::apply() - * @used-by \Df\Qa\Trace\Frame::url() - * @used-by \Dfe\TwoCheckout\LineItem::build() + * @used-by Df\Config\Source\LetterCase::apply() + * @used-by Df\Qa\Trace\Frame::url() + * @used-by Dfe\TwoCheckout\LineItem::build() * @param string|string[] ...$a * @return string|string[] */ @@ -56,7 +56,7 @@ function df_ucfirst(...$a) {return df_call_a(function(string $s):string {return * https://php.net/manual/function.mb-convert-case.php#refsect1-function.mb-convert-case-parameters * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @see df_ucfirst - * @used-by \Df\Config\Source\LetterCase::apply() + * @used-by Df\Config\Source\LetterCase::apply() * @param string|string[] ...$a * @return string|string[] */ From bd468941c6774bd6b0328ce8bc764c6bcc4ce7fd Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:28:43 +0100 Subject: [PATCH 477/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/text/trim.php | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/Core/lib/text/trim.php b/Core/lib/text/trim.php index 1fc6dcd37..5ab012224 100644 --- a/Core/lib/text/trim.php +++ b/Core/lib/text/trim.php @@ -7,13 +7,13 @@ /** * 2017-06-09 * @used-by df_oqi_desc() - * @used-by \Df\Payment\Charge::text() - * @used-by \Df\Sentry\Serializer::chop() - * @used-by \Dfe\IPay88\Charge::pCharge() - * @used-by \Dfe\Qiwi\Charge::pBill() - * @used-by \Dfe\TwoCheckout\LineItem::adjustText() - * @used-by \Dfe\YandexKassa\Charge::pTaxLeaf() - * @used-by \Dfe\YandexKassa\Result::attributes() + * @used-by Df\Payment\Charge::text() + * @used-by Df\Sentry\Serializer::chop() + * @used-by Dfe\IPay88\Charge::pCharge() + * @used-by Dfe\Qiwi\Charge::pBill() + * @used-by Dfe\TwoCheckout\LineItem::adjustText() + * @used-by Dfe\YandexKassa\Charge::pTaxLeaf() + * @used-by Dfe\YandexKassa\Result::attributes() */ function df_chop(string $s, int $max = 0):string {return !$max || (mb_strlen($s = df_trim($s)) <= $max) ? $s : df_trim_right(mb_substr($s, 0, $max - 1)) . '…' @@ -39,18 +39,18 @@ function df_chop(string $s, int $max = 0):string {return !$max || (mb_strlen($s * @used-by df_trim() * @used-by df_trim_ds() * @used-by df_xml_x() - * @used-by \Df\Config\Source\LetterCase::apply() - * @used-by \Df\Core\Html\Tag::content() - * @used-by \Df\Framework\Form\Element::uidSt() - * @used-by \Df\Qa\Dumper::dumpS() - * @used-by \Df\Qa\Failure::sections() - * @used-by \Dfe\Portal\Block\Content::getTemplate() - * @used-by \Dfe\Portal\Controller\Index\Index::execute() - * @used-by \Dfe\Portal\Router::match() - * @used-by \Dfe\TwitterTimeline\Block::_toHtml() - * @used-by \Dfe\TwoCheckout\Address::line() - * @used-by \Dfe\TwoCheckout\Method::_refund() - * @used-by \Inkifi\Core\Plugin\Catalog\Block\Product\View::afterSetLayout() + * @used-by Df\Config\Source\LetterCase::apply() + * @used-by Df\Core\Html\Tag::content() + * @used-by Df\Framework\Form\Element::uidSt() + * @used-by Df\Qa\Dumper::dumpS() + * @used-by Df\Qa\Failure::sections() + * @used-by Dfe\Portal\Block\Content::getTemplate() + * @used-by Dfe\Portal\Controller\Index\Index::execute() + * @used-by Dfe\Portal\Router::match() + * @used-by Dfe\TwitterTimeline\Block::_toHtml() + * @used-by Dfe\TwoCheckout\Address::line() + * @used-by Dfe\TwoCheckout\Method::_refund() + * @used-by Inkifi\Core\Plugin\Catalog\Block\Product\View::afterSetLayout() * @param string|string[] $s * @param string $charlist [optional] * @param bool|mixed|Closure $throw [optional] @@ -92,8 +92,8 @@ function df_trim($s, $charlist = null, $throw = false) {return df_try(function() * Пусть пока будет так. Потом, если потребуется, добавлю дополнительную обработку спецсимволов Unicode. * 2017-08-18 Today I have noticed that $charlist = null does not work for @uses ltrim() * @used-by df_trim_ds_left() - * @used-by \Df\Config\Settings::phpNameToKey() - * @used-by \Dfe\PostFinance\W\Event::cardNumber() + * @used-by Df\Config\Settings::phpNameToKey() + * @used-by Dfe\PostFinance\W\Event::cardNumber() */ function df_trim_left(string $s, string $charlist = ''):string {return ltrim($s, $charlist ?: " \t\n\r\0\x0B");} @@ -152,14 +152,14 @@ function df_trim_text_a(string $s, array $trimA, callable $f):string { * @used-by df_trim_text_left_right() * @used-by dfpm_code_short() * @used-by dfsm_code_short() - * @used-by \Df\Framework\Request::extra() - * @used-by \Df\PaypalClone\Signer::_sign() - * @used-by \Df\Qa\Trace\Frame::__toString() - * @used-by \Dfe\Qiwi\W\Event::pid() - * @used-by \Dfe\Stripe\Facade\Token::trimmed() - * @used-by \Dfe\TwitterTimeline\Block::_toHtml() - * @used-by \Dfe\Zoho\App::title() - * @used-by \CabinetsBay\Catalog\B\Category::images() (https://github.com/cabinetsbay/catalog/issues/2) + * @used-by Df\Framework\Request::extra() + * @used-by Df\PaypalClone\Signer::_sign() + * @used-by Df\Qa\Trace\Frame::__toString() + * @used-by Dfe\Qiwi\W\Event::pid() + * @used-by Dfe\Stripe\Facade\Token::trimmed() + * @used-by Dfe\TwitterTimeline\Block::_toHtml() + * @used-by Dfe\Zoho\App::title() + * @used-by CabinetsBay\Catalog\B\Category::images() (https://github.com/cabinetsbay/catalog/issues/2) * @param string|string[] $s * @param string|string[] $trim * @return string|string[] @@ -173,8 +173,8 @@ function df_trim_text_left($s, $trim) {return is_array($s) ? df_map(__FUNCTION__ /** * 2021-12-12 * @used-by df_trim_text() - * @used-by \Df\Core\Text\Marker::unmark() - * @used-by \Dfe\TwitterTimeline\Block::_toHtml() + * @used-by Df\Core\Text\Marker::unmark() + * @used-by Dfe\TwitterTimeline\Block::_toHtml() */ function df_trim_text_left_right(string $s, string $left, string $right):string {return df_trim_text_right( df_trim_text_left($s, $left), $right @@ -190,9 +190,9 @@ function df_trim_text_left_right(string $s, string $left, string $right):string * @used-by df_trim_text_left_right() * @used-by df_trim_text_right() * @used-by dfe_portal_stripe_customers() - * @used-by \Df\Framework\Form\Element\Fieldset::nameFull() - * @used-by \Dfe\Oro\Test\Basic::t02_orders_stripe() - * @used-by \Dfe\TwitterTimeline\Block::_toHtml() + * @used-by Df\Framework\Form\Element\Fieldset::nameFull() + * @used-by Dfe\Oro\Test\Basic::t02_orders_stripe() + * @used-by Dfe\TwitterTimeline\Block::_toHtml() * @param string|string[] $s * @param string|string[] $trim * @return string|string[] From e794a3cc0bfad2628e91bd88040916bc429daac9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:28:50 +0100 Subject: [PATCH 478/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/area.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Core/lib/area.php b/Core/lib/area.php index d7a97cf77..f39cf80d3 100644 --- a/Core/lib/area.php +++ b/Core/lib/area.php @@ -24,13 +24,13 @@ function df_area_code($onE = null) {return df_try(function() {return df_app_stat * @used-by df_is_backend() * @used-by df_is_frontend() * @used-by df_is_rest() - * @used-by \Frugue\Store\Plugin\Framework\App\FrontControllerInterface::aroundDispatch() + * @used-by Frugue\Store\Plugin\Framework\App\FrontControllerInterface::aroundDispatch() */ function df_area_code_is(string ...$v):bool {return in_array(df_area_code(), $v);} /** * 2019-06-21 - * @used-by \KingPalm\B2B\Setup\V140\MoveDataToAddress::p() + * @used-by KingPalm\B2B\Setup\V140\MoveDataToAddress::p() */ function df_area_code_set_b():void {df_app_state()->setAreaCode(A::AREA_ADMINHTML);} @@ -46,7 +46,7 @@ function df_area_code_set_d():void {df_area_code() || df_area_code_set_f();} /** * 2019-06-21 * @used-by df_area_code_set_d() - * @used-by \Df\Core\TestCase::setUp() + * @used-by Df\Core\TestCase::setUp() */ function df_area_code_set_f():void {df_app_state()->setAreaCode(A::AREA_FRONTEND);} @@ -78,16 +78,16 @@ function df_area_code_set_f():void {df_app_state()->setAreaCode(A::AREA_FRONTEND * @used-by df_product_current() * @used-by df_session() * @used-by df_store() - * @used-by \Df\Config\Settings::scope() - * @used-by \Df\Framework\Form\Element\Fieldset::addField() - * @used-by \Dfe\GingerPaymentsBase\Block\Info::msgUnconfirmed() - * @used-by \Df\Payment\Block\Info::getIsSecureMode() - * @used-by \Df\Payment\Block\Info::getTemplate() - * @used-by \Df\Payment\Method::getFormBlockType() - * @used-by \Df\Payment\Method::getTitle() - * @used-by \Df\Payment\Method::isAvailable() - * @used-by \Df\Sales\Plugin\Model\Order\Address\Renderer::aroundFormat() - * @used-by \Dfe\Sift\Observer::f() + * @used-by Df\Config\Settings::scope() + * @used-by Df\Framework\Form\Element\Fieldset::addField() + * @used-by Dfe\GingerPaymentsBase\Block\Info::msgUnconfirmed() + * @used-by Df\Payment\Block\Info::getIsSecureMode() + * @used-by Df\Payment\Block\Info::getTemplate() + * @used-by Df\Payment\Method::getFormBlockType() + * @used-by Df\Payment\Method::getTitle() + * @used-by Df\Payment\Method::isAvailable() + * @used-by Df\Sales\Plugin\Model\Order\Address\Renderer::aroundFormat() + * @used-by Dfe\Sift\Observer::f() */ function df_is_backend():bool {return df_area_code_is(A::AREA_ADMINHTML) || df_is_ajax() && df_backend_user();} From af8199867a76f6618488aad4e07e330c4e2dfc97 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:29:00 +0100 Subject: [PATCH 479/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cli.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/cli.php b/Core/lib/cli.php index 4ea0cc5fe..c18d59f22 100644 --- a/Core/lib/cli.php +++ b/Core/lib/cli.php @@ -48,7 +48,7 @@ function df_is_bin_magento():bool {return df_ends_with(df_cli_script(), 'bin/mag * @used-by df_header_utf() * @used-by df_sentry_m() * @used-by df_webserver() - * @used-by \Df\Sentry\Client::__construct() - * @used-by \Df\Sentry\Client::capture() + * @used-by Df\Sentry\Client::__construct() + * @used-by Df\Sentry\Client::capture() */ function df_is_cli():bool {return 'cli' === php_sapi_name();} \ No newline at end of file From 589f1f77f3744899977f3c62fb7a044588a6ed1f Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:29:35 +0100 Subject: [PATCH 480/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cms.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/lib/cms.php b/Core/lib/cms.php index ab2043a70..9484cb11d 100644 --- a/Core/lib/cms.php +++ b/Core/lib/cms.php @@ -3,9 +3,9 @@ use Magento\Ui\Component\Wysiwyg\ConfigInterface; /** * 2016-01-06 - * @used-by \Df\Widget\P\Wysiwyg::prepareElementHtml() (https://github.com/mage2pro/core/issues/392) - * @used-by \Dfe\Markdown\FormElement::config() - * @used-by \Dfe\Markdown\FormElement::enabled() + * @used-by Df\Widget\P\Wysiwyg::prepareElementHtml() (https://github.com/mage2pro/core/issues/392) + * @used-by Dfe\Markdown\FormElement::config() + * @used-by Dfe\Markdown\FormElement::enabled() * @return Config|ConfigInterface */ function df_wysiwyg_config() {return df_o(ConfigInterface::class);} \ No newline at end of file From cd39519968f01c7542873ca1e67719d689718625 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:29:41 +0100 Subject: [PATCH 481/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/cookie.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/cookie.php b/Core/lib/cookie.php index 788d9167e..e83fec1eb 100644 --- a/Core/lib/cookie.php +++ b/Core/lib/cookie.php @@ -43,7 +43,7 @@ function df_cookie_metadata_standard():PublicCookieMetadata { * 2016-12-02 * 1) Устанавливает куку, которая будет доступна из JavaScript. * 2) Cookie vs Session: http://stackoverflow.com/questions/6253633 - * @used-by \Dfe\AmazonLogin\Controller\Index\Index::postProcess() + * @used-by Dfe\AmazonLogin\Controller\Index\Index::postProcess() */ function df_cookie_set_js(string $k, string $v):void {df_cookie_m()->setPublicCookie($k, $v, df_cookie_metadata_standard());} From 33372dd0cf343f113764cbfb24eb5bd59bf5cd38 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:29:50 +0100 Subject: [PATCH 482/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/crypt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/crypt.php b/Core/lib/crypt.php index 2c7fa9455..74ae07ab7 100644 --- a/Core/lib/crypt.php +++ b/Core/lib/crypt.php @@ -3,7 +3,7 @@ use Magento\Framework\Encryption\EncryptorInterface as IEncryptor; /** - * @used-by \Df\Config\Settings::p() + * @used-by Df\Config\Settings::p() * @return IEncryptor|Encryptor */ function df_encryptor() {return df_o(IEncryptor::class);} \ No newline at end of file From 83d52ff14f2f9658b4580ad088a06384b01d7c04 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:30:00 +0100 Subject: [PATCH 483/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/date.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Core/lib/date.php b/Core/lib/date.php index bf15697f2..d5fd64f7d 100644 --- a/Core/lib/date.php +++ b/Core/lib/date.php @@ -29,7 +29,7 @@ function df_date_create(int ...$a):ZD { } /** - * @used-by \Df\Payment\Operation::customerDob() + * @used-by Df\Payment\Operation::customerDob() * @see df_date_to_db() * @return ZD|null * @throws Th @@ -103,8 +103,8 @@ function df_date_min(ZD $d1, ZD $d2):ZD {return df_date_lt($d1, $d2) ? $d1 : $d2 /** * 2016-07-20 - * @used-by \Df\Sales\Observer\OrderPlaceAfter::execute() - * @used-by \Dfe\AllPay\W\Event::time() + * @used-by Df\Sales\Observer\OrderPlaceAfter::execute() + * @used-by Dfe\AllPay\W\Event::time() * @param string|null $fmt [optional] * @return ZD|null * @throws Th @@ -174,7 +174,7 @@ function df_day_of_week_as_digit(ZD $date = null):int {return df_nat0(df_date($d /** * 2016-07-19 - * @used-by \Dfe\AllPay\W\Event\Offline::expirationS() + * @used-by Dfe\AllPay\W\Event\Offline::expirationS() * @param ZD|int|null $d * @return int|null */ @@ -206,10 +206,10 @@ function df_days_off($s = null):array {return dfcf(function($s = null) {return d * @used-by df_date_from_timestamp_14() * @used-by df_dtss() * @used-by df_file_name() - * @used-by \Df\Sales\Observer\OrderPlaceAfter::execute() - * @used-by \Dfe\AllPay\W\Event\Offline::expirationS() - * @used-by \Dfe\Vantiv\Charge::pCharge() - * @used-by \TFC\GoogleShopping\Result::contents() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) + * @used-by Df\Sales\Observer\OrderPlaceAfter::execute() + * @used-by Dfe\AllPay\W\Event\Offline::expirationS() + * @used-by Dfe\Vantiv\Charge::pCharge() + * @used-by TFC\GoogleShopping\Result::contents() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1) * @param string|null $fmt [optional] * @param Zend_Locale|string|null $l [optional] */ @@ -255,8 +255,8 @@ function df_is_day_off(ZD $d, $s = null):bool {return in_array(df_day_of_week_as * 2018-11-13 * @see df_hour() * @see df_year() - * @used-by \Df\StripeClone\Facade\Card::isActive() - * @used-by \Dfe\TBCBank\Test\CaseT\Regular::t04() + * @used-by Df\StripeClone\Facade\Card::isActive() + * @used-by Dfe\TBCBank\Test\CaseT\Regular::t04() */ function df_month(ZD $d = null):int {return df_nat0(df_date($d)->toString(ZD::MONTH, 'iso'));} @@ -266,15 +266,15 @@ function df_month(ZD $d = null):int {return df_nat0(df_date($d)->toString(ZD::MO * 1) «DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated»: * https://github.com/mage2pro/core/issues/241 * 2) The 2nd parameter (timezone) can be `null`: https://3v4l.org/m76dH - * @used-by \Dfe\AllPay\Charge::pCharge() - * @used-by \Dfe\CheckoutCom\Charge::pMetadata() + * @used-by Dfe\AllPay\Charge::pCharge() + * @used-by Dfe\CheckoutCom\Charge::pMetadata() * @param string|null $tz [optional] */ function df_now(string $fmt, $tz = null):string {return (new DT('', !$tz ? null : new DTZ($tz)))->format($fmt);} /** * 2016-07-19 Портировал из Российской сборки Magento. - * @used-by \Df\Config\Source\WaitPeriodType::calculate() + * @used-by Df\Config\Source\WaitPeriodType::calculate() * @param null|string|int|ScopeA|Store $store [optional] */ function df_num_calendar_days_by_num_working_days(ZD $startDate, int $numWorkingDays, $store = null):int { @@ -300,7 +300,7 @@ function df_num_calendar_days_by_num_working_days(ZD $startDate, int $numWorking /** * 2016-07-19 Портировал из Российской сборки Magento. * @used-by df_days_left() - * @used-by \Df\Sales\Observer\OrderPlaceAfter::execute() + * @used-by Df\Sales\Observer\OrderPlaceAfter::execute() */ function df_num_days(ZD $d1 = null, ZD $d2 = null):int { $d1 = df_date($d1); @@ -321,9 +321,9 @@ function df_num_days(ZD $d1 = null, ZD $d2 = null):int { /** * 2015-04-07 * @used-by df_tomorrow() - * @used-by \Dfe\Moip\P\Charge::p() - * @used-by \Dfe\Moip\Test\CaseT\Payment\Boleto::pPayment() - * @used-by \Dfe\Moip\Test\CaseT\Payment\OnlineBanking::pPayment() + * @used-by Dfe\Moip\P\Charge::p() + * @used-by Dfe\Moip\Test\CaseT\Payment\Boleto::pPayment() + * @used-by Dfe\Moip\Test\CaseT\Payment\OnlineBanking::pPayment() */ function df_today_add(int $add):ZD {return df_date_reset_time(ZD::now()->addDay($add));} @@ -343,8 +343,8 @@ function df_tomorrow():ZD {return df_today_add(1);} * 2018-11-13 * @see df_hour() * @see df_month() - * @used-by \Df\StripeClone\Facade\Card::isActive() - * @used-by \Dfe\TBCBank\Test\CaseT\Regular::t04() + * @used-by Df\StripeClone\Facade\Card::isActive() + * @used-by Dfe\TBCBank\Test\CaseT\Regular::t04() */ function df_year(ZD $date = null):int {return df_nat0(df_date($date)->toString(ZD::YEAR, 'iso'));} From a53102db736b8e56bb965eab4f98ddeee53f56f8 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:30:11 +0100 Subject: [PATCH 484/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/empty.php | 114 ++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/Core/lib/empty.php b/Core/lib/empty.php index b9cc3b20b..fbd17efe5 100644 --- a/Core/lib/empty.php +++ b/Core/lib/empty.php @@ -11,14 +11,14 @@ * @used-by df_result_sne() * @used-by df_xml_s() * @used-by sift_prefix() - * @used-by \Df\Config\Backend\Checkbox::dfSaveBefore() - * @used-by \Df\Framework\Form\Element\Fieldset::color() - * @used-by \Df\Framework\Plugin\Data\Form\Element\AbstractElement::aroundGetLabelHtml() - * @used-by \Df\Payment\Settings::messageFailure() - * @used-by \Df\Payment\W\Exception\Ignored::message() - * @used-by \Df\Payment\W\Handler::log() - * @used-by \Df\Typography\Css::rule() - * @used-by \Df\Xml\G::importString() + * @used-by Df\Config\Backend\Checkbox::dfSaveBefore() + * @used-by Df\Framework\Form\Element\Fieldset::color() + * @used-by Df\Framework\Plugin\Data\Form\Element\AbstractElement::aroundGetLabelHtml() + * @used-by Df\Payment\Settings::messageFailure() + * @used-by Df\Payment\W\Exception\Ignored::message() + * @used-by Df\Payment\W\Handler::log() + * @used-by Df\Typography\Css::rule() + * @used-by Df\Xml\G::importString() * @param mixed $v */ function df_es($v):bool {return '' === $v;} @@ -44,24 +44,24 @@ function df_est($v):bool {return df_es(df_trim($v));} * @used-by df_primary_key() * @used-by df_trd() * @used-by ikf_oi_pid() - * @used-by \Amasty\Checkout\Model\Optimization\LayoutJsDiffProcessor::moveArray(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/120) - * @used-by \CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) - * @used-by \Df\API\Facade::p() - * @used-by \Df\Config\Backend\Serialized::valueUnserialize() - * @used-by \Df\Config\Settings::json() - * @used-by \Df\Directory\FE\Country::getValues() - * @used-by \Df\Xml\G::importString() - * @used-by \Dfe\AllPay\Total\Quote::iiAdd() - * @used-by \Dfe\AllPay\Total\Quote::iiGet() - * @used-by \Dfe\CheckoutCom\Method::disableEvent() - * @used-by \Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() - * @used-by \Dfe\Color\Plugin\Swatches\Model\Swatch::beforeBeforeSave() - * @used-by \Dfe\Markdown\Plugin\Ui\Component\Form\Element\Wysiwyg::beforePrepare() - * @used-by \Dfe\Square\Facade\Customer::cardsData() - * @used-by \KingPalm\Core\Plugin\Aitoc\OrdersExportImport\Model\Processor\Config\ExportConfigMapper::aroundToConfig() - * @used-by \MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) - * @used-by \Mangoit\MediaclipHub\Helper\Data::getMediaClipProjects() - * @used-by \CabinetsBay\Catalog\B\Category::images() (https://github.com/cabinetsbay/site/issues/98) + * @used-by Amasty\Checkout\Model\Optimization\LayoutJsDiffProcessor::moveArray(canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/120) + * @used-by CanadaSatellite\Core\Plugin\Magento\Catalog\Model\Product::afterGetPreconfiguredValues() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/83) + * @used-by Df\API\Facade::p() + * @used-by Df\Config\Backend\Serialized::valueUnserialize() + * @used-by Df\Config\Settings::json() + * @used-by Df\Directory\FE\Country::getValues() + * @used-by Df\Xml\G::importString() + * @used-by Dfe\AllPay\Total\Quote::iiAdd() + * @used-by Dfe\AllPay\Total\Quote::iiGet() + * @used-by Dfe\CheckoutCom\Method::disableEvent() + * @used-by Dfe\Color\Plugin\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual::afterGetJsonConfig() + * @used-by Dfe\Color\Plugin\Swatches\Model\Swatch::beforeBeforeSave() + * @used-by Dfe\Markdown\Plugin\Ui\Component\Form\Element\Wysiwyg::beforePrepare() + * @used-by Dfe\Square\Facade\Customer::cardsData() + * @used-by KingPalm\Core\Plugin\Aitoc\OrdersExportImport\Model\Processor\Config\ExportConfigMapper::aroundToConfig() + * @used-by MageSuper\Casat\Observer\ProductSaveBefore::execute() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/73) + * @used-by Mangoit\MediaclipHub\Helper\Data::getMediaClipProjects() + * @used-by CabinetsBay\Catalog\B\Category::images() (https://github.com/cabinetsbay/site/issues/98) * @param mixed|null $v */ function df_eta($v):array { @@ -80,8 +80,8 @@ function df_eta($v):array { * @used-by df_img_resize() * @used-by df_slice() * @used-by dfa_chop() - * @used-by \Dfe\Geo\Client::__construct() - * @used-by \Df\Payment\W\Nav::op() + * @used-by Dfe\Geo\Client::__construct() + * @used-by Df\Payment\W\Nav::op() * @param mixed $v * @return mixed|null */ @@ -105,7 +105,7 @@ function df_fnes($v):bool {return is_null($v) || '' === $v || false === $v;} /** * @used-by df_fetch_one() * @used-by df_parent_name() - * @used-by \Dfe\Stripe\Init\Action::need3DS() + * @used-by Dfe\Stripe\Init\Action::need3DS() * @param mixed|false $v * @return mixed|null */ @@ -115,7 +115,7 @@ function df_ftn($v) {return false === $v ? null : $v;} * 2022-10-15 * @see df_nts() * @used-by df_module_file_name() - * @used-by \Dfe\Stripe\Init\Action::redirectUrl() + * @used-by Dfe\Stripe\Init\Action::redirectUrl() * @param mixed|false $v * @return mixed|string */ @@ -138,13 +138,13 @@ function df_fts($v) {return false === $v ? '' : $v;} * @used-by dfa_strict() * @used-by dfad() * @used-by dftr() - * @used-by \Df\Framework\Log\Latest::registered() - * @used-by \Df\Framework\Log\Record::msg() - * @used-by \Df\Payment\Block\Info::si() - * @used-by \Df\Payment\Method::s() - * @used-by \Df\Payment\W\Reader::tl_() - * @used-by \Df\Shipping\Method::s() - * @used-by \Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::beforePrepareProductAttributes() + * @used-by Df\Framework\Log\Latest::registered() + * @used-by Df\Framework\Log\Record::msg() + * @used-by Df\Payment\Block\Info::si() + * @used-by Df\Payment\Method::s() + * @used-by Df\Payment\W\Reader::tl_() + * @used-by Df\Shipping\Method::s() + * @used-by Dfe\CurrencyFormat\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter::beforePrepareProductAttributes() * @param mixed $v */ function df_nes($v):bool {return is_null($v) || '' === $v;} @@ -154,26 +154,26 @@ function df_nes($v):bool {return is_null($v) || '' === $v;} * @used-by df_starts_with() * @used-by df_trim() * @used-by sift_prefix() - * @used-by \Df\API\Facade::p() - * @used-by \Df\Paypal\Plugin\Model\Api\Nvp::eligible() - * @used-by \Df\Qa\Trace\Frame::class_() - * @used-by \Df\Qa\Trace\Frame::function_() - * @used-by \Df\Typography\Font::variantNumber() - * @used-by \Dfe\Color\Observer\ProductSaveBefore::execute() - * @used-by \Dfe\Klarna\Api\Checkout\V2\Charge\ShippingAddress::test() - * @used-by \Dfe\SalesSequence\Settings::affix() - * @used-by \Dfe\Sift\API\Validator\Event::long() - * @used-by \Dfe\Sift\API\Validator\GetDecisions::long() - * @used-by \Dfe\Sift\API\Validator\GetDecisions::short() - * @used-by \Dfe\Sift\Payload\Payment\PayPal::p() - * @used-by \Dfe\Sift\Test\CaseT\PayPal::t01() - * @used-by \Dfe\TBCBank\API\Validator::long() - * @used-by \Dfe\TwoCheckout\Address::city() - * @used-by \Dfe\TwoCheckout\Address::postcode() - * @used-by \Dfe\TwoCheckout\Address::region() - * @used-by \Dfe\TwoCheckout\Handler::p() - * @used-by \Dfe\TwoCheckout\Handler\RefundIssued::pid() - * @used-by \Dfe\Vantiv\API\Validator::long() + * @used-by Df\API\Facade::p() + * @used-by Df\Paypal\Plugin\Model\Api\Nvp::eligible() + * @used-by Df\Qa\Trace\Frame::class_() + * @used-by Df\Qa\Trace\Frame::function_() + * @used-by Df\Typography\Font::variantNumber() + * @used-by Dfe\Color\Observer\ProductSaveBefore::execute() + * @used-by Dfe\Klarna\Api\Checkout\V2\Charge\ShippingAddress::test() + * @used-by Dfe\SalesSequence\Settings::affix() + * @used-by Dfe\Sift\API\Validator\Event::long() + * @used-by Dfe\Sift\API\Validator\GetDecisions::long() + * @used-by Dfe\Sift\API\Validator\GetDecisions::short() + * @used-by Dfe\Sift\Payload\Payment\PayPal::p() + * @used-by Dfe\Sift\Test\CaseT\PayPal::t01() + * @used-by Dfe\TBCBank\API\Validator::long() + * @used-by Dfe\TwoCheckout\Address::city() + * @used-by Dfe\TwoCheckout\Address::postcode() + * @used-by Dfe\TwoCheckout\Address::region() + * @used-by Dfe\TwoCheckout\Handler::p() + * @used-by Dfe\TwoCheckout\Handler\RefundIssued::pid() + * @used-by Dfe\Vantiv\API\Validator::long() * @param mixed|null $v * @return mixed */ From 0c24f0f7bf298aa03300eeaf62b05331f1cb2c28 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:30:17 +0100 Subject: [PATCH 485/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/float.php | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Core/lib/float.php b/Core/lib/float.php index 41d3fbd47..68fb1e777 100644 --- a/Core/lib/float.php +++ b/Core/lib/float.php @@ -11,22 +11,22 @@ * https://3v4l.org/AUTCA * @used-by dff_2f() * @used-by dff_2i() - * @used-by \Dfe\Qiwi\Method::amountFormat() - * @used-by \Dfe\Robokassa\Method::amountFormat() - * @used-by \Dfe\SecurePay\Charge::amountFormat() - * @used-by \Dfe\TwoCheckout\Method::amountFormat() - * @used-by \Dfe\YandexKassa\Charge::pTaxLeafs() - * @used-by \Dfe\YandexKassa\Method::amountFormat() - * @used-by \TFC\Core\B\Checkout\Success::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/42) - * @used-by \TFC\GoogleShopping\Att\Price::format() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/6) + * @used-by Dfe\Qiwi\Method::amountFormat() + * @used-by Dfe\Robokassa\Method::amountFormat() + * @used-by Dfe\SecurePay\Charge::amountFormat() + * @used-by Dfe\TwoCheckout\Method::amountFormat() + * @used-by Dfe\YandexKassa\Charge::pTaxLeafs() + * @used-by Dfe\YandexKassa\Method::amountFormat() + * @used-by TFC\Core\B\Checkout\Success::_toHtml() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/core/issues/42) + * @used-by TFC\GoogleShopping\Att\Price::format() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/6) * @used-by https://github.com/tradefurniturecompany/report/blob/1.0.3/view/frontend/templates/index.phtml#L33 */ function dff_2(float $v, int $prec = 2):string {return number_format($v, $prec, '.', '');} /** * 2016-09-08 - * @used-by \Dfe\Color\Image::labels() - * @used-by \TFC\Core\Plugin\Paypal\Model\Cart::aroundGetAmounts() + * @used-by Dfe\Color\Image::labels() + * @used-by TFC\Core\Plugin\Paypal\Model\Cart::aroundGetAmounts() * @param float|int|string $v */ function dff_2f($v):float {return floatval(dff_2(floatval($v)));} @@ -37,7 +37,7 @@ function dff_2f($v):float {return floatval(dff_2(floatval($v)));} * 3.333 => 3.33 * 3.300 => 3.30 * https://3v4l.org/AUTCA - * @used-by \Dfe\YandexKassa\Charge::pTaxLeaf() + * @used-by Dfe\YandexKassa\Charge::pTaxLeaf() * @param int|float $v */ function dff_2i($v, int $prec = 2):string {return is_int($v) ? (string)$v : dff_2($v, $prec);} @@ -66,11 +66,11 @@ function dff_chop0($v):string { * The order's grand total is 3000.00. The calculated grand total from tax data is 2999.80.» * https://github.com/mage2pro/yandex-kassa/issues/2 * I use deviation of 0.1% of $a. - * @used-by \CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order::afterCanInvoice() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/256) - * @used-by \Customweb\RealexCw\Helper\InvoiceItem::getInvoiceItems() tradefurniturecompany.co.uk - * @used-by \Dfe\Vantiv\Charge::pCharge() - * @used-by \Dfe\YandexKassa\Charge::pTaxLeaf() - * @used-by \Dfe\YandexKassa\Charge::pTaxLeafs() + * @used-by CanadaSatellite\Core\Plugin\Magento\Sales\Model\Order::afterCanInvoice() (canadasatellite.ca, https://github.com/canadasatellite-ca/site/issues/256) + * @used-by Customweb\RealexCw\Helper\InvoiceItem::getInvoiceItems() tradefurniturecompany.co.uk + * @used-by Dfe\Vantiv\Charge::pCharge() + * @used-by Dfe\YandexKassa\Charge::pTaxLeaf() + * @used-by Dfe\YandexKassa\Charge::pTaxLeafs() * @used-by https://github.com/tradefurniturecompany/report/blob/1.0.3/view/frontend/templates/index.phtml#L30 * @param float|string|int $a * @param float|string|int $b @@ -87,12 +87,12 @@ function dff_eq($a, $b):bool {return dff_eq0(floatval($a) - floatval($b), .001 * * By default, 0.1% deviation is allowed. * @used-by dff_eq() * @used-by dfp_refund() - * @used-by \Customweb\RealexCw\Helper\InvoiceItem::getInvoiceItems() tradefurniturecompany.co.uk - * @used-by \Df\Sales\Plugin\Model\ResourceModel\Order\Handler\State::aroundCheck() - * @used-by \Dfe\Color\Image::labels() - * @used-by \Dfe\TwoCheckout\Charge::lineItems() - * @used-by \Dfe\TwoCheckout\Method::_refund() - * @used-by \Dfe\YandexKassa\Charge::pTaxLeaf() - * @used-by \TFC\Core\Plugin\Paypal\Model\Cart::aroundGetAmounts() + * @used-by Customweb\RealexCw\Helper\InvoiceItem::getInvoiceItems() tradefurniturecompany.co.uk + * @used-by Df\Sales\Plugin\Model\ResourceModel\Order\Handler\State::aroundCheck() + * @used-by Dfe\Color\Image::labels() + * @used-by Dfe\TwoCheckout\Charge::lineItems() + * @used-by Dfe\TwoCheckout\Method::_refund() + * @used-by Dfe\YandexKassa\Charge::pTaxLeaf() + * @used-by TFC\Core\Plugin\Paypal\Model\Cart::aroundGetAmounts() */ function dff_eq0(float $a, float $deviation = .001):bool {return abs($a) < $deviation;} \ No newline at end of file From 21513b8cd058051c24c0c4dda736473f14f3d4c2 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:30:23 +0100 Subject: [PATCH 486/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/github.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/lib/github.php b/Core/lib/github.php index 87bbc9a59..994280e2f 100644 --- a/Core/lib/github.php +++ b/Core/lib/github.php @@ -8,7 +8,7 @@ function df_github_token():string {return df_credentials('github');} /** * 2017-05-10 https://developer.github.com/v3/repos/releases#get-the-latest-release - * @used-by \Dfe\Portal\Test\Basic::t02() + * @used-by Dfe\Portal\Test\Basic::t02() */ function df_github_repo_version(string $repo):string {return df_github_request("repos/$repo/releases/latest", 'tag_name');} From 06f6cddd2c4f9f978ab90bdc801147868529aad9 Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:30:29 +0100 Subject: [PATCH 487/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/hash.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/hash.php b/Core/lib/hash.php index 55f74d2fe..b4716d415 100644 --- a/Core/lib/hash.php +++ b/Core/lib/hash.php @@ -10,8 +10,8 @@ * @used-by df_hash_a() * @used-by dfc() * @used-by dfcf() - * @used-by \Df\API\Client::p() - * @used-by \Df\Payment\Block\Info::getCacheKeyInfo() + * @used-by Df\API\Client::p() + * @used-by Df\Payment\Block\Info::getCacheKeyInfo() */ function df_hash_a(array $a):string { $resultA = []; /** @var string[] $resultA */ From 128bf41172b5f35ebd832517a3e5880b8878b5aa Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Tue, 24 Sep 2024 10:30:35 +0100 Subject: [PATCH 488/717] https://github.com/mage2pro/core/issues/440 --- Core/lib/html.php | 124 +++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/Core/lib/html.php b/Core/lib/html.php index 57d5775ae..c2c700a37 100644 --- a/Core/lib/html.php +++ b/Core/lib/html.php @@ -14,13 +14,13 @@ function df_html_b(...$a) {return df_call_a($a, function(string $s) {return df_t * 2022-11-26 We can not declare the argument as `string ...$a` because such a syntax rejects arrays: https://3v4l.org/jFdPm * @used-by df_fa_link() * @used-by df_fe_init() - * @used-by \Dfe\Phone\Js::_toHtml() - * @used-by \Dfe\Customer\Block::_toHtml() - * @used-by \Dfe\Frontend\Block\ProductView\Css::_toHtml() - * @used-by \Dfe\Klarna\Button::_toHtml() - * @used-by \Dfe\Markdown\FormElement::css() - * @used-by \Dfe\Stripe\Block\Multishipping::_toHtml() - * @used-by \SayItWithAGift\Options\Frontend::_toHtml() + * @used-by Dfe\Phone\Js::_toHtml() + * @used-by Dfe\Customer\Block::_toHtml() + * @used-by Dfe\Frontend\Block\ProductView\Css::_toHtml() + * @used-by Dfe\Klarna\Button::_toHtml() + * @used-by Dfe\Markdown\FormElement::css() + * @used-by Dfe\Stripe\Block\Multishipping::_toHtml() + * @used-by SayItWithAGift\Options\Frontend::_toHtml() * @param string|string[] ...$a * @return string|string[] */ @@ -55,16 +55,16 @@ function df_resource_inline(string $u, Closure $f):string { * 2015-12-21 * 2015-12-25: Пустой тег style приводит к белому экрану в Chrome: