PHP code example of code-distortion / clarity-control
1. Go to this page and download the library: Download code-distortion/clarity-control library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
code-distortion / clarity-control example snippets
php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use CodeDistortion\ClarityControl\Control;
class MyServiceProvider extends ServiceProvider
{
public function boot()
{
$callback = function () { … }; // do something
Control::globalCallback($callback); // <<<
}
}
php
$finally = fn() => …; // do something
Control::run($callable, 'default', $finally);
// or
Control::prepare($callable, 'default', $finally)->execute();