Download the PHP package mpyw/unclosure without Composer

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

Unclosure Build Status Coverage Status Scrutinizer Code Quality

Closure unwrapper especially suited for Laravel PDO.

Requirements

Package Version Mandatory
PHP ^7.4 || ^8.0
PHPStan >=1.1

Installing

Examples

Call PDO::setAttribute() after database connection has been established

Temporarily change PDO attributes

API

Value::withCallback()

Call $callback($value, ...$args) or wrap its call into Closure.

Arguments and Return Value

Name Type Description
$value mixed
(A) Closure
First argument for $callback which is unwrappable
$callback (B) callable A callback which takes unwrapped $value as the first argument
...$args mixed Second, third, ... arguments for $callback
<Return Value> mixed
(C) Closure
Decorated Closure or an unwrapped value

(A) $value

Name Type Description
...$initialArgs mixed Arguments for unwrapping Closure
<Return Value> mixed An unwrapped value

(B) $callback

Name Type Description
$value mixed An unwrapped value
...$args mixed Arguments from Value::withCallback()
<Return Value> mixed A decorated unwrapped value

(C) Return Value

Name Type Description
...$initialArgs mixed Arguments for unwrapping $value
<Return Value> mixed An unwrapped value which is propagated from $value(...$initialArgs)

Value::withEffect()
Value::withEffectForEach()

Call $callback(...$args), watching new assignment on &$value. You can conditionally unwrap $value in your $callback by yourself.

Arguments and Return Value

Name Type Description
&$value mixed
(A) Closure
An argument for $configurator which is unwrappable
$configurator (B) callable A configurator callback which takes unwrapped $value as the first argument
$callback (D) callable Any callback function
...$args mixed Arguments for $callback
<Return Value> mixed Return value from $callback(...$args)

(A) &$value

Name Type Description
<Return Value> mixed An unwrapped value

(B) $configurator

Name Type Description
mixed mixed An unwrapped value
<Return Value> null
(C) callable
An optional disposer function corresponding to the configurator

(C) $configurator Return Value

Name Type Description
mixed mixed An unwrapped value

(D) $callback

Name Type Description
...$args mixed Arguments from Value::withEffect()
<Return Value> mixed

All versions of unclosure with dependencies

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

Loading the files please wait ....