Skip to content

Commit cb6d448

Browse files
authored
Merge pull request #4 from wiz-develop:endou-mame/issue3
PHPStan/PHPUnitを追加
2 parents f72d8c0 + 3ff4131 commit cb6d448

29 files changed

+28157
-80
lines changed

.devcontainer/compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ services:
88
USER_UID: "${HOST_UID}" # .envのHOST_UIDを渡す
99
USER_GID: "${HOST_GID}" # .envのHOST_GIDを渡す
1010
env_file: ./.devcontainer/devcontainer.env
11+
environment:
12+
WORKSPACE_NAME: ${COMPOSE_PROJECT_NAME}_workspace
1113
volumes:
1214
- type: volume
1315
source: php-fpm-socket
@@ -18,7 +20,5 @@ services:
1820
consistency: cached
1921
command: sleep infinity
2022
working_dir: /var/www
21-
depends_on:
22-
- web
2323
networks:
2424
- common

.devcontainer/devcontainer.json

Lines changed: 11 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/php-mariadb
33
// Update the VARIANT arg in compose.yaml to pick a PHP version
44
{
5-
"name": "laravel-on-aws-ecs-backend-workspace",
5+
"name": "${containerEnv:WORKSPACE_NAME}",
66
"dockerComposeFile": [
77
// "../compose.production.yaml",
88
"../compose.development.api.yaml",
@@ -53,58 +53,22 @@
5353
"GitHub.copilot",
5454
"GitHub.copilot-chat",
5555
"GitHub.vscode-pull-request-github",
56-
// Docker
57-
"ms-azuretools.vscode-docker",
56+
// PHPUnit
57+
"recca0120.vscode-phpunit",
58+
// PHPStan
59+
"SanderRonde.phpstan-vscode",
5860
// Others
5961
"mikestead.dotenv",
6062
"mrmlnc.vscode-apache",
6163
"formulahendry.code-runner",
6264
"wayou.vscode-todo-highlight",
63-
// PHPUnit
64-
"recca0120.vscode-phpunit"
65+
"usernamehw.errorlens"
6566
],
6667
"settings": {
6768
"terminal.integrated.cwd": "${containerWorkspaceFolder}/src",
6869
// ? https://goropikari.hatenablog.com/entry/vscode_remote_container_host
6970
"remote.localPortHost": "allInterfaces",
7071
// "editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?" // NOTE: 逆に使いにくくなったのでコメントアウト中
71-
// highlight settings
72-
"todohighlight.defaultStyle": {
73-
"border": "1px solid #FFF",
74-
"borderRadius": "3px"
75-
},
76-
"todohighlight.keywords": [
77-
{
78-
"text": "BUG:",
79-
"color": "#FFFFFF",
80-
"backgroundColor": "#DC3545"
81-
},
82-
{
83-
"text": "NOTE:",
84-
"color": "#FFFFFF",
85-
"backgroundColor": "#98C379"
86-
},
87-
{
88-
"text": "HACK:",
89-
"color": "#FFFFFF",
90-
"backgroundColor": "#C678DD"
91-
},
92-
{
93-
"text": "DEBUG:",
94-
"color": "#FFFFFF",
95-
"backgroundColor": "#61AFEF"
96-
},
97-
{
98-
"text": "WARN:",
99-
"color": "#FFFFFF",
100-
"backgroundColor": "#FFC107"
101-
},
102-
{
103-
"text": "WARNING:",
104-
"color": "#FFFFFF",
105-
"backgroundColor": "#FFC107"
106-
}
107-
],
10872
// githubPullRequests settings
10973
"githubPullRequests.assignCreated": "wiz-kakiuchi",
11074
// other settings
@@ -135,14 +99,15 @@
13599
"-c",
136100
"${containerWorkspaceFolder}/src/phpunit.xml"
137101
],
138-
// PHPStan (LaraStan) settings
102+
// PHPStan settings
139103
"phpstan.binPath": "vendor/bin/phpstan",
140-
"phpstan.configFile": "phpstan.neon",
141-
"phpstan.singleFileMode": true,
104+
"phpstan.configFile": "phpstan.neon.dist",
105+
"phpstan.singleFileMode": false,
142106
"phpstan.showProgress": true,
143107
"phpstan.rootDir": "${containerWorkspaceFolder}/src",
144108
"phpstan.checkValidity": false,
145-
"phpstan.enableLanguageServer": false
109+
"phpstan.showTypeOnHover": true,
110+
"phpstan.memoryLimit": "1G"
146111
}
147112
}
148113
}

.devcontainer/initializeCommand.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
cp -n ./.devcontainer/devcontainer.env.example ./.devcontainer/devcontainer.env
44
cp -n ./.env.example ./.env
55
cp -n ./src/.env.example ./src/.env
6+
cp -n ./.vscode/settings.json.example ./.vscode/settings.json

.devcontainer/postCreateCommand.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
#!/usr/bin/env bash
22

3+
# プロジェクトのソースコードディレクトリに移動
34
cd ${CONTAINER_SRC_PATH}
5+
6+
# Automatic PHPDoc generation for Laravel Facades
7+
# https://github.com/barryvdh/laravel-ide-helper?tab=readme-ov-file#automatic-phpdoc-generation-for-laravel-facades
8+
php artisan ide-helper:generate

.vscode/settings.json.example

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
// NOTE: highlight settings
3+
"todohighlight.defaultStyle": {
4+
"border": "1px solid #FFF",
5+
"borderRadius": "3px"
6+
},
7+
"todohighlight.keywords": [
8+
{
9+
"text": "BUG:",
10+
"color": "#FFFFFF",
11+
"backgroundColor": "#DC3545"
12+
},
13+
{
14+
"text": "NOTE:",
15+
"color": "#FFFFFF",
16+
"backgroundColor": "#98C379"
17+
},
18+
{
19+
"text": "HACK:",
20+
"color": "#FFFFFF",
21+
"backgroundColor": "#C678DD"
22+
},
23+
{
24+
"text": "DEBUG:",
25+
"color": "#FFFFFF",
26+
"backgroundColor": "#61AFEF"
27+
},
28+
{
29+
"text": "WARN:",
30+
"color": "#FFFFFF",
31+
"backgroundColor": "#FFC107"
32+
},
33+
{
34+
"text": "WARNING:",
35+
"color": "#FFFFFF",
36+
"backgroundColor": "#FFC107"
37+
}
38+
],
39+
// PHPStan settings
40+
"phpstan.enabled": true,
41+
// editor settings
42+
"editor.formatOnSave": true
43+
}

src/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ vite.config.js
3232
.env.development.example
3333
.env.staging.example
3434
.env.production.example
35+
36+
_ide_helper.php

0 commit comments

Comments
 (0)