From 26cae491fbe5ad28a07ef63785eacccd4230634c Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:25:15 +0000 Subject: [PATCH 1/8] chore: sync .github/dependabot.yml from infrastructure --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ace460..4aaf59d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,7 @@ updates: directory: "/" schedule: interval: "weekly" + groups: + all-dependencies: + patterns: + - "*" From 97b31995c5534d90c595154b5e2458034186d7c8 Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:25:16 +0000 Subject: [PATCH 2/8] chore: sync composer.json from infrastructure --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 7704e4a..54c125e 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,9 @@ "config": { "allow-plugins": { "mahocommerce/maho-composer-plugin": true + }, + "platform": { + "php": "8.3" } } } From 59ecf991114d6deee11e0d5fb30add1eafb353a1 Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:25:18 +0000 Subject: [PATCH 3/8] chore: sync .github/workflows/lint.yml from infrastructure --- .github/workflows/lint.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..43b27b3 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: Lint + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + + - name: Install dependencies + run: composer install --no-interaction --no-progress + + - name: PHP CS Fixer + run: php vendor/bin/php-cs-fixer fix --diff --dry-run + + - name: Rector + run: php vendor/bin/rector -c .rector.php --dry-run From 6bf826b9e12ea5428b96e26baf834937c142c946 Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:25:18 +0000 Subject: [PATCH 4/8] chore: remove .github/workflows/php-cs-fixer.yml (superseded) from infrastructure --- .github/workflows/php-cs-fixer.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/php-cs-fixer.yml diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml deleted file mode 100644 index 6db3755..0000000 --- a/.github/workflows/php-cs-fixer.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: PHP CS Fixer - -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - -jobs: - php-cs-fixer: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - name: Install dependencies - run: composer install --no-interaction --no-progress - - - name: Run PHP CS Fixer - run: php vendor/bin/php-cs-fixer fix --diff --dry-run From 82cf991cd2bccd60301ae6225675b53775fbd99c Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:25:19 +0000 Subject: [PATCH 5/8] chore: remove .github/workflows/rector.yml (superseded) from infrastructure --- .github/workflows/rector.yml | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/workflows/rector.yml diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml deleted file mode 100644 index c4b73ba..0000000 --- a/.github/workflows/rector.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Rector - -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - -jobs: - rector: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - name: Install dependencies - run: composer install --no-interaction --no-progress - - - name: Run Rector - run: php vendor/bin/rector -c .rector.php --dry-run From 2fb7ad51cb773d2e124cf294ddc1447dc1ffb956 Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:47:22 +0000 Subject: [PATCH 6/8] chore: sync .github/workflows/lint.yml from infrastructure --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 43b27b3..d47bbaa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 with: php-version: '8.3' From f41a5485f61c4360f0dd3c4ccca8570e60208982 Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:47:23 +0000 Subject: [PATCH 7/8] chore: sync .php-cs-fixer.php from infrastructure --- .php-cs-fixer.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 2ba78cb..53d5172 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -1,16 +1,21 @@ setRiskyAllowed(true) ->setParallelConfig(new PhpCsFixer\Runner\Parallel\ParallelConfig()) ->setRules([ + // see https://cs.symfony.com/doc/ruleSets/PER-CS2.0.html '@PER-CS2.0' => true, + // RISKY: Use && and || logical operators instead of and and or. 'logical_operators' => true, + // RISKY: Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator. 'modernize_types_casting' => true, + // PHP84: Adds or removes ? before single type declarations or |null at the end of union types when parameters have a default null value. 'nullable_type_declaration_for_default_null_value' => true, + // Convert double quotes to single quotes for simple strings. 'single_quote' => true, + // PHPdoc stuff 'phpdoc_indent' => true, 'phpdoc_param_order' => true, 'phpdoc_single_line_var_spacing' => true, @@ -19,8 +24,19 @@ ]) ->setFinder( PhpCsFixer\Finder::create() - ->in([__DIR__ . '/app']) - ->name(['*.php']) + // Same canonical list as the maho repo; only the dirs that exist in + // this repo are scanned, so the one config works for app-only modules. + ->in(array_values(array_filter([ + __DIR__ . '/app', + __DIR__ . '/lib', + __DIR__ . '/public', + __DIR__ . '/tests', + __DIR__ . '/src', + ], 'is_dir'))) + // Root-level entry points (e.g. the infra tool's sync.php / config.php). + // glob skips dotfiles, so these very config files aren't included. + ->append(glob(__DIR__ . '/*.php') ?: []) + ->name('*.php') ->ignoreDotFiles(true) ->ignoreVCS(true) ); From 93c97c21b98fc0915ee8ef845f9714362ccf218e Mon Sep 17 00:00:00 2001 From: "maho-organization-controller[bot]" <289500297+maho-organization-controller[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:47:24 +0000 Subject: [PATCH 8/8] chore: sync .rector.php from infrastructure --- .rector.php | 99 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 42 deletions(-) diff --git a/.rector.php b/.rector.php index 0bed012..62e9abf 100644 --- a/.rector.php +++ b/.rector.php @@ -2,50 +2,65 @@ declare(strict_types=1); -use Rector\CodeQuality\Rector\BooleanNot\ReplaceMultipleBooleanNotRector; -use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector; -use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector; -use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector; -use Rector\CodeQuality\Rector\Identical\SimplifyArraySearchRector; -use Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector; -use Rector\CodeQuality\Rector\Identical\StrlenZeroToIdenticalEmptyStringRector; -use Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector; -use Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector; -use Rector\CodeQuality\Rector\Ternary\SimplifyTautologyTernaryRector; -use Rector\CodeQuality\Rector\Ternary\SwitchNegatedTernaryRector; -use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; +use Rector\CodeQuality\Rector as CodeQuality; +use Rector\CodingStyle\Rector as CodingStyle; use Rector\Config\RectorConfig; -use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector; -use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; -use Rector\DeadCode\Rector\MethodCall\RemoveNullArgOnNullDefaultParamRector; -use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; -use Rector\EarlyReturn\Rector\If_\ChangeNestedIfsToEarlyReturnRector; -use Rector\EarlyReturn\Rector\If_\RemoveAlwaysElseRector; -use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector; -use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector; +use Rector\DeadCode\Rector as DeadCode; +use Rector\EarlyReturn\Rector as EarlyReturn; +use Rector\TypeDeclaration\Rector as TypeDeclaration; +// Shared by every repo that consumes the org baseline. Only standard Rector +// rules, so it needs no extra dependency: maho's own .rector.php (with the +// Maho\Rector\* rules and the Varien->Maho migration) stays in maho and is not +// synced. Only the paths that exist in a given repo are scanned, so the one +// config works for app-only modules and the infra tool's src/ alike. return RectorConfig::configure() - ->withPaths([__DIR__ . '/app']) - ->withPhpSets(php83: true) + ->withPaths(array_values(array_merge( + array_filter([ + __DIR__ . '/app', + __DIR__ . '/lib', + __DIR__ . '/public', + __DIR__ . '/src', + ], 'is_dir'), + // Root-level entry points (e.g. the infra tool's sync.php / config.php). + // glob skips dotfiles, so this very config file isn't included. + glob(__DIR__ . '/*.php') ?: [], + ))) + // No argument: Rector reads the target PHP version from composer.json + // (require.php's floor, else config.platform.php), kept at 8.3 by the sync. + ->withPhpSets() ->withRules([ - ReplaceMultipleBooleanNotRector::class, - UnusedForeachValueToArrayKeysRector::class, - ChangeArrayPushToArrayAssignRector::class, - CompactToVariablesRector::class, - SimplifyArraySearchRector::class, - SimplifyConditionsRector::class, - StrlenZeroToIdenticalEmptyStringRector::class, - CommonNotEqualRector::class, - LogicalToBooleanRector::class, - SimplifyTautologyTernaryRector::class, - SwitchNegatedTernaryRector::class, - MakeInheritedMethodVisibilitySameAsParentRector::class, - RemoveUselessParamTagRector::class, - RemoveUselessReturnTagRector::class, - RemoveNullArgOnNullDefaultParamRector::class, - RemoveUselessVarTagRector::class, - ChangeNestedIfsToEarlyReturnRector::class, - RemoveAlwaysElseRector::class, - AddOverrideAttributeToOverriddenMethodsRector::class, - DeclareStrictTypesRector::class, + CodeQuality\BooleanNot\ReplaceMultipleBooleanNotRector::class, + CodeQuality\Foreach_\UnusedForeachValueToArrayKeysRector::class, + CodeQuality\FuncCall\ChangeArrayPushToArrayAssignRector::class, + CodeQuality\FuncCall\CompactToVariablesRector::class, + CodeQuality\Identical\SimplifyArraySearchRector::class, + CodeQuality\Identical\SimplifyConditionsRector::class, + CodeQuality\Identical\StrlenZeroToIdenticalEmptyStringRector::class, + CodeQuality\LogicalAnd\LogicalToBooleanRector::class, + CodeQuality\NotEqual\CommonNotEqualRector::class, + CodeQuality\Ternary\SimplifyTautologyTernaryRector::class, + CodeQuality\Ternary\SwitchNegatedTernaryRector::class, + CodingStyle\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector::class, + DeadCode\ClassMethod\RemoveUselessParamTagRector::class, + DeadCode\ClassMethod\RemoveUselessReturnTagRector::class, + DeadCode\MethodCall\RemoveNullArgOnNullDefaultParamRector::class, + DeadCode\Property\RemoveUselessVarTagRector::class, + EarlyReturn\If_\ChangeNestedIfsToEarlyReturnRector::class, + EarlyReturn\If_\RemoveAlwaysElseRector::class, + Rector\CodingStyle\Rector\FuncCall\ConsistentImplodeRector::class, + Rector\Php71\Rector\List_\ListToArrayDestructRector::class, + Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, + Rector\Php80\Rector\Class_\StringableForToStringRector::class, + Rector\Php80\Rector\ClassConstFetch\ClassOnThisVariableObjectRector::class, + Rector\Php80\Rector\FuncCall\ClassOnObjectRector::class, + Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector::class, + Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector::class, + TypeDeclaration\ClassMethod\ReturnNeverTypeRector::class, + TypeDeclaration\StmtsAwareInterface\SafeDeclareStrictTypesRector::class, + ]) + ->withConfiguredRule(Rector\Php82\Rector\Param\AddSensitiveParameterAttributeRector::class, [ + 'sensitive_parameters' => [ + 'token', 'apiKey', 'email', 'useremail', 'username', 'password', + ], ]);