Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Illuminate\Console; use function Laravel\Prompts\confirm; trait Confirm..
Decoded Output download
<?php
namespace Illuminate\Console;
use function Laravel\Prompts\confirm;
trait ConfirmableTrait
{
/**
* Confirm before proceeding with the action.
*
* This method only asks for confirmation in production.
*
* @param string $warning
* @param \Closure|bool|null $callback
* @return bool
*/
public function confirmToProceed($warning = 'Application In Production', $callback = null)
{
$callback = is_null($callback) ? $this->getDefaultConfirmCallback() : $callback;
$shouldConfirm = value($callback);
if ($shouldConfirm) {
if ($this->hasOption('force') && $this->option('force')) {
return true;
}
$this->components->alert($warning);
$confirmed = confirm('Are you sure you want to run this command?', default: false);
if (! $confirmed) {
$this->components->warn('Command cancelled.');
return false;
}
}
return true;
}
/**
* Get the default confirmation callback.
*
* @return \Closure
*/
protected function getDefaultConfirmCallback()
{
return function () {
return $this->getLaravel()->environment() === 'production';
};
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Illuminate\Console;
use function Laravel\Prompts\confirm;
trait ConfirmableTrait
{
/**
* Confirm before proceeding with the action.
*
* This method only asks for confirmation in production.
*
* @param string $warning
* @param \Closure|bool|null $callback
* @return bool
*/
public function confirmToProceed($warning = 'Application In Production', $callback = null)
{
$callback = is_null($callback) ? $this->getDefaultConfirmCallback() : $callback;
$shouldConfirm = value($callback);
if ($shouldConfirm) {
if ($this->hasOption('force') && $this->option('force')) {
return true;
}
$this->components->alert($warning);
$confirmed = confirm('Are you sure you want to run this command?', default: false);
if (! $confirmed) {
$this->components->warn('Command cancelled.');
return false;
}
}
return true;
}
/**
* Get the default confirmation callback.
*
* @return \Closure
*/
protected function getDefaultConfirmCallback()
{
return function () {
return $this->getLaravel()->environment() === 'production';
};
}
}
Function Calls
None |
Stats
MD5 | 4c4be591444861412f498701cbc84f35 |
Eval Count | 0 |
Decode Time | 92 ms |