diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..779f99a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes index 04c6eb9..8ddbd04 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,25 @@ -# Keep packaged tarballs (Packagist downloads) small by stripping dev-only files -/.github export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore -/.php-cs-fixer.php export-ignore -/.phpstan.dist.neon export-ignore -/.rector.php export-ignore +# Keep Packagist/Composer downloads small: strip every file a consumer of the +# package never runs. `git archive` (which is what GitHub and Packagist serve) +# ignores a path that does not exist, so one canonical list works for every +# module and library. +/.claude export-ignore +/.editorconfig export-ignore +/.gitattributes export-ignore +/.github export-ignore +/.gitignore export-ignore +/.idea export-ignore +/.junie export-ignore +/.mcp.json export-ignore +/.php-cs-fixer.php export-ignore +/.phpstan.dist.baseline.neon export-ignore +/.phpstan.dist.neon export-ignore +/AGENTS.md export-ignore +/CLAUDE.md export-ignore +/composer.lock export-ignore +/phpstan-baseline.neon export-ignore +/phpunit.xml export-ignore +/rector.php export-ignore +/tests export-ignore # Enforce LF line endings on checkout so the line-endings CI gate never fails *.css text eol=lf diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 11287a7..c37387c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: - uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 with: - php-version: '8.3' + php-version: '8.5' - name: Install dependencies run: composer install --no-interaction --no-progress @@ -24,4 +24,4 @@ jobs: run: php vendor/bin/php-cs-fixer fix --diff --dry-run - name: Rector - run: php vendor/bin/rector -c .rector.php --dry-run + run: php vendor/bin/rector --dry-run diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 7190103..25b276a 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - php-version: ['8.3', '8.4', '8.5'] + php-version: ['8.5', '8.6'] name: PHPStan (PHP ${{ matrix.php-version }}) diff --git a/.github/workflows/syntax-php.yml b/.github/workflows/syntax-php.yml index 0010e57..eea74bb 100644 --- a/.github/workflows/syntax-php.yml +++ b/.github/workflows/syntax-php.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.3', '8.4', '8.5'] + php-version: ['8.5', '8.6'] name: PHP Syntax (PHP ${{ matrix.php-version }}) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 53d5172..70dfa83 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -34,7 +34,8 @@ __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. + // glob skips dotfiles, so .php-cs-fixer.php is left out; rector.php is + // a plain name now, so it is formatted like any other file. ->append(glob(__DIR__ . '/*.php') ?: []) ->name('*.php') ->ignoreDotFiles(true) diff --git a/composer.json b/composer.json index 748f386..a266283 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "license": "OSL-3.0", "type": "maho-module", "require": { - "php": ">=8.3" + "php": ">=8.5" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", @@ -20,7 +20,7 @@ "mahocommerce/maho-composer-plugin": true }, "platform": { - "php": "8.3" + "php": "8.5" } } } diff --git a/.rector.php b/rector.php similarity index 90% rename from .rector.php rename to rector.php index 02c776c..8b848cb 100644 --- a/.rector.php +++ b/rector.php @@ -40,9 +40,10 @@ function gitUntrackedPaths(): array __DIR__ . '/lib', __DIR__ . '/public', __DIR__ . '/src', - ], 'is_dir'), + ], 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 skips dotfiles, so .php-cs-fixer.php is left out; rector.php is + // a plain name now, so this config lints itself. glob(__DIR__ . '/*.php') ?: [], ))) // No argument: Rector reads the target PHP version from composer.json @@ -55,10 +56,10 @@ function gitUntrackedPaths(): array // package: // // - AddTypeToConst emits `const string FOO`. That is new syntax, not a - // rewrite, so a repo that declares no require.php floor (such as - // maho-composer-plugin) would ship code its own metadata never promised. - // A composer plugin also runs on the user's PHP, not on the platform the - // project resolved against. + // rewrite: it adds nothing the code needs, and it turns a floor bump into + // a hard parse error for anyone who installs with platform requirements + // ignored. A composer plugin also runs on the user's PHP, not on the + // platform the project resolved against. // - ReadOnlyClass / ReadOnlyProperty change the contract, not the code: a // readonly class cannot be extended by a normal child, and a readonly // property cannot be written from one. Maho modules exist to be extended.