forked from laravel/laravel
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: stubs declaring strict types (#19)
* feat: modify stubs to declare strict types * ref: words sort in ascending order * fix: add missing semicolon
- Loading branch information
1 parent
d0cd6ee
commit a6bee7b
Showing
44 changed files
with
1,535 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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes; | ||
|
||
class {{ class }} implements CastsInboundAttributes | ||
{ | ||
/** | ||
* Prepare the given value for storage. | ||
* | ||
* @param array<string, mixed> $attributes | ||
*/ | ||
public function set(Model $model, string $key, mixed $value, array $attributes): mixed | ||
{ | ||
return $value; | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Contracts\Database\Eloquent\CastsAttributes; | ||
|
||
class {{ class }} implements CastsAttributes | ||
{ | ||
/** | ||
* Cast the given value. | ||
* | ||
* @param array<string, mixed> $attributes | ||
*/ | ||
public function get(Model $model, string $key, mixed $value, array $attributes): mixed | ||
{ | ||
return $value; | ||
} | ||
|
||
/** | ||
* Prepare the given value for storage. | ||
* | ||
* @param array<string, mixed> $attributes | ||
*/ | ||
public function set(Model $model, string $key, mixed $value, array $attributes): mixed | ||
{ | ||
return $value; | ||
} | ||
} |
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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
class {{ class }} extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = '{{ command }}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Command description'; | ||
|
||
/** | ||
* Execute the console command. | ||
*/ | ||
public function handle() | ||
{ | ||
// | ||
} | ||
} |
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,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use {{ rootNamespace }}Http\Controllers\Controller; | ||
use Illuminate\Http\Request; | ||
|
||
class {{ class }} extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show(string $id) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update(Request $request, string $id) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy(string $id) | ||
{ | ||
// | ||
} | ||
} |
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,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use {{ rootNamespace }}Http\Controllers\Controller; | ||
use Illuminate\Http\Request; | ||
|
||
class {{ class }} extends Controller | ||
{ | ||
/** | ||
* Handle the incoming request. | ||
*/ | ||
public function __invoke(Request $request) | ||
{ | ||
// | ||
} | ||
} |
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,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use {{ namespacedModel }}; | ||
use {{ rootNamespace }}Http\Controllers\Controller; | ||
use {{ namespacedRequests }} | ||
|
||
class {{ class }} extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store({{ storeRequest }} $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show({{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy({{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
} |
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,68 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use {{ namespacedModel }}; | ||
use {{ rootNamespace }}Http\Controllers\Controller; | ||
use {{ namespacedRequests }} | ||
|
||
class {{ class }} extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
*/ | ||
public function create() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store({{ storeRequest }} $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show({{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
*/ | ||
public function edit({{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy({{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
} |
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,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace {{ namespace }}; | ||
|
||
use {{ namespacedModel }}; | ||
use {{ rootNamespace }}Http\Controllers\Controller; | ||
use {{ namespacedParentModel }}; | ||
use Illuminate\Http\Request; | ||
|
||
class {{ class }} extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
public function index({{ parentModel }} ${{ parentModelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request, {{ parentModel }} ${{ parentModelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update(Request $request, {{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy({{ parentModel }} ${{ parentModelVariable }}, {{ model }} ${{ modelVariable }}) | ||
{ | ||
// | ||
} | ||
} |
Oops, something went wrong.