Download the PHP package tumblr/chorus-timekeeper without Composer
On this page you can find all versions of the php package tumblr/chorus-timekeeper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tumblr/chorus-timekeeper
More information about tumblr/chorus-timekeeper
Files in tumblr/chorus-timekeeper
Package chorus-timekeeper
Short Description A super simple class for DI with timekeeping
License GPL-2.0-or-later
Informations about the package chorus-timekeeper
Chorus TimeKeeper
The Chorus TimeKeeper is an elegant utility for Dependency Injection (DI) with timekeeping. At its core, it offers a straightforward approach to time management in applications, allowing for consistent time retrieval and even time manipulation for testing purposes. This can be exceptionally helpful when writing tests or simulating various time conditions in your code.
It provides two primary components:
TimeKeeper
: Fetches real-time data.FakeTimeKeeper
: Helps in mocking or manipulating time during testing.
For example, when testing time-sensitive components, you can utilize FakeTimeKeeper
to preset time scenarios, avoiding the hassle of waiting in real-time or simulating date changes on your system.
Requirements
- PHP ^7.4 or ^8.0
Installation
You can install the package via Composer:
Basic Usage
Development Workflow
The project has a Makefile to simplify development processes. You can use various make commands to run tests, validate code standards, and more. Here's a quick overview:
1. Prerequisites Setup
Ensure your environment is set up correctly:
-
Install required packages:
- Report PHP location:
2. Testing
Run all tests:
Run only PHPUnit tests:
Generate PHPUnit test coverage:
3. Static Analysis
Use psalm for static analysis:
4. Code Standards
Fix coding standards using PHP CS Fixer:
5. Mutation Testing
Run mutation tests to ensure code quality:
6. Composer
Validate composer files:
7. YAML Linting
Lint YAML files to ensure correctness:
Contributing
If you wish to contribute to the Chorus TimeKeeper, please follow these steps:
- Raise an Issue: Before making any changes, create an issue describing your idea or the desired change.
- Submit a PR: Once your idea is approved, create a Pull Request. Make sure to include or update unit tests.
- Testing & Code Style: Ensure all tests pass (
make test
) and fix any code style issues (make cs
). - Describe Your Changes: Clearly describe what you've changed and include testing instructions.
- Breaking Changes Alert: If your contribution introduces breaking changes, please highlight them. Any modification that disrupts the current workflow, like changing a namespace or functionality, is a breaking change.
Remember, if you're planning a significant refactor or introducing breaking changes, your PR might not be approved.
Once your PR is approved, it will be merged, and a new version will be released.
License
This project is licensed under the GNU General Public License v2.0.