Skip to content

Commit

Permalink
https://github.com/tradefurniturecompany/image/issues/1
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Oct 25, 2020
1 parent cb136f3 commit 2cb467c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
1 change: 1 addition & 0 deletions Core/lib/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function df_style_inline_hide(...$selectors) {return !$selectors ? '' : df_style
* @used-by df_kv_table()
* @used-by \AlbumEnvy\Popup\Content::_toHtml()
* @used-by \Df\Config\Fieldset::_getHeaderCommentHtml()
* @used-by \Df\Framework\Console\Command::execute()
* @used-by \Df\Payment\Block\Info::checkoutSuccess()
* @used-by \Dfe\Klarna\Button::_toHtml()
* @used-by \Dfe\PostFinance\Block\Info::prepare()
Expand Down
3 changes: 2 additions & 1 deletion Core/lib/lang/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ function df_sync($id, callable $job, $interval = 0.1) { /** @var mixed $r */
* @used-by \Df\Payment\BankCardNetworks::url()
* @used-by \Df\Qa\Trace\Frame::functionA()
* @used-by \Df\Qa\Trace\Frame::method()
* @used-by \Dfe\Moip\Facade\Customer::_get()
* @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 \Df\Framework\Console\Command::execute()
* @param F $try
* @param F|bool|mixed $onE [optional]
* @return mixed
Expand Down
66 changes: 66 additions & 0 deletions Framework/Console/Command.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
namespace Df\Framework\Console;
use Exception as E;
use Magento\Framework\Console\Cli;
use Magento\Framework\ObjectManager\NoninterceptableInterface as INonInterceptable;
use Symfony\Component\Console\Command\Command as _P;
use Symfony\Component\Console\Input\InputInterface as I;
use Symfony\Component\Console\Output\OutputInterface as O;
/**
* 2020-10-25
* @see \TFC\Image\Command
*/
abstract class Command extends _P implements INonInterceptable {
/**
* 2020-10-25
* @used-by execute()
* @see \TFC\Image\Command::p()
* @return void
*/
abstract protected function p();

/**
* 2020-10-25
* @override
* @see \Symfony\Component\Console\Command\Command::execute()
* @return int
*/
final protected function execute(I $i, O $o) {$this->_i = $i; $this->_o = $o; return df_try(
function() {$this->p(); return Cli::RETURN_SUCCESS;}
,function(E $e) use($o) {
$o->writeln(df_tag('error', [], $e->getMessage()));
if (O::VERBOSITY_VERBOSE <= $o->getVerbosity()) {
$o->writeln($e->getTraceAsString());
}
return Cli::RETURN_FAILURE;
}
);}

/**
* 2020-10-25
* @return I
*/
final protected function input() {return $this->_i;}

/**
* 2020-10-25
* @return O
*/
final protected function output() {return $this->_o;}

/**
* 2020-20-25
* @used-by execute()
* @used-by input()
* @var I
*/
private $_i;

/**
* 2020-20-25
* @used-by execute()
* @used-by output()
* @var O
*/
private $_o;
}

0 comments on commit 2cb467c

Please sign in to comment.