Skip to content

Commit

Permalink
Prepare PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Oct 15, 2023
1 parent ee82781 commit 9897377
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/back-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@ jobs:
name: "Search for $this->$this typo 🐌"
run: |
! git grep --line-number -e '\$this\s*->\s*\$this' -- ':!:*/back-end\.yml'
-
name: "Install orchestra/testbench"
run: "composer require --dev orchestra/testbench"
-
name: "Perform static analysis"
run: "true TODO || composer exec -- phpstan analyze --level=5 src/"
run: "composer exec -- phpstan || true 'Annotate only'"

coding_standards:
name: "4️⃣ Coding Standards"
Expand Down
16 changes: 16 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,21 @@ parameters:
- database/
- routes/
level: 5
checkAlwaysTrueCheckTypeFunctionCall: true
checkAlwaysTrueInstanceof: true
checkAlwaysTrueStrictComparison: true
checkAlwaysTrueLooseComparison: true
checkClassCaseSensitivity: false
checkDynamicProperties: true
checkExplicitMixed: false
checkImplicitMixed: false
checkExplicitMixedMissingReturn: true
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
ignoreErrors:
- '#^Unsafe usage of new static#'
# Tricky readonlys
- '#Assign it in the constructor\.$#'
- '#is assigned outside of the constructor\.$#'
# View vs. View contract
- '#render\(\) should return Illuminate\\View\\View but#'
3 changes: 3 additions & 0 deletions src/Actions/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Traits\ForwardsCalls;

/**
* @mixin \Illuminate\Support\Collection
*/
class Actions
{
use ForwardsCalls;
Expand Down
3 changes: 3 additions & 0 deletions src/Columns/Columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Traits\ForwardsCalls;

/**
* @mixin \Illuminate\Support\Collection
*/
class Columns
{
use ForwardsCalls;
Expand Down
3 changes: 3 additions & 0 deletions src/Fields/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Traits\ForwardsCalls;

/**
* @mixin \Illuminate\Support\Collection
*/
class Fields
{
use ForwardsCalls;
Expand Down
3 changes: 3 additions & 0 deletions src/Filters/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Traits\ForwardsCalls;

/**
* @mixin \Illuminate\Support\Collection
*/
class Filters
{
use ForwardsCalls;
Expand Down
2 changes: 2 additions & 0 deletions src/Models/Medium.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ public function user(): BelongsTo

/**
* Determine if the file is image.
*
* @return \Illuminate\Database\Eloquent\Casts\Attribute<bool, never>
*/
protected function isImage(): Attribute
{
Expand Down
6 changes: 6 additions & 0 deletions src/Navigation/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
use Cone\Root\Traits\Makeable;
use Illuminate\Support\Facades\URL;

/**
* @property string $url
* @property string $label
* @property string $icon
* @property string $group
*/
class Item
{
use HasAttributes;
Expand Down
3 changes: 3 additions & 0 deletions src/Widgets/Widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Traits\ForwardsCalls;

/**
* @mixin \Illuminate\Support\Collection
*/
class Widgets
{
use ForwardsCalls;
Expand Down

0 comments on commit 9897377

Please sign in to comment.