mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Reintroduce Webklex IMAP for ticket processing as PHP-IMAP is no longer being developed. This is optional for now and considered beta can be found in cron/ticket_email_parser.php
This commit is contained in:
54
plugins/vendor/illuminate/support/Defer/DeferredCallback.php
vendored
Normal file
54
plugins/vendor/illuminate/support/Defer/DeferredCallback.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Support\Defer;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DeferredCallback
|
||||
{
|
||||
/**
|
||||
* Create a new deferred callback instance.
|
||||
*
|
||||
* @param callable $callback
|
||||
*/
|
||||
public function __construct(public $callback, public ?string $name = null, public bool $always = false)
|
||||
{
|
||||
$this->name = $name ?? (string) Str::uuid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify the name of the deferred callback so it can be cancelled later.
|
||||
*
|
||||
* @param string $name
|
||||
* @return $this
|
||||
*/
|
||||
public function name(string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the deferred callback should run even on unsuccessful requests and jobs.
|
||||
*
|
||||
* @param bool $always
|
||||
* @return $this
|
||||
*/
|
||||
public function always(bool $always = true): static
|
||||
{
|
||||
$this->always = $always;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke the deferred callback.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __invoke(): void
|
||||
{
|
||||
call_user_func($this->callback);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user