An open API service indexing awesome lists of open source software.

https://github.com/dantleech/phpbench2

Playground for PHPBench 2 ideas
https://github.com/dantleech/phpbench2

Last synced: 11 months ago
JSON representation

Playground for PHPBench 2 ideas

Awesome Lists containing this project

README

          

Invoke
======

[![Build Status](https://travis-ci.org/dantleech/invoke.svg?branch=master)](https://travis-ci.org/dantleech/invoke)

Utility class to create new classes or invoke methods using named arguments.

PHP does not currently support [named
parameters](https://wiki.php.net/rfc/named_params), this utility provides a
convienient way to emulate them.

Installation
------------

Require with composer:

```bash
$ composer require dantleech/invoke
```

Usage
-----

Instantiate a new class:

```php
'value1'
]);
```

Invoke a method:

```php
'value1'
]);

$bar= Invoke::method($foo, 'one', [
'two' => 'bar'
]);
```

Contributing
------------

Pull requests are welcome. For major changes, please open an issue first to
discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[MIT](https://choosealicense.com/licenses/mit/)