Download the PHP package codekandis/phlags without Composer

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

codeKandis/phlags

Minimum PHP Version Code Coverage

codekandis/phlags introduces the possibility to use flagable enums in PHP.

Index

Installation

Install the latest version with

Testing

Test the code with

How to use

Example: Simple permissions in a file system

Declaration

Declare a class extending the flagable base class AbstractFlagable.

General Hints

In the context of manipulating the flagable the following values are supposed to be equal and can similarly passed to all methods of the flagable.

In the other hand the type restriction of PHP does not allow any combination of an integer value with a string with a flagable.

Instantiation

You can easily instantiate your flagable in different ways.

Reading

You can read the value of the flagable in 2 different ways.

Determination

You can determine if one or more specific flags have been set.

Manipulation

You can set, unset and switch flags.

Fluent Manipulation

The base class AbstractFlagable implements the fluent interface. So the manipulation of the flagable can be chained.

String Representation

A flagable can stringified in different ways with different outputs.

Traitful Extensions

To keep the simplicity and performance Phlags provides Traitful Extensions. Instead of implementing a complex and heavyweight inheritance you can combine the extensions of your choice into the flagable of your needs.

Conditional Manipulation

ConditionalManipulationExtension

The Conditional Manipulation provides you with methods to set, unset and switch a flag value while a passed statement must evaluate to true.

Validation

Flagables

While instantiating your very first flagable your flagable has to pass a one-time validation.

If the flagable does not pass the validation an InvalidFlagableException will be thrown and you can retreive an array of detailed error messages of the validation.

Values

A flag value passed to the methods of the flagable has to pass a validation on every method call.

If the value does not pass the validation an InvalidValueException will be thrown and you can retreive an array of detailed error messages of the validation.


All versions of phlags with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
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 codekandis/phlags contains the following files

Loading the files please wait ....