Skip to content

Commit 6e16572

Browse files
Update README.md, composer.json, and PHPStan configuration; enhance contact form layout and functionality. (#90)
1 parent eb109e2 commit 6e16572

File tree

20 files changed

+248
-192
lines changed

20 files changed

+248
-192
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
os: >-
2828
['ubuntu-latest', 'windows-latest']
2929
php: >-
30-
['8.2', '8.3', '8.4']
30+
['8.1', '8.2', '8.3', '8.4']

.github/workflows/dependency-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
os: >-
2727
['ubuntu-latest']
2828
php: >-
29-
['8.2']
29+
['8.4']

.github/workflows/ecs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
os: >-
2626
['ubuntu-latest']
2727
php: >-
28-
['8.2']
28+
['8.4']

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ on:
1818
name: static analysis
1919

2020
jobs:
21-
psalm:
21+
phpstan:
2222
uses: php-forge/actions/.github/workflows/phpstan.yml@main
2323
secrets:
2424
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
2525
with:
2626
os: >-
2727
['ubuntu-latest']
2828
php: >-
29-
['8.2']
29+
['8.1', '8.2', '8.3', '8.4']

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Root directory
148148

149149
## Quality code
150150

151-
[![phpstan-level](https://img.shields.io/badge/PHPStan%20level-5-blue)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml)
151+
[![phpstan-level](https://img.shields.io/badge/PHPStan%20level-9-blue)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml)
152152
[![StyleCI](https://github.styleci.io/repos/698621511/shield?branch=main)](https://github.styleci.io/repos/698621511?branch=main)
153153

154154
## Tests

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"minimum-stability": "dev",
1313
"prefer-stable": true,
1414
"require": {
15-
"php": ">=8.2",
15+
"php": ">=8.1",
1616
"php-forge/foxy": "^0.1",
1717
"ui-awesome/html": "^0.3",
1818
"ui-awesome/html-component-bootstrap5": "^1.0@dev",
1919
"ui-awesome/html-svg":"^0.2",
20-
"yii2-extensions/localeurls": "dev-main",
20+
"yii2-extensions/localeurls": "^0.1.0",
2121
"yiisoft/config": "^1.4",
2222
"yiisoft/yii2": "22.0.x-dev",
2323
"yiisoft/yii2-bootstrap5": "22.x-dev",
@@ -32,11 +32,13 @@
3232
"codeception/module-yii2": "^1.1",
3333
"codeception/verify": "^3.0",
3434
"maglnet/composer-require-checker": "^4.6",
35-
"phpstan/phpstan": "^2.1",
35+
"phpstan/extension-installer": "^1.4",
36+
"phpstan/phpstan-strict-rules": "^2.0.3",
3637
"rector/rector": "^2.0",
3738
"symfony/browser-kit": "^6.3",
3839
"symfony/process": "^6.3",
3940
"symplify/easy-coding-standard": "^12.3",
41+
"yii2-extensions/phpstan": "^0.2.3",
4042
"yiisoft/yii2-debug": "22.x-dev",
4143
"yiisoft/yii2-gii": "22.x-dev"
4244
},
@@ -62,7 +64,8 @@
6264
"yiisoft/yii2-composer": true,
6365
"composer/installers": true,
6466
"yiisoft/config": true,
65-
"php-forge/foxy": true
67+
"php-forge/foxy": true,
68+
"phpstan/extension-installer": true
6669
}
6770
},
6871
"scripts": {

docs/contact.png

98 KB
Loading

phpstan.neon

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,7 @@ parameters:
22
bootstrapFiles:
33
- tests/_bootstrap.php
44

5-
dynamicConstantNames:
6-
- YII_DEBUG
7-
- YII_ENV
8-
- YII_ENV_DEV
9-
- YII_ENV_PROD
10-
- YII_ENV_TEST
11-
12-
level: 5
5+
level: 9
136

147
paths:
158
- src
16-
17-
scanFiles:
18-
- vendor/yiisoft/yii2/Yii.php
19-
20-
excludePaths:
21-
- vendor/**

src/framework/asset/AppAsset.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace app\framework\asset;
66

7-
use yii\bootstrap5\{BootstrapAsset, BootstrapPluginAsset};
7+
use yii\bootstrap5\{BootstrapAsset, BootstrapIconAsset, BootstrapPluginAsset};
88
use yii\web\{AssetBundle, YiiAsset};
99

1010
final class AppAsset extends AssetBundle
@@ -17,6 +17,7 @@ final class AppAsset extends AssetBundle
1717

1818
public $depends = [
1919
BootstrapAsset::class,
20+
BootstrapIconAsset::class,
2021
BootstrapPluginAsset::class,
2122
YiiAsset::class,
2223
];

src/framework/event/ContactEventHandler.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,25 @@
77
use app\usecase\contact\{ContactEvent, IndexAction};
88
use Yii;
99
use yii\base\{BootstrapInterface, Event};
10-
use yii\web\Application;
1110

1211
final class ContactEventHandler implements BootstrapInterface
1312
{
14-
/**
15-
* @param Application $app
16-
*/
1713
public function bootstrap($app): void
1814
{
1915
Event::on(
2016
IndexAction::class,
2117
ContactEvent::EVENT_AFTER_SEND,
2218
static function () use ($app): void {
23-
$app->session->setFlash(
24-
'success',
25-
Yii::t(
26-
'app.basic',
27-
'Thank you for contacting us. We will respond to you as soon as possible.',
28-
),
19+
$title = Yii::t(
20+
'app.basic',
21+
'Message sent successfully!.',
2922
);
23+
$message = Yii::t(
24+
'app.basic',
25+
'Thank you for contacting us. We will respond to you as soon as possible.',
26+
);
27+
28+
$app->session->setFlash('success', "{$title}<br>{$message}");
3029
},
3130
);
3231
}

0 commit comments

Comments
 (0)