Skip to content

Commit 6758d66

Browse files
committed
Properly write down the constant
1 parent ae53283 commit 6758d66

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/AsyncTask.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ class AsyncTask
4141
*/
4242
private float|null $laravelStartVal = null;
4343

44+
/**
45+
* The string constant name for constant('LARAVEL_START'). Mainly to keep the code clean.
46+
* @var string
47+
*/
48+
private const LARAVEL_START = "LARAVEL_START";
49+
4450
/**
4551
* Indicates whether GNU coreutils is found in the system; in particular, we are looking for the timeout command inside coreutils.
4652
*
@@ -83,7 +89,7 @@ public function run(): void
8389
{
8490
// todo startup configs
8591
// write down the LARAVEL_START constant value for future usage
86-
$this->laravelStartVal = constant("LARAVEL_START") ?? null;
92+
$this->laravelStartVal = defined(self::LARAVEL_START) ? constant("LARAVEL_START") : null;
8793

8894
// install a timeout detector
8995
// this single function checks all kinds of timeouts

0 commit comments

Comments
 (0)