Download the PHP package markhj/php-tendency without Composer

On this page you can find all versions of the php package markhj/php-tendency. 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 php-tendency

PHP Tendency banner

GitHub Tag Codacy Badge License: MIT

PHP Tendency is a random value generator. But it's not the one you'd pick to find lottery numbers, rather it's the one you'd choose to calculate complex scenarios, where tens or hundreds of factors impact the likelihood of an outcome.

💫 Sounds cool, tell me more

PHP Tendency had its beginning as a "spin-off" from a political simulation game, in which the choices of people, countries and companies needed a degree of randomness, but never total randomness.

The risk that a person commits a crime isn't 50/50. It's determined by personality, criminal history, how the person was raised, life circumstances, social circles, and so forth.

Implementing such complex determination in code isn't easy, and without the proper tooling, it's outright cumbersome: Hard to test, hard to predict, and hard to keep in check.

This is the exact problem PHP Tendency set out to solve. Let's imagine a function which calculates the risk of someone committing a crime. For a prototype, most would probably do something like:

``

But... What if that same thing could look like this?

``

Much better, right? This is easier to test, easier to maintain, and easier to read.

"But where do all these methods like hasLow and hasCriminalRecord come from?" What a great question! They come from extensions. Think of them as custom modules you write specifically for your project. We'll get back to that later in this guide. But they basically provide reusability, modularity, improved overview, and testability.

🍃 Features

📌 Prerequisites

📦 Installation

The library is easily installed with Composer:

`

🚀 Getting started

Let's have a look at the fundamental usage of PHP Tendency. Take note that the really fun stuff comes in the Extensions chapter.

There are a set of base classes called "randomizers". Three are bundled out-of-the-box with PHP Tendency, but you can easily build more on your own, simply by extending RandomBase.

Boolean

To retrieve a random boolean value:

``

`

Float

Retrieve a random floating-point value between a min and max.

``

`bash composer test



### Linting

Linting is carried out with **Laravel Pint**.
Point your IDE to use the file ``pint.json``.

All versions of php-tendency with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 markhj/php-tendency contains the following files

Loading the files please wait ....