Skip to content

Commit

Permalink
10.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed May 16, 2024
1 parent 2e03e9b commit a43bf18
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Core/lib/lang/try.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php
use Closure as F;
use Throwable as Th; # 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311
use Throwable as T; # 2023-08-02 "Treat `\Throwable` similar to `\Exception`": https://github.com/mage2pro/core/issues/311
/**
* 2017-04-15
* @used-by df_area_code()
* @used-by df_asset_url()
* @used-by df_cms_block_get()
* @used-by df_contents()
* @used-by df_country_ctn()
* @used-by df_currency_convert_safe()
* @used-by df_customer()
* @used-by df_customer_group_name()
Expand Down Expand Up @@ -40,9 +41,9 @@
* @used-by \TFC\GoogleShopping\Controller\Index\Index::execute() (tradefurniturecompany.co.uk, https://github.com/tradefurniturecompany/google-shopping/issues/1)
* @param F|bool|mixed $onE [optional]
* @return mixed
* @throws Th
* @throws T
*/
function df_try(F $try, $onE = null) {
try {return $try();}
catch(Th $th) {return $onE instanceof F ? $onE($th) : (true === $onE ? df_error($th) : $onE);}
catch(T $t) {return $onE instanceof F ? $onE($t) : (true === $onE ? df_error($t) : $onE);}
}
11 changes: 8 additions & 3 deletions Directory/lib/country.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
use Closure as F;
use Df\Directory\Model\Country as C;
use Df\Directory\Model\ResourceModel\Country\Collection as CC;
use Magento\Store\Api\Data\StoreInterface as IStore;
use Throwable as Th;

/**
* 2016-05-20
Expand Down Expand Up @@ -96,10 +98,13 @@ function df_country_codes_allowed($s = null):array {return df_csv_parse(df_cfg('
* @used-by \Dfe\IPay88\Block\Info::prepare()
* @used-by \Dfe\Klarna\Test\Charge::t01()
* @used-by \KingPalm\B2B\Observer\RegisterSuccess::execute()
* @param F|bool|mixed $onE [optional]
*/
function df_country_ctn(string $iso2):string {df_param_iso2($iso2, 0); return
dfa(df_countries_ctn(), strtoupper($iso2)) ?: df_error("Unable to find out the name of the country «{$iso2}».")
;}
function df_country_ctn(string $iso2, $onE = true):string {df_param_iso2($iso2, 0); return df_try(
function() use($iso2):string {return
dfa(df_countries_ctn(), strtoupper($iso2)) ?: df_error("Unable to find out the name of the country «{$iso2}».")
;}, $onE
);}

/**
* 2018-04-13
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/core"
,"version": "10.9.6"
,"version": "10.9.7"
,"description": "Mage2.PRO core package."
,"type": "magento2-module"
,"homepage": "https://mage2.pro"
Expand Down

0 comments on commit a43bf18

Please sign in to comment.