Skip to content
7 changes: 1 addition & 6 deletions .dagger/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.4",
"dagger/dagger": "*@dev"
},
"autoload": {
"psr-4": {
"DaggerModule\\": "src/"
}
},
"config": {
"platform": {
"php": "8.3.7"
}
}
}
29 changes: 23 additions & 6 deletions .dagger/src/PhpProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@
#[Doc("PHP Code Quality functions")]
class PhpProject
{
/**
* Create a PHP container using the specified image and variant.
*
* This method constructs a container from the given PHP image name and
* variant. By default, it uses the "php:8.5-cli" image. It does not perform
* any automatic PHP version detection or caching.
*
* @param string $image The base PHP image name (default: "php")
* @param string $variant The PHP image variant tag (default: "8.5-cli")
* @return Container A container based on the specified PHP image
*/
private function php(
string $image = "php",
string $variant = "8.5-cli",
): Container {
Comment thread
aegypius marked this conversation as resolved.
Comment thread
aegypius marked this conversation as resolved.
return dag()
->container()
->from("{$image}:{$variant}")
;
}
Comment thread
aegypius marked this conversation as resolved.

/**
* Allows to install vendors with
*
Expand Down Expand Up @@ -48,9 +69,7 @@ public function checkCodingStandards(
#[DefaultPath("."), Ignore("**/vendor", "docs")]
Directory $source
): Container {
return dag()
->container()
->from("php:8.3-cli")
return $this->php()
->withMountedDirectory("/app", $source)
->withDirectory("/app/vendor", $this->vendors($source))
Comment on lines +72 to 74

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkCodingStandards() now runs on PHP 8.5 via $this->php(), but vendors() still installs dependencies in a separate composer:2 container. Since the root composer.json now requires PHP ^8.5, dependency installation can become non-deterministic (and potentially fail) if the composer:2 image is built on a lower PHP version. Consider aligning dependency installation with the same PHP version (e.g., run Composer inside the PHP 8.5 container or pin to a Composer image/tag that is guaranteed to use PHP 8.5).

Copilot uses AI. Check for mistakes.
->withWorkdir("/app")
Expand All @@ -74,9 +93,7 @@ public function test(
$phpunit[] = "--testsuite={$testSuite}";
}

return dag()
->container()
->from("php:8.3-cli")
return $this->php()
->withMountedDirectory("/app", $source)
->withDirectory("/app/vendor", $this->vendors($source))
->withWorkdir("/app")
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- main
pull_request:
branches: [ "main" ]

jobs:
coding-standards:
Expand Down Expand Up @@ -34,7 +36,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Check for coding-standards
- name: Run tests
uses: dagger/dagger-for-github@8.0.0
with:
version: "latest"
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
}
},
"require": {
"php": "^8.3"
"php": "^8.5"
},
Comment thread
aegypius marked this conversation as resolved.
"require-dev": {
"ext-dom": "*",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^12.1",
"symplify/easy-coding-standard": "^12"
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^2.1.38",
"phpunit/phpunit": "^12.5.8",
"symplify/easy-coding-standard": "^12.6.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"bump-after-update": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
Expand Down