Skip to content

Commit 752d916

Browse files
committed
Merge branch 'fix-mini-6' of github-principal:yii2-extensions/app-basic into fix-mini-6
2 parents 09fe5b0 + 9186232 commit 752d916

File tree

13 files changed

+479
-1107
lines changed

13 files changed

+479
-1107
lines changed

config/web/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@
5454
// configuration adjustments for 'dev' environment
5555
$config['bootstrap'][] = 'debug';
5656
$config['modules']['debug'] = [
57-
'class' => \yii\debug\Module::class,
57+
'class' => yii\debug\Module::class,
5858
// uncomment the following to add your IP if you aren't connecting from localhost.
5959
//'allowedIPs' => ['127.0.0.1', '::1'],
6060
];
6161

6262
$config['bootstrap'][] = 'gii';
6363
$config['modules']['gii'] = [
64-
'class' => \yii\gii\Module::class,
64+
'class' => yii\gii\Module::class,
6565
// uncomment the following to add your IP if you aren't connecting from localhost.
6666
//'allowedIPs' => ['127.0.0.1', '::1'],
6767
];

src/framework/resource/layout/component/menu.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
use yii\bootstrap5\Nav;
88
use yii\helpers\Html;
99

10-
$menuItems = match (\Yii::$app->user->getIsGuest()) {
10+
$menuItems = match (Yii::$app->user->getIsGuest()) {
1111
false => ApplicationParameters::getMenuIsLogged(),
1212
default => ApplicationParameters::getMenuIsGuest(),
1313
};
1414

1515
NavBar::begin(
1616
[
1717
'brandLabel' => Html::img(
18-
\Yii::getAlias('@web/image/yiiframework.svg'),
18+
Yii::getAlias('@web/image/yiiframework.svg'),
1919
[
20-
'alt' => \Yii::$app->name,
21-
'title' => \Yii::$app->name,
20+
'alt' => Yii::$app->name,
21+
'title' => Yii::$app->name,
2222
'width' => 200,
2323
]
2424
),
@@ -33,7 +33,7 @@
3333
[
3434
'items' => $menuItems,
3535
'options' => [
36-
'class' => 'navbar-nav justify-content-end navbar-collapse'
36+
'class' => 'navbar-nav justify-content-end navbar-collapse',
3737
],
3838
]
3939
);

src/usecase/contact/ContactForm.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
namespace app\usecase\contact;
66

7-
use app\framework\ApplicationParameters;
87
use Yii;
98
use yii\base\Model;
109
use yii\captcha\CaptchaValidator;
11-
use yii\mail\MailerInterface;
1210

1311
final class ContactForm extends Model
1412
{

src/usecase/contact/IndexAction.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace app\usecase\contact;
66

77
use yii\base\Action;
8-
use Yii;
98

109
/**
1110
* @template T of ContactController
@@ -24,6 +23,6 @@ public function run(): string
2423
}
2524
}
2625

27-
return $this->controller->render('index',['model' => $form]);
26+
return $this->controller->render('index', ['model' => $form]);
2827
}
2928
}

src/usecase/security/Identity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function findByUsername(string $username): IdentityInterface|null
4646
{
4747
foreach (self::$users as $user) {
4848
if (strcasecmp($user['username'], $username) === 0) {
49-
return new static($user);
49+
return new self($user);
5050
}
5151
}
5252

@@ -62,7 +62,7 @@ public static function findIdentityByAccessToken($token, $type = null): Identity
6262
{
6363
foreach (self::$users as $user) {
6464
if ($user['accessToken'] === $token) {
65-
return new static($user);
65+
return new self($user);
6666
}
6767
}
6868

src/usecase/security/LoginAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private function login(LoginForm $form): bool
3434
$identity = $form->getIdentity();
3535

3636
if ($identity instanceof Identity && $form->validate()) {
37-
return $this->controller->getUser()->login($identity, $form->rememberMe ? 3600*24*30 : 0);
37+
return $this->controller->getUser()->login($identity, $form->rememberMe ? 3600 * 24 * 30 : 0);
3838
}
3939

4040
return false;

src/usecase/security/LoginForm.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace app\usecase\security;
46

5-
use Yii;
67
use yii\base\Model;
78
use yii\web\IdentityInterface;
89
use yii\web\User;
910

1011
/**
1112
* LoginForm is the model behind the login form.
1213
*
13-
* @property-read Identity|null $user
14-
*
14+
* @property Identity|null $user
1515
*/
1616
class LoginForm extends Model
1717
{
@@ -23,7 +23,6 @@ class LoginForm extends Model
2323

2424
private bool|null|IdentityInterface $_identity = false;
2525

26-
2726
/**
2827
* @phpstan-return array<array<int|string, mixed>>
2928
*/

0 commit comments

Comments
 (0)