Skip to content

feat!: ban CarbonImmutable via PHPStan#80

Open
spawnia wants to merge 4 commits intomasterfrom
ban-carbon-immutable
Open

feat!: ban CarbonImmutable via PHPStan#80
spawnia wants to merge 4 commits intomasterfrom
ban-carbon-immutable

Conversation

@spawnia
Copy link
Member

@spawnia spawnia commented Mar 11, 2026

Summary

  • Ban CarbonImmutable class usage via disallowedClasses in rules.neon
  • Consuming projects pick up the rule automatically via PHPStan extension installer

Our codebase is heavily biased towards mutable Carbon.
Mixing mutable and immutable semantics makes it hard to reason about code.

https://gitlab.mll/documentation/coding-guidelines/-/issues/313

Breaking change

Requires spaze/phpstan-disallowed-calls ^4.4 (dropped ^2).
All our projects already require ^4.4, so no migration needed.

Test plan

  • vendor/bin/phpstan analyse passes

spawnia and others added 2 commits March 11, 2026 10:58
Our codebase is heavily biased towards mutable Carbon.
Mixing mutable and immutable semantics makes it hard to reason about code.

https://gitlab.mll/documentation/coding-guidelines/-/issues/313

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `disallowedClasses` rule for `Carbon\CarbonImmutable`.

BREAKING CHANGE: Requires `spaze/phpstan-disallowed-calls` ^4.4 (dropped ^2).
The `rules.neon` is only loaded on PHP 8.0+ anyway, where ^4.4 applies.

https://gitlab.mll/documentation/coding-guidelines/-/issues/313

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@spawnia spawnia changed the title Ban CarbonImmutable via PHPStan feat!: ban CarbonImmutable via PHPStan Mar 11, 2026
spawnia and others added 2 commits March 11, 2026 11:48
spaze/phpstan-disallowed-calls ^4.4 requires phpstan ^1.12.6,
which conflicts with larastan 1.0.4 (phpstan <1.9) on PHP 8.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
spaze/phpstan-disallowed-calls ^4.4 requires phpstan ^1.12.6,
which conflicts with larastan 1.0.4 (phpstan <1.9) on PHP 8.0.

Include rules.neon based on whether spaze is installed rather than
checking the PHP version, so it works regardless of which PHP versions
have spaze removed in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
simbig added a commit that referenced this pull request Mar 11, 2026
- Extract actual flowcell ID using nemo's regex (000000000-AGKG7 → AGKG7)
- Normalize backslashes so basename() works with Windows paths on Linux
- Support 6-digit dates (ymd format, e.g. 151231) alongside 8-digit (Ymd)
- Use Carbon instead of CarbonImmutable (aligns with #80)
- Remove unused toString() and rawFlowcellSegment (YAGNI)
- Add comprehensive test coverage for all Illumina run folder formats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant