-
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 #381 from alies-dev/more-stubs
More stubs
- Loading branch information
Showing
7 changed files
with
122 additions
and
1 deletion.
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
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,16 @@ | ||
<?php | ||
|
||
namespace Illuminate\Database\Migrations; | ||
|
||
class Migrator | ||
{ | ||
/** | ||
* Execute the given callback using the given connection as the default connection. | ||
* | ||
* @template TCalbackReturn | ||
* @param string $name | ||
* @param callable(): TCalbackReturn $callback | ||
* @return TCalbackReturn | ||
*/ | ||
public function usingConnection($name, callable $callback) {} | ||
} |
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
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,30 @@ | ||
<?php | ||
|
||
namespace Illuminate\Http; | ||
|
||
use Symfony\Component\HttpFoundation\Request as SymfonyRequest; | ||
|
||
class Request extends SymfonyRequest | ||
{ | ||
/** | ||
* Retrieve a header from the request. | ||
* | ||
* @template TDefault of string|array<string, string>|null | ||
* | ||
* @param string|null $key | ||
* @param TDefault $default | ||
* @return ($key is null ? array<string, array<int, string|null>> : string|TDefault) | ||
*/ | ||
public function header($key = null, $default = null) {} | ||
|
||
/** | ||
* Get the route handling the request. | ||
* | ||
* @template TDefault | ||
* | ||
* @param string|null $param | ||
* @param TDefault $default | ||
* @psalm-return ($param is null ? \Illuminate\Routing\Route : TDefault|string|null) | ||
*/ | ||
public function route($param = null, $default = null) {} | ||
} |
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,38 @@ | ||
<?php | ||
|
||
namespace Illuminate\Notifications\Messages; | ||
|
||
class MailMessage | ||
{ | ||
/** | ||
* The "cc" information for the message. | ||
* @var list<array{0: string, 1: string|null}> Where the first value is email, second — name (optional). | ||
*/ | ||
public $cc = []; | ||
|
||
/** | ||
* The "bcc" information for the message. | ||
* @var list<array{0: string, 1: string|null}> Where the first value is email, second — name (optional). | ||
*/ | ||
public $bcc = []; | ||
|
||
/** | ||
* Set the cc address for the mail message. | ||
* @param string|list<string>|array<string, string> $address | ||
* @param string|null $name | ||
* @return $this | ||
*/ | ||
public function cc($address, $name = null) | ||
{ | ||
} | ||
|
||
/** | ||
* Set the bcc address for the mail message. | ||
* @param string|list<string>|array<string, string> $address | ||
* @param string|null $name | ||
* @return $this | ||
*/ | ||
public function bcc($address, $name = null) | ||
{ | ||
} | ||
} |
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,10 @@ | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
|
||
function test(\Illuminate\Database\Migrations\Migrator $migrator): int { | ||
return $migrator->usingConnection('default', function () { | ||
return 1; | ||
}); | ||
} | ||
?> | ||
--EXPECTF-- |
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,16 @@ | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
|
||
function it_returns_all_headers(\Illuminate\Http\Request $request): array { | ||
return $request->header(); | ||
}; | ||
|
||
function it_returns_one_header(\Illuminate\Http\Request $request): ?string { | ||
return $request->header('Accept'); | ||
}; | ||
|
||
function it_returns_route(\Illuminate\Http\Request $request): \Illuminate\Routing\Route { | ||
return $request->route(); | ||
}; | ||
?> | ||
--EXPECTF-- |