Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ runs:
php-version: ${{ inputs.php-version }}
tools: composer:${{ inputs.composer-version }}
coverage: xdebug
ini-values: zend.assertions=1

- name: Validate Composer Config
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
vendor/bin/phpunit \
--testsuite 'Unit' \
--log-junit 'var/test-results/${{ inputs.os }}-php${{ matrix.php-version }}.junit.xml' \
--coverage-text \
--coverage-cobertura 'var/coverage/${{ inputs.os }}-php${{ matrix.php-version }}/coverage.cobertura.xml'

- if: success() || failure()
Expand Down
2 changes: 0 additions & 2 deletions .idea/docker-composer.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Unit_Tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 21 additions & 22 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## General Instructions
In all interactions and comments be extremely concise — sacrifice grammar for the sake of conciseness. Conciseness alone does not justify omitting information or intent.
In commit messages use conventional commits and provide justification of the changes in the body.
In all interactions and plans be extremely concise — sacrifice grammar for the sake of conciseness. Conciseness alone does not justify omitting information or intent.

## Plan Mode
Make plans extremely concise — sacrifice grammar for the sake of concision. Conciseness alone does not justify omitting information or intent.
Make plans extremely concise — sacrifice grammar for the sake of conciseness. Conciseness alone does not justify omitting information or intent.
At the end of each plan, give me a list of unresolved questions to answer, if any.

## Tests
Expand All @@ -13,25 +13,17 @@ At the end of every task, execute these commands to ensure the quality of the co
- `composer stan`
- `composer test`

## PHPStan
Prefer clear, performant code over reshaping code only to satisfy PHPStan.
Treat PHPStan findings as likely real; fix root causes first.
If PHPStan cannot model valid runtime behavior, use the narrowest fix:
1. add explicit control flow or `assert()` when it improves clarity;
2. otherwise add a targeted `@phpstan-ignore <identifier>` on the exact line.
Do not add broad suppressions, baselines, or unclear type workarounds.

## Coding Style
All PHP code must adhere to PER Coding Syle 3.0, which also includes PSR-1: Basic Coding Standard.
All PHP code must adhere to PER Coding Style, which includes PSR-1: Basic Coding Standard.
Files should _either_ declare symbols _or_ cause side-effects but not both.

## PHPDoc
Add descriptive PHPDoc comments to all Structural Elements in PHP code under `src/`. Include descriptive `@param` and `@return` tags for all argument and return types, and `@var` tags for all parameters.
Add descriptive PHPDoc comments to all Structural Elements in PHP code under `src/`. For functions and methods include the return type, and the `@param` and `@return` tags for every argument.

When writing PHPDocs, observe this format:

```php
class
class Foo
{
/**
* Constants don't need a `@var` doctag, since their type is implied.
Expand All @@ -53,32 +45,39 @@ class
private Baz baz():

/**
* The first line should be a short description with no Markdown.
* The first line should be a short description, no Markdown allowed here.
*
* Here you can add as many lines and all the Markdown you want.
* Here, provide a high-level explanation of what the function does and what
* the use cases are. Aim for a line length of 80 characters or fewer.
*
* You can use as many lines and all the Markdown you want.
* - reference arguments by making the text __bold__
* - reference scalar types and literals with backticks, so `string` and `"foo"`
* - reference scalar types and literals with backticks, so `string` and
* `"foo"`
* - reference non-scalar types as {@see Foo}
* - import referenced classes, do not use FQN
*
* If appropriate, e.g. if not completely clear from the description
* signature alone, provide some examples:
*
* // 4 spaces indent Code blocks.
* foo(1, 2, 'three');
* foo($foo, $bar, 'foo'); // returns $foo
* foo($foo, $bar, 'baz'); // returns $bar
*
* Keep a blank line before the first doctag:
* Keep a blank line before the first doc tag:
*
* @template TFoo of Foo
* @template TBar of Bar
*
* @param TFoo $one
* Place the description of a doctag on the next line, indented by 2
* Place the description of a doc tag on the next line, indented by 2
* spaces.
*
* @param TBar $two
* Doctags with a description should be surrounded by a blank line.
* Doc tags with a description should be surrounded by a blank line.
*
* @param string $three
* `@param` doctags should have their type and argument name surrounded
* by 2 spaces
* Only `@param` doc tags have their type and name surrounded by 2 spaces.
*
* @return ($three is "foo" ? TFoo : TBar)
* Returns __one__ if __three__ is `"foo"`, __two__ otherwise.
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ Set `DOCKER_COMPOSER_DISABLE=1` to bypass Docker redirection temporarily.
This plugin redirects Composer scripts, including lifecycle scripts such as
`post-install-cmd` and custom scripts run through `composer run-script`.

It does not transparently replace whole Composer commands such as
`composer install` with `docker compose exec php composer install`. Composer's
plugin command events do not provide a clean way to run a child command, skip the
host command, and return the child exit code without relying on fragile internals.
It also redirects dependency commands before host execution so platform
requirements are resolved from inside the configured service:

- `composer install`
- `composer update`
- `composer require`
- `composer remove`
- `composer reinstall`
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,19 @@
"scripts": {
"style-check": "XDEBUG_MODE=off php-cs-fixer check",
"style-fix": "XDEBUG_MODE=off php-cs-fixer fix",
"stan": "XDEBUG_MODE=off phpstan --memory-limit=1G",
"stan": "XDEBUG_MODE=off phpstan analyse --memory-limit=1G",
"test": "XDEBUG_MODE=coverage phpunit --coverage-text",
"test-integration": "XDEBUG_MODE=off phpunit --testsuite Integration",
"test-unit": "XDEBUG_MODE=coverage phpunit --testsuite Unit --coverage-text"
},
"scripts-descriptions": {
"style-check": "Check coding style using `php-cs-fixer check [options] [--] [<path>...]`",
"style-fix": "Fix coding style using `php-cs-fixer fix [options] [--] [<path>...]`",
"stan": "Perform static analysis using `phpstan analyse [options] [--] [<paths>...]`",
"test": "Run all test suites using `phpunit --coverage-text [options] [<directory|file> ...]`",
"test-integration": "Run Integration test suite using `phpunit --testsuite Integration [options] [<directory|file> ...]`",
"test-unit": "Run Unit test suite using `phpunit --testsuite Unit --coverage-text [options] [<directory|file> ...]`"
},
"extra": {
"class": "empaphy\\docker_composer\\DockerComposerPlugin",
"branch-alias": {
Expand Down
Loading
Loading