Skip to content

Commit

Permalink
https://github.com/tradefurniturecompany/google-shopping/issues/1
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Dec 6, 2021
1 parent 6133a09 commit 9ba03a7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
23 changes: 5 additions & 18 deletions Controller/Index/Index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace TFC\GoogleShopping\Controller\Index;
use Magento\Framework\App\Action\Action as _P;
use TFC\GoogleShopping\Products;
use TFC\GoogleShopping\Result as R;
use \Closure as F;
/**
Expand All @@ -19,24 +20,10 @@ class Index extends _P {
* https://github.com/magento/magento2/blob/2.4.3-p1/lib/internal/Magento/Framework/App/Action/Action.php#L95-L116
* @return R
*/
function execute() {return self::p(function() {return [];});}

/**
* 2021-12-03
* @used-by execute()
* @param F $f
* @return R
*/
private static function p(F $f) {/** @var array(string => mixed) $r */
try {
$r = $f();
}
catch (\Exception $e) {
$r = ['message' => $e->getMessage()];
df_sentry(__CLASS__, $e);
}
return R::i(is_null($r) ? 'OK' : (!is_array($r) ? $r : self::filter($r)));
}
function execute() {return R::i(self::filter(df_try(
function() {return Products::p();}
,function(\Exception $e) {df_sentry(__CLASS__, $e); return ['message' => $e->getMessage()];}
)));}

/**
* 2021-12-03
Expand Down
12 changes: 12 additions & 0 deletions Products.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
namespace TFC\GoogleShopping;
# 2021-12-06
# "Setup an automatic integration between Magento and Google Merchant Center":
# https://github.com/tradefurniturecompany/google-shopping/issues/1
final class Products {
/**
* 2021-21-06
* @return array(array(string => mixed))
*/
static function p() {return [];}
}
1 change: 0 additions & 1 deletion Result.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
namespace TFC\GoogleShopping;
use \Zend_Date as ZD;
# 2021-12-03 https://support.google.com/merchants/answer/160567
/** @final Unable to use the PHP «final» keyword here because of the M2 code generation. */
class Result extends \Df\Framework\W\Result\Xml {
Expand Down

0 comments on commit 9ba03a7

Please sign in to comment.