Skip to content

Commit cb29184

Browse files
authored
Merge pull request #57 from picamator/development
Release 5.6.0
2 parents a2877bd + c14bdf0 commit cb29184

File tree

135 files changed

+2508
-386
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+2508
-386
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ var/cache/*
3333

3434
# project
3535
src/**/_tmp
36+
src/**/transfer.lock
3637
examples/**/_tmp
38+
examples/**/transfer.lock
3739
tests/**/_tmp
40+
tests/**/transfer.lock
3841

3942
# environment
4043
.env

AGENTS.md

Lines changed: 60 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
Purpose
22
-------
33

4-
This file is the project index for "agents":
5-
6-
- the modules that generate or use PHP transfer objects
7-
- the IDE plugins that help to develop the project
8-
- the IDE plugins that help to integrate PHP transfer objects into the application
9-
4+
This file is for AI Agents.
105
It is intentionally short and only contains agent-specific facts and a concise inventory.
6+
117
Full how-to and contribution guides are in the canonical destinations:
128

13-
- README.md
14-
- CONTRIBUTING.md
15-
- CODE_OF_CONDUCT.md
16-
- SECURITY.md
9+
- [README.md](README.md)
10+
- [CONTRIBUTING.md](CONTRIBUTING.md)
11+
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
12+
- [SECURITY.md](SECURITY.md)
1713
- [WIKI](https://github.com/picamator/transfer-object/wiki)
1814

1915
Installation
@@ -29,11 +25,9 @@ Directory Structure
2925
### Console commands
3026

3127
- `bin`: project's console commands:
32-
* `transfer-generate`: generate transfer objects from configuration files
33-
* `transfer-generate-bulk`: generate transfer objects by the list of configuration files
34-
* `definition-generate`: generate definition files
35-
36-
> Installing the project by composer, the console commands are available in the vendor's bin directory.
28+
* `transfer-generate`: generate transfer objects from a single configuration file
29+
* `transfer-generate-bulk`: generate transfer objects from a list of configuration files
30+
* `definition-generate`: generate definition files from JSON blueprints
3731

3832
### Config
3933

@@ -53,10 +47,19 @@ Directory Structure
5347
- `src/Dependency`: wrapper over third-party dependencies
5448
- `src/Generated`: directory where generated transfer objects are saved
5549
* should not contain any custom-written code
56-
* each transfer object generator run overwrites all the files in the directory
57-
* can be used across modules
58-
- `src/Generated/_tmp`: temporary directory including newly generated transfer objects before they are finally moved to the `src/Generated`
50+
* can be used across modules like `src/ModuleOne/Generated`, `src/ModuleTwo/Generated`, etc.
51+
- `src/Generated/_tmp`: temporary directory to hold the transfer object generator's process directories
52+
- `src/Generated/_tmp/{uuid}`: transfer object generator's process directory named by UUID.
53+
The directory is created before the process starts and holds new transfer objects.
54+
* only when the process is finished successfully, the transfer objects are moved to the `Generated` directory.
55+
* each process directory is deleted after the process is finished
5956
* in case of an unexpected error, the directory might not be deleted.
57+
- `src/Generated/_tmp/{uuid}/{hash}.transfer.hash.csv`: hash file, each line of which contains comma-separated:
58+
* transfer object class name
59+
* transfer object content hash
60+
- `src/Generated/{hash}.transfer.hash.csv`: hash file from previous transfer object generation run.
61+
It is used to check for transfer object content changes as well as if some transfer objects should be deleted.
62+
- `src/Generated/transfer.lock`: lock file used to prevent multiple processes from writing to the `Generated` directory at the same time.
6063
- `src/Shared`: contains code shared across modules
6164
* can be used across modules
6265
- `src/Transfer`: transfer object module
@@ -65,7 +68,7 @@ Directory Structure
6568

6669
### Technical
6770

68-
- `.github`: GitHub CI actions, template and README.md images
71+
- `.github`: GitHub CI actions, template, and README.md images
6972
- `.xdebug`: Xdebug configuration for [Native Path Mapping](https://xdebug.org/funding/001-native-path-mapping)
7073
- `docker`: [dockerized development environment](https://github.com/picamator/transfer-object/wiki/Development-Environment) configuration with shell helper commands
7174

@@ -89,7 +92,7 @@ Code Style
8992
- classes should be `readonly` when possible
9093
- classes should use Constructor Property Promotion
9194
- class properties should have `private` visibility unless one is a transfer object, or it is necessary for inheritance
92-
- class method's and property's names should be similar across modules
95+
- class methods and property names should be similar across modules
9396
* **expander** classes should have `public` methods prefixed by `expand`
9497
* **parser** classes should have `public` methods prefixed by `parse`
9598
* **builder** classes should have `public` methods prefixed by `create`
@@ -139,6 +142,7 @@ How To Install Project
139142
----------------------
140143

141144
The project is installed by running the following command:
145+
142146
```console
143147
docker/sdk install
144148
```
@@ -147,16 +151,19 @@ How To Build/Start/Stop Docker Environment
147151
-------------------------------------------
148152

149153
Docker Environment is built by running the following command:
154+
150155
```console
151156
docker/sdk build
152157
```
153158

154159
Docker Environment is started by running the following command:
160+
155161
```console
156162
docker/sdk start
157163
```
158164

159165
Docker Environment is stopped by running the following command:
166+
160167
```console
161168
docker/sdk stop
162169
```
@@ -165,101 +172,126 @@ How to Run PHP Script
165172
---------------------
166173

167174
The PHP script runs by command:
175+
168176
```console
169177
docker/sdk cli [path-to-script]
170178
```
171179

172180
For instance, the `./examples/try-transfer-generator.php`:
181+
173182
```console
174183
docker/sdk cli ./examples/try-transfer-generator.php
175184
```
176185

177186
How to Generate Internal Transfer Objects
178187
-----------------------------------------
179188

180-
All project transfer objects (generator's, examples, tests) can be generated with the following command:
189+
All project transfer objects (generators, examples, tests) can be generated with the following command:
190+
181191
```console
182192
docker/sdk to-generate-bulk
183193
```
184194

185-
To generate only generator's transfer objects, please run the following command:
195+
To generate only the generator's transfer objects, please run the following command:
196+
186197
```console
187198
docker/sdk to-generate
188199
```
189200

190201
How to Generate Transfer Objects By Configuration File
191202
------------------------------------------------------
192203

193-
Transfer objects can be generated by a configuration file path, relative from the project's root, by running the following command:
204+
Transfer objects can be generated by a configuration file path,
205+
relative to the project's root, by running the following command:
206+
194207
```console
195208
docker/sdk to-generate [path-to-configuration-file]
196209
```
197210

211+
How to Generate Definition Files
212+
--------------------------------
213+
214+
To generate definition files from JSON blueprints, please run the following command:
215+
216+
```console
217+
docker/sdk df-generate
218+
```
219+
198220
How to Run PHPUnit Tests
199221
------------------------
200222

201223
### How to Run All Tests
202224

203225
All tests can be run with the following command:
226+
204227
```console
205228
docker/sdk phpunit
206229
```
207230

208231
### How to Run Test Group
209232

210233
A test group can be run with the following command:
234+
211235
```console
212236
docker/sdk phpunit-group <group>
213237
```
214238

215239
### How to Run Test Case
216240

217241
A test case can be run with the following command:
242+
218243
```console
219244
docker/sdk phpunit '<test-case-full-qualifided-name>'
220245
```
221246

222247
For instance, the test case `Picamator\Tests\Unit\TransferObject\Command\Helper\InputNormalizerTest`
223248
can be run with the following command:
249+
224250
```console
225251
docker/sdk phpunit 'Picamator\\Tests\\Unit\\TransferObject\\Command\\Helper\\InputNormalizerTest'
226252
```
227253

228254
How to Run PHPStan
229255
------------------
230256

231-
For all project's files, PHPStan can be run with the following command:
257+
For all project files, PHPStan can be run with the following command:
258+
232259
```console
233260
docker/sdk phpstan
234261
```
235262

236263
For the specific file:
264+
237265
```console
238266
docker/sdk phpstan <file-path>
239267
```
240268

241269
How to Run PHP CodeSniffer
242270
--------------------------
243271

244-
For all project's files, PHP CodeSniffer can be run with the following command:
272+
For all project files, PHP CodeSniffer can be run with the following command:
273+
245274
```console
246275
docker/sdk phpcs
247276
```
248277

249278
For the specific file:
279+
250280
```console
251281
docker/sdk phpcs <file-path>
252282
```
253283

254284
How to Run PHP Code Beautifier and Fixer
255285
----------------------------------------
256286

257-
For all project's files, PHP Code Beautifier and Fixer can be run with the following command:
287+
For all project files, PHP Code Beautifier and Fixer can be run with the following command:
288+
258289
```console
259290
docker/sdk phpcbf
260291
```
261292

262293
For the specific file:
294+
263295
```console
264296
docker/sdk phpcbf <file-path>
265297
```
@@ -268,11 +300,13 @@ How to Run Composer
268300
-------------------
269301

270302
Composer can be run with the following command:
303+
271304
```console
272305
docker/sdk composer
273306
```
274307

275308
The command supports multiple arguments, for example:
309+
276310
```console
277311
docker/sdk composer install
278312
```

0 commit comments

Comments
 (0)