Skip to content

Commit

Permalink
level 0 phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentauger committed Feb 22, 2023
1 parent ca66fc5 commit 3ac7463
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 55 deletions.
208 changes: 159 additions & 49 deletions _ide_helper_models.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function store(ManuscriptRecord $manuscriptRecord, Request $request): Jso
'description' => 'nullable|string|max:1500',
]);

$fundingSource = FundingSource::make([
$fundingSource = new FundingSource([
'funder_id' => $validated['funder_id'],
'title' => $validated['title'],
'description' => $validated['description'],
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/PublicationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function store(Request $request): JsonResource
]);

// create the publication
$publication = Publication::make($validated);
$publication = new Publication($validated);
$publication->user_id = $request->user()->id;
$publication->save();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function store(Publication $publication, Request $request): JsonResource
'description' => 'nullable|string|max:1500',
]);

$fundingSource = FundingSource::make([
$fundingSource = new FundingSource([
'funder_id' => $validated['funder_id'],
'title' => $validated['title'],
'description' => $validated['description'],
Expand Down
5 changes: 3 additions & 2 deletions app/Models/Invitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Str;
use URL;

Expand All @@ -30,15 +31,15 @@ class Invitation extends Model
/**
* Get the user that owns the invitation.
*/
public function user()
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}

/**
* Get the user that invited the user.
*/
public function invitedByUser()
public function invitedByUser(): BelongsTo
{
return $this->belongsTo(User::class, 'invited_by');
}
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"laravel/sail": "^1.18.1",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^6.4.0",
"nunomaduro/larastan": "^2.0",
"orangehill/iseed": "^3.0.2",
"pestphp/pest": "^1.22.3",
"pestphp/pest-plugin-laravel": "^1.4",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
includes:
- ./vendor/nunomaduro/larastan/extension.neon

parameters:

paths:
- app
- database

# Level 9 is the highest level
level: 1

# ignoreErrors:
# - '#PHPDoc tag @var#'
#
# excludePaths:
# - ./*/*/FileToBeExcluded.php
#
# checkMissingIterableValueType: false

0 comments on commit 3ac7463

Please sign in to comment.