From c481ac023ab5018b3b6b82b1f187375c6fc194cb Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Mon, 13 Jul 2026 15:01:30 +0200 Subject: [PATCH 1/2] Fix phpstan 2.2.3 alreadyNarrowedType error in magento2 recipe The @phpstan-param docblock narrowed $area to 'frontend'|'backend', making the runtime in_array() guard always true according to phpstan 2.2.3. The runtime check is intentional since callers can pass any string, so drop the docblock narrowing instead of the check. --- recipe/magento2.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipe/magento2.php b/recipe/magento2.php index c533944ea..12d612657 100644 --- a/recipe/magento2.php +++ b/recipe/magento2.php @@ -249,8 +249,6 @@ }); /** - * @phpstan-param 'frontend'|'backend' $area - * * @throws ConfigurationException */ function magentoDeployAssetsSplit(string $area): void From 54043926cc9c087d705666b73175c464b677a88a Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Mon, 13 Jul 2026 15:07:50 +0200 Subject: [PATCH 2/2] Regenerate magento2 recipe docs --- docs/recipe/magento2.md | 72 ++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/recipe/magento2.md b/docs/recipe/magento2.md index 60cf1619d..98176c9d3 100644 --- a/docs/recipe/magento2.md +++ b/docs/recipe/magento2.md @@ -393,7 +393,7 @@ true ### artifact_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L424) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L422) Artifact deployment section The file the artifact is saved to @@ -404,7 +404,7 @@ The file the artifact is saved to ### artifact_dir -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L427) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L425) The directory the artifact is saved in @@ -414,7 +414,7 @@ The directory the artifact is saved in ### artifact_excludes_file -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L431) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L429) Points to a file with a list of files to exclude from packaging. The format is as with the `tar --exclude-from=[file]` option @@ -425,7 +425,7 @@ The format is as with the `tar --exclude-from=[file]` option ### build_from_repo -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L434) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L432) If set to true, the artifact is built from a clean copy of the project repository instead of the current working directory @@ -435,7 +435,7 @@ false ### repository -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L437) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L435) Overrides [repository](/docs/recipe/common.md#repository) from `recipe/common.php`. @@ -447,7 +447,7 @@ null ### artifact_path -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L440) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L438) The relative path to the artifact file. If the directory does not exist, it will be created @@ -460,7 +460,7 @@ return get('artifact_dir') . '/' . get('artifact_file'); ### bin/tar -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L448) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L446) The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings :::info Autogenerated @@ -471,14 +471,14 @@ The value of this configuration is autogenerated on access. ### additional_shared_files -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L520) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L518) Array of shared files that will be added to the default shared_files without overriding ### additional_shared_dirs -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L522) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L520) Array of shared directories that will be added to the default shared_dirs without overriding @@ -544,7 +544,7 @@ Deploys assets for frontend only. ### magento\:sync\:content_version {#magento-sync-content_version} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L310) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L308) Syncs content version. @@ -552,7 +552,7 @@ Syncs content version. ### magento\:maintenance\:enable {#magento-maintenance-enable} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L320) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L318) Enables maintenance mode. @@ -560,7 +560,7 @@ Enables maintenance mode. ### magento\:maintenance\:disable {#magento-maintenance-disable} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L326) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L324) Disables maintenance mode. @@ -568,7 +568,7 @@ Disables maintenance mode. ### magento\:maintenance\:enable-if-needed {#magento-maintenance-enable-if-needed} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L332) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L330) Set maintenance mode if needed. @@ -576,7 +576,7 @@ Set maintenance mode if needed. ### magento\:config\:import {#magento-config-import} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L339) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L337) Config Import. @@ -584,7 +584,7 @@ Config Import. ### magento\:config\:import\:on-current {#magento-config-import-on-current} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L348) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L346) Config Import on current release. @@ -592,7 +592,7 @@ Config Import on current release. ### magento\:upgrade\:db {#magento-upgrade-db} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L362) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L360) Upgrades magento database. @@ -600,7 +600,7 @@ Upgrades magento database. ### magento\:upgrade {#magento-upgrade} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L374) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L372) Run upgrades if needed. @@ -608,7 +608,7 @@ Run upgrades if needed. ### magento\:cache\:flush {#magento-cache-flush} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L383) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L381) Flushes Magento Cache. @@ -616,7 +616,7 @@ Flushes Magento Cache. ### deploy\:magento {#deploy-magento} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L388) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L386) Magento2 deployment operations. @@ -632,7 +632,7 @@ This task is group task which contains next tasks: ### magento\:build {#magento-build} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L397) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L395) Magento2 build operations. @@ -645,7 +645,7 @@ This task is group task which contains next tasks: ### deploy {#deploy} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L403) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L401) Deploys your project. @@ -661,7 +661,7 @@ This task is group task which contains next tasks: ### deploy\:magento\:failed {#deploy-magento-failed} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L416) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L414) Run Magento post-deployment failure tasks. @@ -674,7 +674,7 @@ This task is group task which contains next tasks: ### artifact\:package {#artifact-package} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L459) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L457) Packages all relevant files in an artifact. @@ -682,7 +682,7 @@ tasks section ### artifact\:upload {#artifact-upload} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L469) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L467) Uploads artifact in release folder for extraction. @@ -690,7 +690,7 @@ Uploads artifact in release folder for extraction. ### artifact\:extract {#artifact-extract} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L474) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L472) Extracts artifact in release path. @@ -698,7 +698,7 @@ Extracts artifact in release path. ### build\:remove-generated {#build-remove-generated} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L480) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L478) Clears generated files prior to building. @@ -706,7 +706,7 @@ Clears generated files prior to building. ### build\:prepare {#build-prepare} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L485) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L483) Prepare local artifact build. @@ -714,7 +714,7 @@ Prepare local artifact build. ### artifact\:build {#artifact-build} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L510) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L508) Builds an artifact. @@ -731,7 +731,7 @@ This task is group task which contains next tasks: ### deploy\:additional-shared {#deploy-additional-shared} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L526) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L524) Adds additional files and dirs to the list of shared files and dirs. @@ -739,7 +739,7 @@ Adds additional files and dirs to the list of shared files and dirs. ### magento\:set_cache_prefix {#magento-set_cache_prefix} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L541) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L539) Update cache id_prefix. @@ -753,7 +753,7 @@ after('deploy:magento', 'magento:cleanup_cache_prefix'); ### magento\:cleanup_cache_prefix {#magento-cleanup_cache_prefix} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L581) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L579) Cleanup cache id_prefix env files. @@ -761,7 +761,7 @@ After successful deployment, move the tmp_env.php file to env.php ready for next ### magento\:cron\:stop {#magento-cron-stop} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L597) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L595) Remove cron from crontab and kill running cron jobs. @@ -773,7 +773,7 @@ To use this feature, add the following to your deployer scripts: ### magento\:cron\:install {#magento-cron-install} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L613) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L611) Install cron in crontab. @@ -785,7 +785,7 @@ To use this feature, add the following to your deployer scripts: ### artifact\:prepare {#artifact-prepare} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L619) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L617) Prepares an artifact on the target server. @@ -805,7 +805,7 @@ This task is group task which contains next tasks: ### artifact\:finish {#artifact-finish} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L632) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L630) Executes the tasks after artifact is released. @@ -821,7 +821,7 @@ This task is group task which contains next tasks: ### artifact\:deploy {#artifact-deploy} -[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L641) +[Source](https://github.com/deployphp/deployer/blob/master/recipe/magento2.php#L639) Actually releases the artifact deployment.