You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: premium-quality rewrite of README, CHANGELOG, and INDEX
README.md:
- Center-aligned hero with 7 badges (PHP, Composer, License, PHPStan,
Tests, KaririCode) and navigation link bar
- Before/after diff block showing the five-to-one dep reduction
- Unified table-based CLI reference with flags and options
- Separated CI examples: unified pipeline + parallel jobs
- Architecture section with component layout, dependency flow diagram,
and key design decisions table linking to ADRs
- Project Stats table includes PHPStan level (0 errors) and test count
- Building kcode.phar section updated for bin/build-phar.php
- KaririCode ecosystem footer with links
CHANGELOG.md:
- Added/Changed/Fixed/Removed structure with precise technical context
- [Unreleased] consolidates all post-v1.0.0 work including type-safety
fixes (35 PHPStan errors → 0), CVE remediation, box removal
- Net-result summary line at end of [Unreleased]
- Comparison URL links in footer
docs/INDEX.md:
- Introductory paragraph placed before tables
- Quick Navigation converted to table format (Document + Description)
- box.json reference removed (builder replaced by bin/build-phar.php)
- code-quality.yml added to Quick Navigation
All notable changes to this project will be documented in this file.
3
+
All notable changes to **KaririCode Devkit** are documented here.
4
4
5
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+
---
7
8
8
9
## [Unreleased]
9
10
10
-
### Fixed
11
+
### Added
11
12
12
-
-**bin/kcode:** Fatal `TypeError` when invoked via Composer scripts — `$argv` was inaccessible inside the static IIFE. Fix passes it as an explicit parameter (`$argv ?? []`).
13
-
-**composer.json:**`phpunit/phpunit` constraint updated from `^11.0` to `^12.0` to match the installed version (12.4.2). Composer scripts renamed to `kcode:*` prefix to avoid collision with built-in Composer commands (e.g. `init`). `allow-plugins.infection/extension-installer: false` added to suppress spurious warnings.
14
-
-**Makefile:**`VERSION` now resolved from `git describe --tags` (falls back to `box.json` metadata). `install`/`install-prod` add `--no-scripts` to prevent broken `kcode init` invocation during dependency installation. New `security` target (`kcode security`). New `_require-kcode` guard on all quality targets. `distclean` no longer removes `composer.lock` (library — not tracked). `check-env` now correctly detects `vendor/bin/kcode`.
15
-
-**phpunit.xml:**`memory_limit` reduced from 1G to 256M (actual usage ≈ 22 MB). Opening tag attributes reformatted one-per-line.
13
+
-**`bin/build-phar.php`:** Native PHP PHAR builder — compiles `kcode.phar` without `humbug/box`. Added as a workaround for a Box 4.x / PHP 8.4 incompatibility (`chdir(): Not a directory` during `endBuffering()`).
14
+
-**Test suite — `tests/Unit/Exception`:**`DevkitExceptionTest`, `ConfigurationExceptionTest`, `ToolExceptionTest`.
15
+
-**Test suite — `tests/Unit/ValueObject`:**`ToolResultTest`, `QualityReportTest`, `MigrationReportTest`.
16
+
-**Test suite — `tests/Unit/Core`:**`ProjectContextTest`, `DevkitConfigTest`.
17
+
-**Full unit test suite:** 41 tests, 81 assertions — all passing on PHP 8.4 / PHPUnit 12.4.5.
16
18
17
19
### Changed
18
20
19
-
-**.github/workflows/ci.yml:** Added `develop` branch to push/PR triggers.
20
-
-**.github/workflows/code-quality.yml:** Replaced 378-line legacy workflow (PHPMD + runtime `composer require` anti-pattern) with 160-line workflow aligned to the kcode CLI. Jobs: `dependencies → security → phpstan → cs-fixer → quality-summary`.
21
-
-**.gitignore:** Expanded from 8 to 42 patterns, covering legacy scaffold files, tool configs outside the toolchain, IDE artefacts, environment files, and OS artefacts.
21
+
-**`composer.json`:**`phpunit/phpunit` constraint updated from `^11.0` to `^12.0`. Composer scripts renamed to `kcode:*` prefix to avoid collision with built-in Composer commands. `infection/extension-installer: false` added to `allow-plugins` to suppress spurious warnings. The `build` script now calls `bin/build-phar.php` instead of `box compile`.
22
+
-**`Makefile`:**`build` target no longer requires `humbug/box` — uses `PHAR_BUILDER := bin/build-phar.php`. `VERSION` simplified to `git describe --tags` only (no `box.json` fallback). `check-env` shows PHAR builder status instead of Box version. `_require-box` guard replaced by `_require-phar-builder`. `install`/`install-prod` add `--no-scripts`. New `security` target. New `_require-kcode` guard on all quality targets. `distclean` no longer removes `composer.lock`. `check-env` correctly detects `vendor/bin/kcode`.
23
+
-**`.github/workflows/ci.yml`:** Added `develop` branch to push/PR triggers.
24
+
-**`.github/workflows/code-quality.yml`:** Replaced 378-line legacy workflow (PHPMD + runtime `composer require`) with a lean 160-line workflow aligned to the kcode CLI. Jobs: `dependencies → security → phpstan → cs-fixer → quality-summary`.
25
+
-**`.gitignore`:** Expanded from 8 to 42 patterns (legacy scaffold files, IDE artefacts, OS artefacts, environment files, tool caches).
26
+
-**`docs/BUILDING.md`:** Fully rewritten for `bin/build-phar.php` — removed all `humbug/box` references.
27
+
-**`phpunit.xml`:**`memory_limit` reduced from 1G to 256M. Attributes reformatted one-per-line.
28
+
29
+
### Fixed
22
30
23
-
### Removed (cleanup)
31
+
-**`bin/kcode`:** Fatal `TypeError` when invoked via Composer scripts — `$argv` was inaccessible inside the static IIFE. Fixed by passing it as an explicit parameter (`$argv ?? []`).
32
+
-**`src/Configuration/PhpStanConfigGenerator`:** Removed `checkMissingIterableValueType` and `checkGenericClassInNonGenericObjectType` — both were removed from PHPStan 2.x core and caused `Invalid configuration` errors.
33
+
-**`src/Configuration/CsFixerConfigGenerator`:** Added `(string)` cast on `preg_replace()` return values in `exportRules()` to satisfy PHPStan level-9 type constraints.
34
+
-**`src/Core/Devkit`:** Added `false` guard on `file_get_contents()` in `appendGitignore()`. Added `@var \SplFileInfo` annotation in `removeRecursive()`.
35
+
-**`src/Core/DevkitConfig`:** Added `@var array<string, mixed>` before assigning loaded overrides. `toolVersions()` now correctly returns `array<string, string>` via `array_filter`.
36
+
-**`src/Core/MigrationDetector`:** Added `false !== $raw` guard on `file_get_contents()`. Added `@var` annotations on `json_decode()` result.
37
+
-**`src/Core/ProjectDetector`:** Added `false !== $raw` guard on `file_get_contents()`. Extracted `$psr4Source`, `$psr4Test`, `$projectName` with proper `is_array()` guards. Fixed `detectNamespace()` and `detectPhpVersion()` with nested `is_array()` / `is_string()` checks.
38
+
-**`src/Runner/*`:** Added `#[\Override]` attribute to `toolName()`, `vendorBin()`, and `defaultArguments()` across all six runners.
39
+
-**`src/ValueObject/MigrationReport`:** Added `false` guard after `file_get_contents()` and `json_encode()`. Extracted `$requireDev` with `@var` and `is_array()` guard. Fixed `removePackagesFromComposer()` to write back the updated `$requireDev` slice into `$composer` before `json_encode()`. Added `@var \SplFileInfo` in `removeRecursive()`.
40
+
-**Security:**`phpunit/phpunit` updated from 12.4.2 → 12.4.5 (fixes CVE-2026-24765, HIGH).
-**Migration detector:** Scans `composer.json` require-dev and project root for redundant dependencies, config files, and cache paths. Interactive cleanup with `--dry-run` and `--no-interaction` modes.
47
-
-**CLI framework:** Zero-dependency `Application` router with ANSI output, argument parsing, and passthrough.
48
-
-**Value objects:**`ToolResult` and `QualityReport` (immutable, readonly).
61
+
-**Migration detector:** Scans `composer.json` require-dev and project root for redundant files and cache paths. Interactive cleanup with `--dry-run` and `--no-interaction`.
62
+
-**CLI framework:** Zero-dependency `Application` router with ANSI output, argument parsing, and passthrough support.
0 commit comments