|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to `initphp/config` are documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [2.0.0] |
| 9 | + |
| 10 | +A correctness and modernisation release. It contains intentional |
| 11 | +backward-incompatible changes; review the **Changed** and **Removed** |
| 12 | +sections before upgrading from 1.x. |
| 13 | + |
| 14 | +### Added |
| 15 | + |
| 16 | +- `InitPHP\Config\AbstractConfig` — shared base implementing the common |
| 17 | + read/write contract for both `Library` and `Classes`. |
| 18 | +- `InitPHP\Config\Exceptions\ConfigException` — a dedicated |
| 19 | + `RuntimeException` with named constructors, thrown by every loader on |
| 20 | + failure (previously a generic `\Exception` was used). |
| 21 | +- `Library::replace()` — discard the whole tree and install a new one. |
| 22 | +- `Library::remove()` and `Config::remove()` — removal is now reachable |
| 23 | + from every entry point (it previously existed only on `Classes`). |
| 24 | +- `Config::reset()` — discard the shared facade instance (chiefly for |
| 25 | + test isolation). |
| 26 | +- Full test suite (PHPUnit), static analysis (PHPStan level 8), coding |
| 27 | + standard (PHP-CS-Fixer), and a GitHub Actions CI pipeline. |
| 28 | +- Developer documentation under `docs/`. |
| 29 | + |
| 30 | +### Changed |
| 31 | + |
| 32 | +- **Requires PHP 8.1+** (was 7.4+). |
| 33 | +- **Requires `initphp/parameterbag` `^2.0`** (was `^1.0`). The package now |
| 34 | + explicitly opts into case-insensitive keys so the documented behaviour |
| 35 | + is preserved against ParameterBag v2's case-sensitive default. |
| 36 | +- `setClass()` now imports an **object's runtime property values** when |
| 37 | + given an instance (it previously imported class defaults in both |
| 38 | + cases). |
| 39 | +- `setArray()` / `setFile()` with a `null`/empty name now **merge into the |
| 40 | + root** instead of replacing the entire tree. Use `Library::replace()` |
| 41 | + for the old replace-all behaviour. |
| 42 | +- `Library::close()` now resets to a usable empty bag (dotted-path and |
| 43 | + case-insensitive options preserved) instead of leaving the instance in |
| 44 | + an unusable state. |
| 45 | + |
| 46 | +### Fixed |
| 47 | + |
| 48 | +- `setDir()` applied its name prefix with inverted logic, so files were |
| 49 | + loaded under the wrong keys (e.g. `setDir('app', …)` did not produce |
| 50 | + `app.*` keys). The prefix is now applied correctly. |
| 51 | +- Object-style access (`$library->db`) silently collapsed every array |
| 52 | + element onto a single property, returning only the last value. It now |
| 53 | + builds a correct, recursively nested `stdClass`. |
| 54 | +- The `Config` facade tied the shared singleton's lifetime to instance |
| 55 | + destruction, which could leave it in a fatal, unusable state. The |
| 56 | + facade is now a pure static utility with explicit `reset()`. |
| 57 | + |
| 58 | +### Removed |
| 59 | + |
| 60 | +- The `Config` facade's instance API (`__construct`, `__destruct`, |
| 61 | + `__get`, `__call`, `__debugInfo`). The facade is now static-only and |
| 62 | + cannot be instantiated. |
| 63 | +- `Library::set(null, …)` as a replace-all shortcut — use |
| 64 | + `Library::replace()`. |
| 65 | + |
| 66 | +## [1.0] |
| 67 | + |
| 68 | +- Initial release. |
0 commit comments