Download the PHP package mention/kebab without Composer

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

Kebab 🌮

Kebab is a collection of safety wrappers and testing utilities around a few functions of the PHP standard library. It's so useful that we wanted to use it everywhere, including our personal projects. So we couldn't keep it for ourselves.

Build Status Latest Version MIT License PHPStan Enabled

Install

Goals

The goals of this package are to:

Some functions in the PHP standard library have a notoriously bad API. Take for example json_decode(): If returns null if there was an error, or if the JSON string was the NULL literal. The package provides sane wrappers that automatically check for errors and throw exceptions on failure. The package also provides a wrapper for less broken functions like file_get_contents(), because throwing exceptions on errors is useful.

The wrappers do not only check for errors, they also try to improve the API. For instance, json_decode() is declined in two variants: JsonUtils::decodeArray() and JsonUtils::decodeObject().

All wrappers have static, single return types, to make static analyzers happy. For example, there is Clock::microtimeFloat() and Clock::microtimeString() instead of a single function returning one of two possible types.

Finally, the package provides some tools to make testing easier, such as the Clock class that allows to fake the system time during tests.

Overview

Clock

Clock wraps time(), microtime(), sleep(), usleep() in a way that allows these functions to return a fake time during tests (and the system time otherwise).

Example:

Before calling enableMocking(), Clock methods return the true system time, and sleep functions actually pause the program, as expected. After calling enableMocking(), a fake time is returned instead, and sleep functions advance the fake time without actually pausing the program.

This is heavily inspired by Symfony's ClockMock class.

Date\DateUtils

DateUtils provides a few date creation methods. The class uses Clock to get the system time, so its results can be controlled and predicted in tests.

File\FileUtils

This class provides a few file functions that throw an exception in case of failure.

Json\JsonUtils

This class provides a few JSON functions that throw an exception in case of failure, with a slightly improved interface.

Log\LogUtils

The method LogUtils::truncate() can be used to prevent logging excessively long values. By default, it truncates the given string to 255 bytes. Truncating can be disabled by setting the NO_TRUNCATE_LOG environment variable to 1.

Pcre\PcreUtils

This class provides PCRE/preg wrappers with a better API:

String replacement

Callback replacement

Filter replacement

Other methods

Authors

The Mention team and contributors


All versions of kebab with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
beberlei/assert Version ^3.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 mention/kebab contains the following files

Loading the files please wait ....