Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cbca3dd

Browse files
author
DKravtsov
committedJun 15, 2025·
Updated docs and configuration.
1 parent b5450b7 commit cbca3dd

27 files changed

+115
-102
lines changed
 

‎.idea/externalDependencies.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/php-test-framework.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/php.xml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/development.md

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,48 @@ This document contains basic information and recommendation for development.
1616
* Use strict_types, type hinting and return type hinting.
1717
* Use PHPStorm IDE as currently it is most powerful IDE for PHP development on today's market.
1818

19-
Within this application the base workflow is following:
19+
For this application the base workflow is following:
2020

2121
`Controller/Command/EventSubscriber/MessageHandler(Transport layer) <--> Resource/Service(Application layer) <--> Repository/Service(Infrastructure layer) <--> Entity/Message/Service(Domain layer)`
2222

2323
#### Exceptions
24-
* All Exceptions that should terminate the current request (and return an error message to the user) should be handled
25-
using Symfony [best practice](https://symfony.com/doc/current/controller/error_pages.html#use-kernel-exception-event).
26-
* All Exceptions that should be handled in the controller, or just logged for debugging, should be wrapped in a
27-
try catch block (catchable Exceptions).
24+
* All Exceptions that should terminate the current request (and return an error message to the user) should be handled using Symfony [best practice](https://symfony.com/doc/current/controller/error_pages.html#use-kernel-exception-event).
25+
* All Exceptions that should be handled in the controller, or just logged for debugging, should be wrapped in a try catch block (catchable Exceptions).
2826
* Use custom Exceptions for all catchable scenarios, and try to use standard Exceptions for fatal Exceptions.
2927
* Use custom Exceptions to log.
3028

3129
#### Entities
32-
Entities should only be data-persistence layers, i.e. defines relationships, attributes, helper methods
33-
but does not fetch collections of data. Entities are located on the Domain layer (according to DDD approach) and shouldn't
34-
know anything about other layers (Application/Infrastructure) or framework. In this application we made some "exception"
35-
for such components like Doctrine/Swagger/Serializer/Validator (for the first time) and you can find such
36-
dependencies inside Entities.
37-
38-
Within this application we are using uuid v1 for the primary key inside Entities. Also we have id field as
39-
binary type ([details](https://uuid.ramsey.dev/en/stable/database.html#using-as-a-primary-key)). If you need to convert
40-
id into binary ordered time or from bin ordered time into a string inside query, please use MySql 8 internal functions [UUID_TO_BIN](https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid-to-bin) and [BIN_TO_UUID](https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_bin-to-uuid).
30+
Entities should only be data-persistence layers, i.e. defines relationships, attributes, helper methods but does not fetch collections of data.
31+
Entities are located on the Domain layer (according to DDD approach) and shouldn't know anything about other layers (Application/Infrastructure) or framework.
32+
In this application we made some "exception" for such components like Doctrine/Swagger/Serializer/Validator (for the first time) and you can find such dependencies inside Entities.
33+
34+
Inside this application we are using uuid v1 for the primary key inside Entities. Also we have id field as binary type ([details](https://uuid.ramsey.dev/en/stable/database.html#using-as-a-primary-key)).
35+
If you need to convert id into binary ordered time or from bin ordered time into a string inside query, please use MySql 8 internal functions [UUID_TO_BIN](https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_uuid-to-bin) and [BIN_TO_UUID](https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_bin-to-uuid).
4136
For instance `... WHERE id = UUID_TO_BIN(:id, 1)`, or when you need to convert uuid binary ordered time into string representative `... WHERE BIN_TO_UUID(id, 1) = :id`.
42-
The second argument determines if the byte order should be swapped, therefore when using uuid_binary you should pass 0 and when using uuid_binary_ordered_time you should pass 1.
37+
The second argument determines if the byte order should be swapped. Therefore, when using uuid_binary, you should pass 0. When using uuid_binary_ordered_time you should pass 1.
4338

4439
#### Repositories
45-
Repositories need to be responsible for parameter handling and query builder callbacks/joins. Should be located on
46-
infrastructure layer. Parameter handling can help with generic REST queries.
40+
Repositories need to be responsible for parameter handling and query builder callbacks/joins. Should be located on infrastructure layer. Parameter handling can help with generic REST queries.
4741

4842
#### Resources
49-
Resource services are services between your controller/command and repository. Should be located on application layer.
50-
Within this service it is possible to control how to `mutate` repository data for application needs.
43+
Resource services are services between controller/command and repository. Should be located on application layer.
44+
Inside this service it is possible to control how to `mutate` repository data for application needs.
5145
Resource services are basically the application foundation and it can control your request and response as you like.
52-
We have provided 2 examples how to build resource services: 1)resource with all-in-one actions (create/update/delete/etc, see example src/ApiKey/Application/Resource/ApiKeyResource.php)
46+
47+
We have provided 2 examples how to build resource services:
48+
49+
1)resource with all-in-one actions (create/update/delete/etc, see example src/ApiKey/Application/Resource/ApiKeyResource.php)
50+
5351
2)resource with single responsibility (f.e. count, see example src/ApiKey/Application/Resource/ApiKeyCountResource.php).
5452

5553
#### Controllers
56-
Should be located on Transport layer. Keep controllers clean of application logic. They should ideally just inject
54+
Should be located on the Transport layer. Keep controllers clean of application logic. They should ideally just inject
5755
resources/services - either through the constructor (if used more than once) or in the controller method itself.
58-
We have provided 2 examples how to build controllers: 1)controller with all-in-one actions (create/update/delete/etc, see example src/ApiKey/Transport/Controller/Api/v1/ApiKey/ApiKeyController.php)
56+
57+
We have provided 2 examples how to build controllers:
58+
59+
1)controller with all-in-one actions (create/update/delete/etc, see example src/ApiKey/Transport/Controller/Api/v1/ApiKey/ApiKeyController.php)
60+
5961
2)controller with single responsibility (f.e. count, see example src/ApiKey/Transport/Controller/Api/v2/ApiKey/ApiKeyCountController.php)
6062

6163
#### Events
@@ -70,7 +72,7 @@ Isolate 3rd party dependencies into Service classes for simple refactoring/exten
7072

7173
## PHP code quality
7274
You can control code quality of your PHP project using already integrated code quality tools. Before creating merge request you can run on your local PC code quality tools and get the report with issues that you can fix.
73-
Also code quality tools integrated inside CI environment and after creating merge request you can check if you have some issues inside your code. Please find the list of code quality tools that we recommend to use while PHP backend development.
75+
Also code quality tools integrated inside CI environment and, after creating merge request, you can check if you have some issues inside your code. Please find the list of code quality tools that we recommend to use for PHP backend development.
7476

7577
### PHP coding standard
7678
This tool is an essential development tool that ensures your code remains coding standard.
@@ -80,7 +82,7 @@ PHP coding standard is available for dev/test environment using next local shell
8082
make ecs
8183
```
8284

83-
If you want to fix all possible issues in auto mode(some issues can be fixed only manually) just use next local shell command:
85+
If you want to fix all possible issues in auto mode(some issues can be fixed only manually), just use next local shell command:
8486
```bash
8587
make ecs-fix
8688
```
@@ -93,8 +95,7 @@ PHP Code Sniffer is available for dev/test environment using next local shell co
9395
make phpcs
9496
```
9597

96-
If you are using [PhpStorm](https://www.jetbrains.com/phpstorm/) you can configure PHP Code Sniffer using recommendation
97-
[here](https://www.jetbrains.com/help/phpstorm/using-php-code-sniffer.html).
98+
If you are using [PhpStorm](https://www.jetbrains.com/phpstorm/) you can configure PHP Code Sniffer using recommendation [here](https://www.jetbrains.com/help/phpstorm/using-php-code-sniffer.html).
9899

99100
### PHPStan static analysis tool
100101
PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.
@@ -135,18 +136,18 @@ make phpcpd-html-report
135136
```
136137

137138
### Composer tools
138-
To normalize or validate your composer.json you can use next local shell commands:
139+
To normalize or validate your composer.json, you can use next local shell commands:
139140
```bash
140141
make composer-normalize
141142
make composer-validate
142143
```
143144

144-
If you need to find unused packages by scanning your code you can use next local shell commands:
145+
If you need to find unused packages by scanning your code, you can use next local shell commands:
145146
```bash
146147
make composer-unused
147148
```
148149

149-
In order to check the defined dependencies against your code you can use next local shell commands:
150+
In order to check the defined dependencies against your code, you can use next local shell commands:
150151
```bash
151152
make composer-require-checker
152153
```
@@ -157,7 +158,7 @@ Use next local shell command in order to run it:
157158
```bash
158159
make phpmetrics
159160
```
160-
Note: You need run tests before this local shell command.
161+
Note: You need to run tests before this local shell command.
161162

162163
After execution above local shell command please open `reports/phpmetrics/index.html` with your browser.
163164

@@ -203,7 +204,7 @@ Please use next workflow for migrations:
203204

204205
Above commands you can run in symfony container shell using next: `./bin/console doctrine:migrations:<command>`.
205206

206-
Using above workflow allow you make database changes on your application.
207+
Using above workflow allows you make database changes on your application.
207208
Also you do not need to make any migrations files by hand (Doctrine will handle it).
208209
Please always check generated migration files to make sure that those doesn't contain anything that you really don't want.
209210

‎docs/images/phpstorm_01.png

-27.1 KB
Loading

‎docs/images/phpstorm_02.png

12.6 KB
Loading

‎docs/images/phpstorm_03.png

-18 KB
Loading

‎docs/images/phpstorm_04.png

10.6 KB
Loading

‎docs/images/phpstorm_05.png

6.37 KB
Loading

‎docs/images/phpstorm_06.png

-7.52 KB
Loading
7.53 KB
Loading
-1.33 KB
Loading
8.63 KB
Loading
-690 Bytes
Loading

‎docs/images/phpstorm_phpmd_1.png

8.18 KB
Loading

‎docs/images/phpstorm_phpmd_2.png

-827 Bytes
Loading

‎docs/images/phpstorm_phpstan_1.png

7.38 KB
Loading

‎docs/images/phpstorm_phpstan_2.png

-990 Bytes
Loading

‎docs/images/xdebug_01.png

53.5 KB
Loading

‎docs/images/xdebug_02.png

74.8 KB
Loading

‎docs/messenger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Messenger
2-
This document describing how you can use [symfony/messenger](https://symfony.com/doc/current/messenger.html) bundle inside this environment.
2+
This document describing how you can use [symfony/messenger](https://symfony.com/doc/current/messenger.html) bundle.
33

44
## Basics
55

‎docs/phpstorm.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,20 @@ This document describing how you can configure your IDE [PhpStorm](https://www.j
44
## Configuring PhpStorm
55
### General
66
* Go to `Settings -> Plugins` and install next plugins:
7-
- .env files support
87
- .ignore
9-
- Elasticsearch (Paid)
10-
- Makefile Language
118
- Php Annotations
129
- Php Inspections (EA Extended)
1310
- Php Toolbox
14-
- Symfony support (Has some paid functions, [homepage](https://espend.de/phpstorm/plugin/symfony))
15-
- Rainbow brackets
11+
- JetBrains AI Assistant
12+
- Symfony Plugin (Has some paid functions, [homepage](https://espend.de/phpstorm/plugin/symfony))
13+
- Rainbow Brackets
1614
- String Manipulation
17-
- Extra ToolWindow Colorful Icons
15+
- Elasticsearch (Paid)
1816
* Go to `Settings -> Php -> Symfony` and check `Enable plugin for this project` and set Web Directory value as `public`.
19-
* If you want control quality of your PHP project - pay your attention to the tools, described [here](development.md).
17+
* If you want to control quality of your PHP project - pay your attention to the tools, described [here](development.md).
2018

2119
### CLI Interpreter
22-
You need to set correct CLI interpreter for your PhpStorm.
20+
You need to set a correct CLI interpreter for your PhpStorm.
2321
In order to do it please open `Settings -> PHP` section and follow recommendations [configuring remote PHP interpreters](https://www.jetbrains.com/help/phpstorm/configuring-remote-interpreters.html).
2422

2523
![Path mappings](images/phpstorm_00.png)
@@ -37,7 +35,7 @@ You need to configure how your local files will be mapped inside docker containe
3735
![Path mappings](images/phpstorm_03.png)
3836

3937
### Test Frameworks
40-
If you want to run tests directly from your IDE you need to do following configuration in `Settings -> PHP -> Test Frameworks`:
38+
If you want to run tests directly from your IDE you need to do a following configuration in `Settings -> PHP -> Test Frameworks`:
4139

4240
![Path mappings](images/phpstorm_04.png)
4341

@@ -63,30 +61,30 @@ Anyway you can always import our recommended code style if you don't have commit
6361
![Path mappings](images/phpstorm_php_code_sniffer_2.png)
6462
![Path mappings](images/phpstorm_php_cs_fixer_1.png)
6563

66-
Note: make sure that you have proper local path for the PHP CS Fixer ruleset `.php-cs-fixer.dist.php`.
64+
Note: make sure that you have a proper local path for the PHP CS Fixer ruleset `.php-cs-fixer.dist.php`.
6765

6866
![Path mappings](images/phpstorm_php_cs_fixer_2.png)
6967
![Path mappings](images/phpstorm_phpstan_1.png)
7068
![Path mappings](images/phpstorm_phpstan_2.png)
7169
![Path mappings](images/phpstorm_phpmd_1.png)
7270

73-
Note: make sure that you have proper local path for the MessDetector ruleset `phpmd_ruleset.xml`.
71+
Note: make sure that you have a proper local path for the MessDetector ruleset `phpmd_ruleset.xml`.
7472

7573
![Path mappings](images/phpstorm_phpmd_2.png)
7674

7775
* If you don't have committed folder `.idea/`, go to `Settings -> Editor -> Inspections` and import profile `Project Default` (Inspections.xml) from [docs/phpstorm](phpstorm):
7876

7977
![Path mappings](images/phpstorm_inspections.png)
8078

81-
* Go to `Settings -> Tools -> External tools` and create ecs tool:
79+
* Go to `Settings -> Tools -> External Tools` and create ecs tool:
8280

8381
![Path mappings](images/phpstorm_12.png)
8482

8583
Note: Arguments value should be `exec-bash cmd="./vendor/bin/ecs --clear-cache check $FilePathRelativeToProjectRoot$"`.
8684

8785
Note: In order to use it - right click on the necessary file/folder in PhpStorm and select context menu `External Tools -> ecs`.
8886

89-
* Go to `Settings -> Tools -> External tools` and create phpcs tool:
87+
* Go to `Settings -> Tools -> External Tools` and create phpcs tool:
9088

9189
![Path mappings](images/phpstorm_13.png)
9290

@@ -95,7 +93,7 @@ Note: Arguments value should be `exec-bash cmd="./vendor/bin/phpcs --version &&
9593
Note: In order to use it - right click on the necessary file/folder in PhpStorm and select context menu `External Tools -> phpcs`.
9694

9795

98-
For inspecting your code you can use main menu item `Code -> Inspect Code`. Code will be processed by code quality tools like PHP CS Fixer, PHP Mess Detector, PHP CodeSniffer, PHPStan.
96+
For inspecting your code you can use main menu item `Code -> Inspect Code`. Code will be processed by code quality tools like PHP CS Fixer, PHP CodeSniffer, PHPStan, PHP Mess Detector.
9997

10098
## External documentations
10199
* [Configuring Remote PHP Interpreters](https://www.jetbrains.com/help/phpstorm/configuring-remote-interpreters.html)

‎docs/postman.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Postman
2-
This document describing how you can use [Postman](https://www.getpostman.com/) within this environment.
2+
This document describing how you can use [Postman](https://www.getpostman.com/).
33

44
## Using Postman
55
1. [Install Postman](https://www.getpostman.com/postman)
66
2. [Import all files from "postman" folder](postman)
77
3. Select `dev` environment in top right corner
8-
4. After getting token don't forget to update value for `token` variable in `manage environments` section in order to call protected entry points
8+
4. After getting token, don't forget to update value for `token` variable in the `manage environments` section in order to call protected entry points
99

1010
![Using Postman](images/postman_01.png)

‎docs/rdm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Redis GUI
2-
This document describing how you can use [RedisInsight](https://redis.com/redis-enterprise/redis-insight/) within this environment.
2+
This document describing how you can use [RedisInsight](https://redis.com/redis-enterprise/redis-insight/).
33

44
## Using RedisInsight
55
1. [Install RedisInsight](https://redis.com/redis-enterprise/redis-insight/) via your OS Application Manager or download via official web-site

‎docs/swagger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Swagger
2-
This document describing how you can use [Swagger](https://swagger.io/) within this environment.
2+
This document describing how you can use [Swagger](https://swagger.io/).
33

44
## Using Swagger
55
* [Local Swagger service](http://localhost/api/doc) - Open next url http://localhost/api/doc in order to use Swagger.

‎docs/testing.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Testing
2-
This document describing how you can run tests within this environment.
2+
This document describing how you can run tests.
33

44
### General
5-
This environment contains next [types](https://symfony.com/doc/current/testing.html#types-of-tests) of tests:
5+
This environment contains the next [types](https://symfony.com/doc/current/testing.html#types-of-tests) of tests:
66

77
* Application tests
88
* Integration tests
@@ -15,14 +15,14 @@ Note 1: Please note that this environment does not use simple phpunit as does Sy
1515
Note 2: `Application` test === `Functional` test, please use naming convention(`Application`) as described [here](https://symfony.com/doc/current/testing.html#application-tests).
1616

1717
### Commands to run tests
18-
You can run tests using following local shell command(s):
18+
You can run tests using the following local shell command(s):
1919
```bash
2020
make phpunit # Run all tests
2121
```
2222

23-
After execution above local shell command you are able to check code coverage report. Please open `reports/coverage/index.html` with your browser.
23+
After execution above local shell command, you are able to check a code coverage report. Please open `reports/coverage/index.html` with your browser.
2424

25-
If you want to run single test or all tests in specified directory you can use next steps:
25+
If you want to run a single test or all tests in specified directory, you can use the next steps:
2626

2727
1.Use next local shell command in order to enter into symfony container shell:
2828
```bash
@@ -31,23 +31,12 @@ make ssh # Enter symfony container shell
3131
2.Use next symfony container shell command(s) in order to run test(s):
3232
```bash
3333
./vendor/bin/phpunit ./tests/Application/Controller/ApiKeyControllerTest.php # Just this single test class
34-
./vendor/bin/phpunit ./tests/Application/Controller/ # All tests in this directory
34+
./vendor/bin/phpunit ./tests/Application/Controller/ # All tests in the directory
3535
```
3636

3737
### Separate environment for testing
38-
By default this environment is using separate database for testing.
38+
By default, this environment is using a separate database for testing.
3939
If you need to change separate environment for testing (f.e. change database or another stuff) you need to edit `.env.test` file.
4040

41-
42-
## Metrics
43-
This environment contains [PhpMetrics](https://github.com/phpmetrics/phpmetrics) to make some code analysis.
44-
Use next local shell command in order to run it:
45-
```bash
46-
make phpmetrics
47-
```
48-
Note: You need run tests before this local shell command.
49-
50-
After execution above local shell command please open `reports/phpmetrics/index.html` with your browser.
51-
5241
## PhpStorm
5342
You can run tests directly from your IDE PhpStorm. Please follow [PhpStorm](phpstorm.md) documentation in order to do it.

‎docs/xdebug.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,68 @@
11
# Xdebug
2-
This document describing how you can use [Xdebug](https://xdebug.org/) and [PhpStorm](https://www.jetbrains.com/phpstorm/) within DEV environment.
2+
This document describing how you can use [Xdebug](https://xdebug.org/) and [PhpStorm](https://www.jetbrains.com/phpstorm/) for the DEV environment.
33

44
## Configuration and usage
5-
Please follow [PhpStorm](phpstorm.md) documentation before actions described bellow.
5+
Please follow [PhpStorm](phpstorm.md) documentation before actions described below.
66

77
### PhpStorm basic configuration
88
1.Check /docker/dev/xdebug-main.ini or /docker/dev/xdebug-osx.ini (optional)
99

10-
- In case you need debug only requests with IDE KEY: PHPSTORM from frontend in your browser:
10+
- Set option in case you need to debug every request to an api (by default):
1111
```bash
12-
xdebug.start_with_request = no
12+
xdebug.start_with_request = yes
1313
```
14-
Install locally in Firefox extension "Xdebug helper" and set in settings IDE KEY: PHPSTORM
1514

16-
- In case you need debug any request to an api (by default):
15+
- Set option in case you need to debug only requests with IDE KEY: PHPSTORM from frontend in your browser:
1716
```bash
18-
xdebug.start_with_request = yes
17+
xdebug.start_with_request = no
1918
```
2019

2120
2.Go to `Settings -> Php -> Debug` and set Xdebug port `10000`
2221

23-
3.Check your `Run/Debug Configurations` as on image bellow
24-
25-
4.Install needed browser extensions (optional, see step 1). For example for Firefox install extension "Xdebug helper" and set in extension settings IDE KEY: PHPSTORM
22+
3.Check your `Run/Debug Configurations` as on image below:
2623

2724
![Basic configuration](images/xdebug_01.png)
2825

2926
![Basic configuration](images/phpstorm_05.png)
3027

28+
4.Install browser extensions (optional, see step 1). For example, for Firefox, install extension "Xdebug helper" and set in extension settings IDE KEY: PHPSTORM
29+
3130
### Using Xdebug
32-
After actions above you can start to listen incoming PHP debug connections:
31+
After actions above, you can start listening for incoming PHP debug connections:
3332

3433
1. Add breakpoint to your code
3534
2. Enable Xdebug in your browser (optional, required only when xdebug.start_with_request = no)
3635
3. Click `Debug` button in PhpStorm
37-
4. Reload browser page
36+
4. Reload page in the browser
3837

39-
If everything configured properly you will get something like next:
38+
If everything configured properly, you will get something like next:
4039

4140
![Using Xdebug](images/xdebug_02.png)
4241

4342
## Debug Postman requests
44-
If you're using [Postman](https://www.getpostman.com/) to test/debug your application when `xdebug.start_with_request = no` you need to add `?XDEBUG_SESSION_START=PHPSTORM` to each URL
45-
that you use with Postman. If you have default configuration (`xdebug.start_with_request = yes`) - nothing to do and your Xdebug should work out of the box.
43+
If you're using [Postman](https://www.getpostman.com/) to test/debug your application, when `xdebug.start_with_request = no`, you need to add `?XDEBUG_SESSION_START=PHPSTORM` to each URL that you use with Postman.
44+
If you have default configuration (`xdebug.start_with_request = yes`) - nothing to do and your Xdebug should work out of the box.
4645

4746
## Debug Console commands / Messenger async handlers
48-
If you want to debug console commands or messenger async handlers you just need to uncomment/edit (nothing to do in case MacOS and `XDEBUG_CONFIG=osx`) option `xdebug.client_host` in config `docker/dev/xdebug-main.ini`:
47+
If you want to debug console commands or messenger async handlers, you need to uncomment/edit (nothing to do in case MacOS and `XDEBUG_CONFIG=osx`) option `xdebug.client_host` inside config `docker/dev/xdebug-main.ini`:
4948
```bash
5049
xdebug.client_host=172.17.0.1
5150
```
5251
Just find out the proper host ip in your docker bridge configuration and set above option (in general it is `172.17.0.1`).
5352
Don't forget to rebuild docker containers according to [general](../readme.md) documentation.
5453

55-
If you want to debug your messenger async jobs just follow next steps:
54+
If you want to debug your messenger async jobs, please follow the next steps:
5655

57-
1. Enter in `supervisord` docker container shell using your local shell command `make ssh-supervisord`
58-
2. In `supervisord` container shell run next command `supervisorctl`
59-
3. Stop program `messenger-consume:messenger-consume_00` using next command `stop messenger-consume:messenger-consume_00` and make sure that you can see message `messenger-consume:messenger-consume_00: stopped`
60-
4. Exit from supervisorctl shell using next command `exit`
61-
5. Exit from `supervisord` docker container using command `exit`. Make sure that you are in local shell.
62-
6. Enter in `symfony` docker container shell using your local shell command `make ssh`
56+
1. Enter inside `supervisord` docker container shell using your local shell command `make ssh-supervisord`
57+
2. Inside `supervisord` container shell run the next command `supervisorctl`
58+
3. Stop program `messenger-consume:messenger-consume_00` using the next command `stop messenger-consume:messenger-consume_00` and make sure that you can see message `messenger-consume:messenger-consume_00: stopped`
59+
4. Exit from supervisorctl shell using the next command `exit`
60+
5. Exit from `supervisord` docker container using command `exit`. Make sure that you are in the local shell.
61+
6. Enter inside `symfony` docker container shell using your local shell command `make ssh`
6362
7. Put necessary message in queue or make sure that it is already there
6463
8. Run PHPStorm debug
65-
9. Run in `symfony` docker container shell next command in order to run your async handlers `/usr/local/bin/php bin/console messenger:consume async_priority_high async_priority_low --limit=1` (where limit option is a number of messages that you want to debug)
66-
10. Have fun with debugging and don't forget to switch on program `messenger-consume:messenger-consume_00` (step 1, 2 and execute `start messenger-consume:messenger-consume_00`) in `supervisord` docker container when you'll finish your debugging (or you can simply restart environment using your local shell command `make restart`).
64+
9. Run inside `symfony` docker container shell the next command to run your async handlers `/usr/local/bin/php bin/console messenger:consume async_priority_high async_priority_low --limit=1` (where limit option is a number of messages that you want to debug)
65+
10. Have fun with debugging and don't forget to turn on the program `messenger-consume:messenger-consume_00` (step 1, 2 and execute `start messenger-consume:messenger-consume_00`) inside `supervisord` docker container when you'll finish your debugging (or you can simply restart environment using your local shell command `make restart`).
6766

6867
## External documentations
6968
* [Debugging PHP (web and cli) with Xdebug using Docker and PHPStorm](https://thecodingmachine.io/configuring-xdebug-phpstorm-docker)

0 commit comments

Comments
 (0)
Please sign in to comment.