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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to `ichava/icon-sets-flag` follow [Keep a Changelog](https:/

### Changed

- **PHPStan analyses at level `max`, up from 0.** `phpstan.neon.dist` now has icon-sets-bundled's shape: one counted, path-scoped ignore for the two `HasIconSetVariants` hooks PHPStan reports as unused because the trait calls them through `static::`, with `reportUnmatchedIgnoredErrors` failing the run if either stops occurring. No baseline, and no source change was needed. `PhpstanLevelTest` reads the config and fails if the level is anything but `max` or a baseline appears.
- **`sync-upstream.yml` commits as the github-actions bot's noreply address** instead of a personal GitHub login, matching packs scaffolded since icon-sets-package-scaffolder#60 and icon-sets-sync's default. The personal-contact guard now also reads `.github/` and `.dev/`.
- **The package author is Simtabi LLC, not a person.** `composer.json` named a personal maintainer and mailbox as author; it now names `Simtabi LLC` with the role address `ichava@simtabi.com` (no personal contact is published, decided 2026-10-28). `NoPersonalContactTest` reads `composer.json`, `README.md`, `LICENSE`, `docs/` and `src/`, fails on a personal name or address, and fails when it reads fewer files than it did when written.
- **`sync-upstream.yml`'s header describes what the workflow runs.** It said the image bundles Python and that a release ships to Packagist. The image is icon-sets-sync's Go binary with git, gh and Node, built from the toolkit's `main`, and a release is the GitHub release that release-please and `release.yml` make; nothing is published to Packagist. Comments only: the workflow runs the same steps.
Expand Down
13 changes: 12 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
parameters:
level: 0
level: max
paths:
- src
tmpDir: .phpstan.cache
treatPhpDocTypesAsCertain: false
ignoreErrors:
# Variant implements HasIconSetVariants' two abstract hooks, which the trait
# calls through static::. PHPStan does not follow that call and reports both
# as unused. Pint's protected_to_private fixer makes them private in a final
# enum, so they cannot be protected either. Two errors, measured 2026-10-30;
# reportUnmatched fails the run if either stops occurring.
-
identifier: method.unused
path: src/Enums/Variant.php
count: 2
reportUnmatchedIgnoredErrors: true
39 changes: 39 additions & 0 deletions tests/Unit/PhpstanLevelTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

/*
|--------------------------------------------------------------------------
| PHPStan runs at level max, with no baseline
|--------------------------------------------------------------------------
|
| The level is the gate's whole strength, and lowering it is a one-line edit
| that turns nothing red: the analysis simply passes at the weaker level. So
| the configured level is pinned here, read from phpstan.neon.dist itself, and
| so is the absence of a baseline, which would hide errors the same way.
|
| Pest functions only: a PHPUnit class in the same file would stop being
| collected.
|
*/

it('configures PHPStan at level max', function (): void {
$path = dirname(__DIR__, 2) . '/phpstan.neon.dist';
$this->assertFileExists($path);

$count = preg_match_all('/^\s*level:\s*(\S+)\s*$/m', (string) file_get_contents($path), $matches);

$this->assertSame(1, $count, 'phpstan.neon.dist must set exactly one level.');
$this->assertSame('max', $matches[1][0], 'phpstan.neon.dist must analyse at level max.');
});

it('analyses without a baseline', function (): void {
$root = dirname(__DIR__, 2);

$this->assertFileDoesNotExist($root . '/phpstan-baseline.neon');
$this->assertStringNotContainsString(
'baseline',
(string) file_get_contents($root . '/phpstan.neon.dist'),
'phpstan.neon.dist must not include a baseline.',
);
});
Loading