![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/vendor/orchestra/testbench-core/src/Attributes/ |
<?php namespace Orchestra\Testbench\Attributes; use Attribute; use Closure; use Orchestra\Testbench\Contracts\Attributes\Actionable as ActionableContract; use Orchestra\Testbench\Foundation\Env; use Orchestra\Testbench\Foundation\UndefinedValue; #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] final class RequiresEnv implements ActionableContract { /** * Construct a new attribute. * * @param string $key * @param string|null $message */ public function __construct( public string $key, public ?string $message = null ) { // } /** * Handle the attribute. * * @param \Illuminate\Foundation\Application $app * @param \Closure(string, array<int, mixed>):void $action * @return void */ public function handle($app, Closure $action): void { $value = Env::get($this->key, new UndefinedValue()); $message = $this->message ?? "Missing required environment variable `{$this->key}`"; if ($value instanceof UndefinedValue) { \call_user_func($action, 'markTestSkipped', [$message]); } } }