Skip to content

Commit 32d8125

Browse files
committed
fix + workflow
1 parent c3791dd commit 32d8125

File tree

3 files changed

+55
-8
lines changed

3 files changed

+55
-8
lines changed

.github/workflows/phpstan.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: PHPStan
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.php'
7+
- '.github/workflows/phpstan.yml'
8+
- 'phpstan.neon'
9+
- 'phpstan-baseline.neon'
10+
pull_request:
11+
12+
jobs:
13+
phpstan:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest]
20+
php: [8.4, 8.3, 8.2, 8.1]
21+
laravel: ['10.*', '11.*', '12.*']
22+
stability: [prefer-stable]
23+
include:
24+
- laravel: 10.*
25+
- laravel: 11.*
26+
- laravel: 12.*
27+
exclude:
28+
- laravel: 11.*
29+
php: 8.1
30+
- laravel: 12.*
31+
php: 8.1
32+
33+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.os }}
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Setup PHP
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: ${{ matrix.php }}
43+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
44+
coverage: none
45+
46+
- name: Install dependencies
47+
run: |
48+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
49+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
50+
51+
- name: Run PHPStan
52+
run: vendor/bin/phpstan --error-format=github

phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,3 @@ parameters:
1111
identifier: argument.type
1212
count: 3
1313
path: src/Http/Controllers/LogViewerController.php
14-
15-
-
16-
message: '#^Trying to invoke Illuminate\\Contracts\\View\\Factory but it might not be a callable\.$#'
17-
identifier: callable.nonCallable
18-
count: 1
19-
path: src/Http/Controllers/LogViewerController.php

src/Http/Controllers/LogViewerController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
use BertW\LaravelLogViewer\LogViewer;
66
use BertW\LaravelLogViewer\RouteBinding;
77
use Illuminate\Contracts\Routing\ResponseFactory;
8+
use Illuminate\Contracts\View\View;
89
use Illuminate\Http\Request;
910
use Illuminate\Contracts\View\Factory as ViewFactory;
1011
use Symfony\Component\HttpFoundation\BinaryFileResponse;
1112
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1213

1314
class LogViewerController
1415
{
15-
public function index(Request $request, LogViewer $logViewer): ViewFactory
16+
public function index(Request $request, LogViewer $logViewer): View
1617
{
17-
return app(ViewFactory::class)('logviewer::index', [
18+
return app(ViewFactory::class)->make('logviewer::index', [
1819
'logViewerFile' => ($param = $request->route('logViewerFile')) ? RouteBinding::parse($param) : null,
1920
]);
2021
}

0 commit comments

Comments
 (0)