Skip to content

Commit 004119c

Browse files
authored
Merge pull request #14 from BinarCode/stan
fix: wip
2 parents 66e8c79 + 4ee7198 commit 004119c

23 files changed

+141
-80
lines changed

.github/workflows/phpstan.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- 'phpstan.neon.dist'
8+
9+
jobs:
10+
phpstan:
11+
name: phpstan
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.0'
20+
coverage: none
21+
22+
- name: Install composer dependencies
23+
uses: ramsey/composer-install@v1
24+
25+
- name: Run PHPStan
26+
run: ./vendor/bin/phpstan --error-format=github

.github/workflows/psalm.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
with:
15+
ref: main
16+
17+
- name: Update Changelog
18+
uses: stefanzweifel/changelog-updater-action@v1
19+
with:
20+
latest-version: ${{ github.event.release.name }}
21+
release-notes: ${{ github.event.release.body }}
22+
23+
- name: Commit updated CHANGELOG
24+
uses: stefanzweifel/git-auto-commit-action@v4
25+
with:
26+
branch: main
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"orchestra/testbench": "^7.0",
2828
"phpunit/phpunit": "^9.3",
2929
"symfony/stopwatch": "^4.4|^5.0",
30-
"vimeo/psalm": "^4.3"
30+
"nunomaduro/larastan": "^2.0",
31+
"phpstan/extension-installer": "^1.1"
3132
},
3233
"autoload": {
3334
"psr-4": {
@@ -44,12 +45,15 @@
4445
}
4546
},
4647
"scripts": {
47-
"psalm": "vendor/bin/psalm",
48+
"analyse": "vendor/bin/phpstan analyse",
4849
"test": "vendor/bin/phpunit --colors=always",
4950
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
5051
},
5152
"config": {
52-
"sort-packages": true
53+
"sort-packages": true,
54+
"allow-plugins": {
55+
"phpstan/extension-installer": true
56+
}
5357
},
5458
"extra": {
5559
"laravel": {

phpstan-baseline.neon

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
5+
count: 1
6+
path: src/Notifications/Slack.php
7+
-
8+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
9+
count: 2
10+
path: src/Models/DeveloperLog.php
11+
-
12+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
13+
count: 1
14+
path: src/Dtos/DevLogDto.php
15+
-
16+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
17+
count: 3
18+
path: src/Dtos/DevNotificationDto.php
19+
-
20+
message: "#^Call to static method startRecording\\(\\) on an unknown class Laravel\\\\Telescope\\\\Telescope\\.$#"
21+
count: 1
22+
path: src/Telescope/TelescopeException.php
23+
-
24+
message: "#^Call to static method recordException\\(\\) on an unknown class Laravel\\\\Telescope\\\\Telescope\\.$#"
25+
count: 1
26+
path: src/Telescope/TelescopeException.php
27+
-
28+
message: "#^Call to static method make\\(\\) on an unknown class Laravel\\\\Telescope\\\\IncomingExceptionEntry\\.$#"
29+
count: 1
30+
path: src/Telescope/TelescopeException.php
31+
-
32+
message: "#^Call to static method get\\(\\) on an unknown class Laravel\\\\Telescope\\\\ExceptionContext\\.$#"
33+
count: 1
34+
path: src/Telescope/TelescopeException.php

phpstan.neon.dist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: 2
6+
paths:
7+
- src
8+
- config
9+
- database
10+
tmpDir: build/phpstan
11+
checkModelProperties: true
12+
checkMissingIterableValueType: false

psalm.xml.dist

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Dtos/DevNotificationDto.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
/**
1010
* Class DevNotificationDto
1111
*
12-
* @property string message
13-
* @property string file
14-
* @property string line
15-
* @property string code
16-
*
17-
* @property string attachment_title
18-
* @property string attachment_link
19-
* @property string attachment_content
12+
* @property string $message
13+
* @property string $file
14+
* @property string $line
15+
* @property string $code
16+
* @property string $attachment_title
17+
* @property string $attachment_link
18+
* @property string $attachment_content
2019
*
2120
* @package App\Models\Dto
2221
*/

src/Models/DeveloperLog.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use DateTimeInterface;
1111
use Illuminate\Database\Eloquent\Factories\HasFactory;
1212
use Illuminate\Database\Eloquent\Model;
13+
use Illuminate\Support\Carbon;
1314
use Illuminate\Support\Str;
1415
use JsonSerializable;
1516
use Throwable;
@@ -31,6 +32,7 @@
3132
* @property string $target_type
3233
* @property id $target_id
3334
* @property array|mixed $payload
35+
* @property Carbon $created_at
3436
* @package App\Models
3537
*/
3638
class DeveloperLog extends Model

src/Nova/DeveloperLogResource.php renamed to stubs/Nova/DeveloperLogResource.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
<?php
22

3-
namespace Binarcode\LaravelDeveloper\Nova;
3+
namespace Nova;
44

55
use Binarcode\LaravelDeveloper\Models\DeveloperLog;
6-
use Binarcode\LaravelDeveloper\Nova\Fields\Badge;
7-
use Binarcode\LaravelDeveloper\Nova\Fields\Line;
8-
use Binarcode\LaravelDeveloper\Nova\Filters\CreatedAtFilter;
9-
use Binarcode\LaravelDeveloper\Nova\Filters\TagFilter;
106
use Illuminate\Http\Request;
117
use Illuminate\Support\Str;
128
use Laravel\Nova\Fields\Code;
@@ -15,6 +11,11 @@
1511
use Laravel\Nova\Fields\Stack;
1612
use Laravel\Nova\Fields\Text;
1713
use Laravel\Nova\Resource;
14+
use Nova\Fields\Badge;
15+
use Nova\Fields\Line;
16+
use Nova\Filters\CreatedAtFilter;
17+
use Nova\Filters\TagFilter;
18+
use function base_path;
1819

1920
class DeveloperLogResource extends Resource
2021
{

0 commit comments

Comments
 (0)