All significant changes to this project will be documented in this file.
- Added optional
$cast parameter to globalenv()helper to enable typed casting viaEnv::getCast()`.
- Bumped
codemonster-ru/httpto^2.0. - Bumped
codemonster-ru/sessionto^2.0.
- Guarded database helpers against redeclaration.
json()helper now uses the container response instance for consistency.- Added explicit return types to
abort()anddump()helpers. - Bumped
codemonster-ru/databaseto^2.0. - Session helper now distinguishes between "get" and "set" by argument count.
dd()now exits with status code 0.- Updated package metadata to reflect Annabel usage.
- Cleaned up changelog encoding artifacts and restored ASCII formatting.
- Suppressed debug output in
DumpHelperTest. - Added test coverage for null session values and empty/zero request inputs.
- Global database helpers integrating the
codemonster-ru/databasepackage:db()- returns the active database connectionschema()- returns schema builder for the selected connectiontransaction()- executes callbacks inside a DB transaction
- Full PHPUnit test coverage for:
db()helperschema()helper- With isolated
DatabaseManagerand fake container bindings
- Support for SQLite, MySQL and future drivers automatically via
ConnectionInterface::schema().
SupportFakeContainerupdated for correct behavior with database helpers:singleton()is now eager, ensuring immediate instance creation- Improved compatibility with Annabel-style lazy container contracts
- Fully stable integration with request/view/db helpers
- Strengthened test isolation:
reset()now clears both bindings and instances- All tests run without requiring the Annabel framework
schema()test failing due to instantiation of an abstract Grammar class. Now resolved automatically by the database package selecting proper driver grammar.- DB helper now correctly bootstraps connection configuration even without other framework components.
- Added unit tests for the global
db()helper, including verification of passing a connection name and returning aConnectioninstance. - Added the
FakeConnectionandFakeDatabaseManagerclasses to tests to isolate behavior and enable stable testing without a real database. - Added the
reset()method toSupportFakeContainerto clean up the container between tests. - Improved testing infrastructure: tests are now fully isolated and independent of the Annabel framework.
- New
abort()helper for throwing HTTP-like exceptions with a status code. - Introduced
HttpStatusExceptionInterfaceextendingThrowablefor consistent type support. - Added test coverage for
abort()including status code and message handling.
- Documentation: added
abort()to the list of provided helpers.
- Global helper functions for the entire Codemonster PHP ecosystem:
config()- access or modify configuration valuesenv()- read environment variablesdump(),dd()- elegant variable dumpingrequest()- get current HTTP request or inputresponse(),json()- send structured responsesrouter()/route()- define and access routessession()- read or write session dataview()/render()- render templates and return responses
- Seamless integration with the Annabel framework via
app()container - Standalone compatibility when Annabel is not installed
- Full PHPUnit test coverage for all helpers (18 tests / 25 assertions)
- Support for PHP 8.2 - 8.4 and PHPUnit 9-12