Download the PHP package robertology/todo_or_die without Composer

On this page you can find all versions of the php package robertology/todo_or_die. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package todo_or_die

Todo Or Die

A deadly reminder for your code rot.

Replace your // @todo comments with something more actionable. This library will help put those more in your face when the time is right. Yes, "Or Die" means an exception will be thrown if your condition is met.

WHY??

I know what you're thinking: Why would anyone want to purposefully cause a failure?

The main idea is that you should hit these in your testing, not in production. But they will be in production, and there's nothing like a little fire under your seat to get things done. (but keep reading for how not to break production)

Yes, it is a bit harsh, but try a grep -ri '@todo' . | wc -l on your codebase and see how many are just sitting around being ignored. Face it, Later equals Never. No one is looking at these todos and your code is just rotting away.

Put a real, actionable deadline on those "for now"s and "after next version"s.

Installation

composer require robertology/todo_or_die

For PHP 7.4, install version 1, and read the README of that version for usage instructions.

(composer require robertology/todo_or_die:^1)

Usage

(string $todo_message, bool|Check $check, callable $callable_for_alerting = null)

Modes of Use

  1. Die

  2. Alert

  3. Die or Alert

Don't Die

Ensure the "Or Die" part never happens by setting the environment variable TODOORDIE_SKIP_DIE to a truthy value. This will cause only Alerts to be triggered. Any Die condition is ignored. (Hint: this might be a smart move for production)

Alert Throttling

To avoid saturating your alert systems, throttling is built in (for Alerts only, not for Die). Each Todo should alert only once per hour. Change that by setting the environment variable TODOORDIE_ALERT_THRESHOLD to the number of seconds desired. Disable throttling by setting this to zero.

Examples

Notes

Personal Quest

In addition to having an actual working tool, I had a few goals for myself with this project.

  1. Full TDD (Test Driven Development)
    • The tests are a mix of Behavior and Functional tests, and I'm OK with that for this small project.
    • I'm not concerned with 100% coverage, but all behavior should have a test.
  2. SOLID "To The Extreme"
    • After getting to a working version, I continued to refactor with an eye on SOLID principles.
    • Such a simple concept could have been written with a single class, but being strict here was a good exercise in defining the Single Responsibility.

License

This project is licensed under the MIT license.


All versions of todo_or_die with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package robertology/todo_or_die contains the following files

Loading the files please wait ....