Skip to content

Commit 864763e

Browse files
committed
fix phpstan in tests
1 parent 2a62d50 commit 864763e

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

phpstan.neon.dist

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ parameters:
1414
-
1515
message: '#Unsafe usage of new static\(\)#'
1616
path: src/MagicLink.php
17+
-
18+
message: '#Parameter \#1 \$view of function view expects view-string\|null, string given#'
19+
path: tests/Actions/ResponseTest.php

tests/TestCase.php

+6-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ protected function defineEnvironment($app)
3434
{
3535
$app['config']->set('auth.providers.users.model', 'MagicLink\Test\TestSupport\User');
3636

37-
$app['config']->set('view.paths', [__DIR__.'/stubs/resources/views']);
37+
$app['config']->set('view.paths', [__DIR__ . '/stubs/resources/views']);
3838

39-
$app['config']->set('filesystems.disks.local.root', __DIR__.'/stubs/storage/app');
39+
$app['config']->set('filesystems.disks.local.root', __DIR__ . '/stubs/storage/app');
4040

4141
$app['config']->set('filesystems.disks.alternative', [
4242
'driver' => 'local',
43-
'root' => __DIR__.'/stubs/storage/app_alternative',
43+
'root' => __DIR__ . '/stubs/storage/app_alternative',
4444
]);
4545

4646
$app['config']->set('database.connections.pgsql', [
@@ -65,7 +65,7 @@ protected function defineEnvironment($app)
6565
'driver' => 'sqlite',
6666
'database' => ':memory:',
6767
'prefix' => '',
68-
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
68+
'foreign_key_constraints' => true,
6969
]);
7070

7171
$driver = getenv('DB_DRIVER');
@@ -75,12 +75,11 @@ protected function defineEnvironment($app)
7575
} else {
7676
$app['config']->set('database.default', $driver);
7777
}
78-
7978
}
8079

8180
protected function defineDatabaseMigrations()
8281
{
83-
$this->loadMigrationsFrom(__DIR__.'/../databases/migrations');
82+
$this->loadMigrationsFrom(__DIR__ . '/../databases/migrations');
8483
$this->setUpDatabase($this->app);
8584
}
8685

@@ -110,6 +109,6 @@ protected function setUpDatabase($app)
110109

111110
protected function loadRoutes()
112111
{
113-
include __DIR__.'/stubs/routes.php';
112+
include __DIR__ . '/stubs/routes.php';
114113
}
115114
}

tests/TestSupport/CustomUserProvider.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ public function retrieveById($identifier)
1414

1515
public function retrieveByToken($identifier, $token)
1616
{
17+
return null;
1718
}
1819

19-
public function updateRememberToken(Authenticatable $user, $token)
20-
{
21-
}
20+
public function updateRememberToken(Authenticatable $user, $token) {}
2221

2322
public function retrieveByCredentials(array $credentials)
2423
{
24+
return null;
2525
}
2626

2727
public function validateCredentials(Authenticatable $user, array $credentials)
@@ -34,7 +34,5 @@ public function getAuthPasswordName()
3434
return '';
3535
}
3636

37-
public function rehashPasswordIfRequired(Authenticatable $user, array $credentials, bool $force = false)
38-
{
39-
}
37+
public function rehashPasswordIfRequired(Authenticatable $user, array $credentials, bool $force = false) {}
4038
}

0 commit comments

Comments
 (0)