Skip to content

Commit

Permalink
Properly write down the constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorial1024 committed Dec 30, 2024
1 parent ae53283 commit 6758d66
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/AsyncTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ class AsyncTask
*/
private float|null $laravelStartVal = null;

/**
* The string constant name for constant('LARAVEL_START'). Mainly to keep the code clean.
* @var string
*/
private const LARAVEL_START = "LARAVEL_START";

/**
* Indicates whether GNU coreutils is found in the system; in particular, we are looking for the timeout command inside coreutils.
*
Expand Down Expand Up @@ -83,7 +89,7 @@ public function run(): void
{
// todo startup configs
// write down the LARAVEL_START constant value for future usage
$this->laravelStartVal = constant("LARAVEL_START") ?? null;
$this->laravelStartVal = defined(self::LARAVEL_START) ? constant("LARAVEL_START") : null;

// install a timeout detector
// this single function checks all kinds of timeouts
Expand Down

0 comments on commit 6758d66

Please sign in to comment.