Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
1f135d6
Added file rotation cache
picamator Feb 25, 2026
fbcbfb3
Optimized the file rotation cache: added specified transfer object, r…
picamator Feb 26, 2026
a31a9aa
Optimized getToDeleteClassNames()
picamator Feb 26, 2026
3b58e97
Replaced copy-delete file to rename, added try-finally apporach to cl…
picamator Feb 26, 2026
719607a
Optimized hash reader, changed argument order on hash_equals
picamator Feb 27, 2026
596f558
Refactored hash reader and writer, covered by unit tests
picamator Feb 27, 2026
4e6ecaf
Specified returned command error
picamator Feb 27, 2026
9316a46
Added environment variable to invalidate transfer cache
picamator Feb 27, 2026
37d5905
Added new configuration field: hashFileName to allow several configur…
picamator Feb 27, 2026
d10ff13
Changed TransferGeneratorCommandTest code style
picamator Feb 27, 2026
b3825fe
Changed normalizeHashFileName
picamator Feb 27, 2026
c3bfa23
Refactored ConfigNormalizerTrait, added hashFileName validator, actua…
picamator Feb 27, 2026
c6f1474
Fixed/added configuration schema path
picamator Feb 27, 2026
fb18d35
Removed project root overwrite from docker compose, removed cache ver…
picamator Feb 28, 2026
c2f2b17
Removed HashFileWriterTest test
picamator Feb 28, 2026
f7aced1
Optimize command functional tests aplying separate configurations, fi…
picamator Feb 28, 2026
a29c044
Added file modified assert for CacheDisabledTransferGeneratorCommandTest
picamator Mar 1, 2026
3bd5e78
Covered transfer generator command with the test case to rotate file …
picamator Mar 1, 2026
52b8550
Covered config hash file name by tests
picamator Mar 1, 2026
352b537
Improved TransferGeneratorCommandTest code coverage
picamator Mar 1, 2026
7bbdf4a
Removed copy method from Filesystem
picamator Mar 1, 2026
4747973
Removed unused method from FinderInterface
picamator Mar 1, 2026
e9936f7
Improved ConfigReader test coverage
picamator Mar 1, 2026
dfc1837
Improved AttributesPropertyExpander test coverage
picamator Mar 1, 2026
9863547
Improved PropertyNormalizerTrait test coverage
picamator Mar 1, 2026
3a8c761
Moved Definition Generator tests from main readme to the test readme
picamator Mar 1, 2026
01e2766
Actualized definition generator integration test readme
picamator Mar 1, 2026
04c1b31
Actualized readme key features
picamator Mar 1, 2026
a983c2d
Extracted examples from the main README to the examples readme, added…
picamator Mar 1, 2026
7c83c5f
Actualized link to examples
picamator Mar 1, 2026
a25fa77
Actualized link to examples (reverted last commit)
picamator Mar 1, 2026
b4bca06
Actualyzed examples readme
picamator Mar 1, 2026
b66dd51
Updated example readme
picamator Mar 3, 2026
10fe47e
Removed semicolumn on the Definition Generator command questions
picamator Mar 3, 2026
76e3d17
Generated hash names dinamically to avoid possible file name collisio…
picamator Mar 3, 2026
2108777
Used separate temporary directory per configuration and per process
picamator Mar 3, 2026
6715f7f
Wrapped post process to run on finally
picamator Mar 3, 2026
e8ae42e
Implemented transfer object generator locker
picamator Mar 3, 2026
cc10866
Actualized config list for transfer object bulk commmand
picamator Mar 3, 2026
0026a6e
Cover file locker with tests
picamator Mar 3, 2026
2ecceb7
Refactored file rotate flow to lock the transfer destination director…
picamator Mar 5, 2026
0081e65
Removed transfer.lock, added transfer.lock to gitignore
picamator Mar 5, 2026
d309113
Fixed issue to have temporary directory leftovers, simplified deletio…
picamator Mar 5, 2026
677bef8
Simplified transfer generation workflow - executing post command
picamator Mar 6, 2026
8e9075e
Actualized AGENTS.md with hash and lock files details
picamator Mar 6, 2026
bb987c2
Actualized readme
picamator Mar 6, 2026
3bb9821
Fixed README and AGENTS typos
picamator Mar 6, 2026
8cf7d3e
Actualized readme
picamator Mar 6, 2026
1ebf9d5
Actualized readme
picamator Mar 6, 2026
c73e3ae
Actualized readme
picamator Mar 6, 2026
f2331d5
Actualized readme and agents
picamator Mar 6, 2026
c04fa5a
Actualized agents
picamator Mar 6, 2026
f09edbe
Actualized readme files
picamator Mar 6, 2026
3b0f106
Actualized readme
picamator Mar 6, 2026
341b36f
Upgraded composer dependencies
picamator Mar 7, 2026
c14bdf0
Actualized readme
picamator Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ var/cache/*

# project
src/**/_tmp
src/**/transfer.lock
examples/**/_tmp
examples/**/transfer.lock
tests/**/_tmp
tests/**/transfer.lock

# environment
.env
86 changes: 60 additions & 26 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
Purpose
-------

This file is the project index for "agents":

- the modules that generate or use PHP transfer objects
- the IDE plugins that help to develop the project
- the IDE plugins that help to integrate PHP transfer objects into the application

This file is for AI Agents.
It is intentionally short and only contains agent-specific facts and a concise inventory.

Full how-to and contribution guides are in the canonical destinations:

- README.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- SECURITY.md
- [README.md](README.md)
- [CONTRIBUTING.md](CONTRIBUTING.md)
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
- [SECURITY.md](SECURITY.md)
- [WIKI](https://github.com/picamator/transfer-object/wiki)

Installation
Expand All @@ -29,11 +25,9 @@ Directory Structure
### Console commands

- `bin`: project's console commands:
* `transfer-generate`: generate transfer objects from configuration files
* `transfer-generate-bulk`: generate transfer objects by the list of configuration files
* `definition-generate`: generate definition files

> Installing the project by composer, the console commands are available in the vendor's bin directory.
* `transfer-generate`: generate transfer objects from a single configuration file
* `transfer-generate-bulk`: generate transfer objects from a list of configuration files
* `definition-generate`: generate definition files from JSON blueprints

### Config

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

### Technical

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

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

The project is installed by running the following command:

```console
docker/sdk install
```
Expand All @@ -147,16 +151,19 @@ How To Build/Start/Stop Docker Environment
-------------------------------------------

Docker Environment is built by running the following command:

```console
docker/sdk build
```

Docker Environment is started by running the following command:

```console
docker/sdk start
```

Docker Environment is stopped by running the following command:

```console
docker/sdk stop
```
Expand All @@ -165,101 +172,126 @@ How to Run PHP Script
---------------------

The PHP script runs by command:

```console
docker/sdk cli [path-to-script]
```

For instance, the `./examples/try-transfer-generator.php`:

```console
docker/sdk cli ./examples/try-transfer-generator.php
```

How to Generate Internal Transfer Objects
-----------------------------------------

All project transfer objects (generator's, examples, tests) can be generated with the following command:
All project transfer objects (generators, examples, tests) can be generated with the following command:

```console
docker/sdk to-generate-bulk
```

To generate only generator's transfer objects, please run the following command:
To generate only the generator's transfer objects, please run the following command:

```console
docker/sdk to-generate
```

How to Generate Transfer Objects By Configuration File
------------------------------------------------------

Transfer objects can be generated by a configuration file path, relative from the project's root, by running the following command:
Transfer objects can be generated by a configuration file path,
relative to the project's root, by running the following command:

```console
docker/sdk to-generate [path-to-configuration-file]
```

How to Generate Definition Files
--------------------------------

To generate definition files from JSON blueprints, please run the following command:

```console
docker/sdk df-generate
```

How to Run PHPUnit Tests
------------------------

### How to Run All Tests

All tests can be run with the following command:

```console
docker/sdk phpunit
```

### How to Run Test Group

A test group can be run with the following command:

```console
docker/sdk phpunit-group <group>
```

### How to Run Test Case

A test case can be run with the following command:

```console
docker/sdk phpunit '<test-case-full-qualifided-name>'
```

For instance, the test case `Picamator\Tests\Unit\TransferObject\Command\Helper\InputNormalizerTest`
can be run with the following command:

```console
docker/sdk phpunit 'Picamator\\Tests\\Unit\\TransferObject\\Command\\Helper\\InputNormalizerTest'
```

How to Run PHPStan
------------------

For all project's files, PHPStan can be run with the following command:
For all project files, PHPStan can be run with the following command:

```console
docker/sdk phpstan
```

For the specific file:

```console
docker/sdk phpstan <file-path>
```

How to Run PHP CodeSniffer
--------------------------

For all project's files, PHP CodeSniffer can be run with the following command:
For all project files, PHP CodeSniffer can be run with the following command:

```console
docker/sdk phpcs
```

For the specific file:

```console
docker/sdk phpcs <file-path>
```

How to Run PHP Code Beautifier and Fixer
----------------------------------------

For all project's files, PHP Code Beautifier and Fixer can be run with the following command:
For all project files, PHP Code Beautifier and Fixer can be run with the following command:

```console
docker/sdk phpcbf
```

For the specific file:

```console
docker/sdk phpcbf <file-path>
```
Expand All @@ -268,11 +300,13 @@ How to Run Composer
-------------------

Composer can be run with the following command:

```console
docker/sdk composer
```

The command supports multiple arguments, for example:

```console
docker/sdk composer install
```
Loading