-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #379 from alies-dev/application-stub
Application stub
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Illuminate\Foundation; | ||
|
||
class Application | ||
{ | ||
/** | ||
* Get or check the current application environment. | ||
* @param string|list<string> ...$environments | ||
* @return string|bool | ||
* @psalm-return ($environments is null ? string : bool) | ||
*/ | ||
public function environment(...$environments) {} | ||
|
||
/** | ||
* Get the registered service provider instances if any exist. | ||
* @param \Illuminate\Support\ServiceProvider|string $provider | ||
* @psalm-return array{int?, \Illuminate\Support\ServiceProvider} | ||
*/ | ||
public function getProviders($provider) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
|
||
use \Illuminate\Foundation\Application; | ||
|
||
function returns_bool_for_string_arg(Application $application, string $env): bool | ||
{ | ||
return $application->environment($env); | ||
} | ||
|
||
/** @param non-empty-list<string> $envs */ | ||
function returns_bool_for_array_arg(Application $application, array $envs): bool | ||
{ | ||
return $application->environment($envs); | ||
} | ||
|
||
function returns_string(Application $application): string | ||
{ | ||
return $application->environment(); | ||
} | ||
?> | ||
--EXPECTF-- |