Download the PHP package mkrawczyk/funquery without Composer

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

This lib allows you to make operations on arrays in functional style. It is like LINQ, but for PHP.

Designed for PHP 7.4 and higher.

Installation

Example

``

Result can be used as iterator, or converted to Array ``

Like LINQ, it uses lazy execution ``

methods

FunQuery::create(array|IteratorAggregateNode|IteratorNode|FunQuery $init)

Creates FunQuery object from array, generator or iterator.

filter(callable(T):bool $fun)

Executes function for every item and sends to output only, if function returns true

sort(...$funs)

Sorts items. If function is passed, it sorts by result of this function

map(callable(T):T2 $fun)

It keeps the same number of items, but each item is replaced by what was returned by passed function.

first()

Returns first object. Throws exception if pipeline is empty.

firstOrNull()

Returns first object or null if pipeline is empty.

skip(int $count = 0)

Skips first $count items.

limit(?int $limit = null)

Limits number of items to $limit. If $limit is null, it will return all items.

slice(int $skip = 0, ?int $limit = null)

Combines skip and limit. It skips $skip items and limits to $limit items.

flat()

Flattens array of arrays.

distinct(callable(T):T2 $fun=null)

Removes duplicates. If function is passed, it will compare results of this function.

toArray()

Converts FunQuery to array.

toAssoc(callable(T):string $keyFun, callable(T):T2 $valueFun)

Converts FunQuery to associative array. If there are duplicates, it will throw exception.

toAssocArrayIgnoreDuplicates(callable(T):string $keyFun, callable(T):T2 $valueFun)

Converts FunQuery to associative array. If there are duplicates, it will ignore them.

some(callable(T):bool $fun)

Returns true if at least one item matches condition.

every(callable(T):bool $fun)

Returns true if all items match condition.

count()

Returns number of items.

reduce(callable(T,T):T $fun, T $initial)

Reduces items to single value.

groupBy(callable(T):T2 $fun)

Groups items by result of function.

reverse()

Reverses items.

execute()

Executes pipeline. By default FunQuery uses lazy execution, but sometimes you may want to force execution.

min(callable(T):T2 $fun)

Returns minimal value. If function is passed, it will compare results of this function, but returns original value.

max(callable(T):T2 $fun)

Returns maximal value. If function is passed, it will compare results of this function, but returns original value.

sum(callable(T):T2 $fun)

Returns sum of values. If function is passed, it will sum results of this function.

avg(callable(T):T2 $fun)

Returns average of values. If function is passed, it will average results of this function.

concat(FunQuery $funQuery)

Concatenates two FunQuery objects.


All versions of funquery with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
ext-json Version *
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 mkrawczyk/funquery contains the following files

Loading the files please wait ....