-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeepContainer.php
More file actions
35 lines (28 loc) · 853 Bytes
/
KeepContainer.php
File metadata and controls
35 lines (28 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace STS\Keep;
use Illuminate\Container\Container;
class KeepContainer extends Container
{
public function runningUnitTests(): bool
{
// Return true when running tests to enable fallbacks
return ($_ENV['LARAVEL_PROMPTS_INTERACT'] ?? null) === '0' ||
getenv('LARAVEL_PROMPTS_INTERACT') === '0' ||
defined('PHPUNIT_COMPOSER_INSTALL');
}
public function environment(...$environments): bool
{
$env = $_ENV['APP_ENV'] ?? getenv('APP_ENV') ?: 'production';
if (empty($environments)) {
return $env;
}
return in_array($env, $environments);
}
/**
* Get the global KeepManager instance
*/
public static function manager(): KeepManager
{
return static::getInstance()->make(KeepManager::class);
}
}